mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
Fix quote length
This commit is contained in:
parent
d5b3d935a4
commit
24a198bf80
24
ROADMAP.md
24
ROADMAP.md
@ -1,5 +1,29 @@
|
|||||||
# Current
|
# Current
|
||||||
|
|
||||||
|
- [ ] White-labeled
|
||||||
|
- [ ] Add invite code registration for relay
|
||||||
|
- [ ] Add endpoint to nostream that updates whitelist
|
||||||
|
- [ ] Show invite code somewhere so users can share it.
|
||||||
|
- [ ] Use a signed string so it's based on pubkey?
|
||||||
|
- [ ] Nostream is public-read, apply registration to reads as well
|
||||||
|
- [ ] Avoid leaking events from private relays
|
||||||
|
- [ ] Image classification
|
||||||
|
- https://github.com/bhky/opennsfw2
|
||||||
|
- [ ] Convert app store to nip 89
|
||||||
|
- [ ] Put search icon in header or hover button, open in modal
|
||||||
|
- [ ] Centralize relays
|
||||||
|
- This is ok, relays are the source of decentralization
|
||||||
|
- clients can help with discoverability
|
||||||
|
- Add agent to dufflepud database that scrapes relays and reviews
|
||||||
|
- Serve relays from dufflepud
|
||||||
|
- Or maybe set up a special purpose relay for relay recs?
|
||||||
|
|
||||||
|
# Core
|
||||||
|
|
||||||
|
- [ ] Private groups
|
||||||
|
- [ ] Support server-rendered link previews
|
||||||
|
- [ ] Feeds load forever if a modal is open
|
||||||
|
- [ ] Support other list types than 30001
|
||||||
- [ ] Spam
|
- [ ] Spam
|
||||||
- Add configurable POW req for replies
|
- Add configurable POW req for replies
|
||||||
- Add event queue and undo, use the delay to calculate POW
|
- Add event queue and undo, use the delay to calculate POW
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {without} from "ramda"
|
import {without, last} from "ramda"
|
||||||
import {
|
import {
|
||||||
parseContent,
|
parseContent,
|
||||||
getLinks,
|
getLinks,
|
||||||
@ -18,7 +18,9 @@
|
|||||||
import NoteContentQuote from "src/app/shared/NoteContentQuote.svelte"
|
import NoteContentQuote from "src/app/shared/NoteContentQuote.svelte"
|
||||||
import NoteContentEntity from "src/app/shared/NoteContentEntity.svelte"
|
import NoteContentEntity from "src/app/shared/NoteContentEntity.svelte"
|
||||||
|
|
||||||
export let note, anchorId, maxLength, showEntire
|
export let note, maxLength
|
||||||
|
export let anchorId = false
|
||||||
|
export let showEntire = false
|
||||||
export let showMedia = false
|
export let showMedia = false
|
||||||
|
|
||||||
const fullContent = parseContent(note)
|
const fullContent = parseContent(note)
|
||||||
@ -44,13 +46,13 @@
|
|||||||
<QRCode fullWidth onClick="copy" code={value} />
|
<QRCode fullWidth onClick="copy" code={value} />
|
||||||
</div>
|
</div>
|
||||||
{:else if type === LINK}
|
{:else if type === LINK}
|
||||||
<NoteContentLink {value} showMedia={showMedia && isStartOrEnd(i) && value.url.includes('/')} />
|
<NoteContentLink {value} showMedia={showMedia && isStartOrEnd(i) && last(value.url.split('://')).includes('/')} />
|
||||||
{:else if type.match(/^nostr:np(rofile|ub)$/)}
|
{:else if type.match(/^nostr:np(rofile|ub)$/)}
|
||||||
<NoteContentPerson {value} />
|
<NoteContentPerson {value} />
|
||||||
{:else if type.startsWith("nostr:") && showMedia && isStartOrEnd(i) && value.id !== anchorId}
|
{:else if type.startsWith("nostr:") && showMedia && isStartOrEnd(i) && value.id !== anchorId}
|
||||||
<NoteContentQuote {note} {value}>
|
<NoteContentQuote {note} {value}>
|
||||||
<div slot="note-content" let:quote>
|
<div slot="note-content" let:quote>
|
||||||
<svelte:self note={quote} />
|
<svelte:self note={quote} {anchorId} {maxLength} {showMedia} showEntire={false} />
|
||||||
</div>
|
</div>
|
||||||
</NoteContentQuote>
|
</NoteContentQuote>
|
||||||
{:else if type.startsWith("nostr:")}
|
{:else if type.startsWith("nostr:")}
|
||||||
|
@ -11,10 +11,13 @@
|
|||||||
import {getPersonWithFallback} from "src/agent/db"
|
import {getPersonWithFallback} from "src/agent/db"
|
||||||
import {sampleRelays} from "src/agent/relays"
|
import {sampleRelays} from "src/agent/relays"
|
||||||
import network from "src/agent/network"
|
import network from "src/agent/network"
|
||||||
|
import user from "src/agent/user"
|
||||||
|
|
||||||
export let note
|
export let note
|
||||||
export let value
|
export let value
|
||||||
|
|
||||||
|
let muted = false
|
||||||
|
|
||||||
const openPerson = pubkey => modal.push({type: "person/feed", pubkey})
|
const openPerson = pubkey => modal.push({type: "person/feed", pubkey})
|
||||||
|
|
||||||
const loadQuote = async () => {
|
const loadQuote = async () => {
|
||||||
@ -28,15 +31,24 @@
|
|||||||
filter: [{ids: [id]}],
|
filter: [{ids: [id]}],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
muted = user.applyMutes([event]).length === 0
|
||||||
|
|
||||||
return event || Promise.reject()
|
return event || Promise.reject()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
warn(e)
|
warn(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const openQuote = () => {
|
const openQuote = e => {
|
||||||
|
// stopPropagation wasn't working for some reason
|
||||||
|
if (e.target.textContent !== "Show") {
|
||||||
modal.push({type: "note/detail", note: {id: value.id}})
|
modal.push({type: "note/detail", note: {id: value.id}})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const unmute = e => {
|
||||||
|
muted = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
@ -44,6 +56,12 @@
|
|||||||
{#await loadQuote()}
|
{#await loadQuote()}
|
||||||
<Spinner />
|
<Spinner />
|
||||||
{:then quote}
|
{:then quote}
|
||||||
|
{#if muted}
|
||||||
|
<p class="mb-1 py-24 text-center text-gray-5" in:fly={{y: 20}}>
|
||||||
|
You have muted this note.
|
||||||
|
<Anchor on:click={unmute}>Show</Anchor>
|
||||||
|
</p>
|
||||||
|
{:else}
|
||||||
{@const person = getPersonWithFallback(quote.pubkey)}
|
{@const person = getPersonWithFallback(quote.pubkey)}
|
||||||
<div class="mb-4 flex items-center gap-4">
|
<div class="mb-4 flex items-center gap-4">
|
||||||
<PersonCircle size={6} {person} />
|
<PersonCircle size={6} {person} />
|
||||||
@ -56,6 +74,7 @@
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
</div>
|
</div>
|
||||||
<slot name="note-content" {quote} />
|
<slot name="note-content" {quote} />
|
||||||
|
{/if}
|
||||||
{:catch}
|
{:catch}
|
||||||
<p class="mb-1 py-24 text-center text-gray-5" in:fly={{y: 20}}>
|
<p class="mb-1 py-24 text-center text-gray-5" in:fly={{y: 20}}>
|
||||||
Unable to load a preview for quoted event
|
Unable to load a preview for quoted event
|
||||||
|
@ -144,10 +144,6 @@ export const createScroller = (loadMore, {reverse = false, element = null} = {})
|
|||||||
|
|
||||||
element = element || document.body
|
element = element || document.body
|
||||||
|
|
||||||
// NOTE TO FUTURE SELF
|
|
||||||
// If the scroller is saturating request channels on a slow relay, the
|
|
||||||
// loadMore function is not properly awaiting all the work necessary.
|
|
||||||
// That is the problem, but see commit 8371fde for another strategy
|
|
||||||
let done = false
|
let done = false
|
||||||
const check = async () => {
|
const check = async () => {
|
||||||
// While we have empty space, fill it
|
// While we have empty space, fill it
|
||||||
|
Loading…
Reference in New Issue
Block a user