diff --git a/ROADMAP.md b/ROADMAP.md index 0f722ebe..d2a75ad4 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,12 +1,9 @@ # Current - [ ] Refactor - - Split out Note pieces - Move global modals to child components? - Combine app/agent, rename app2 - - Some elements bleed through reply image modal - DM view pushes user back to the bottom - - note.replies might be empty in note detail pre-load - [ ] Improve topic suggestions and rendering - [ ] Add topic search - [ ] Relays bounty diff --git a/src/app2/shared/Note.svelte b/src/app2/shared/Note.svelte index 0e2c7b89..5fdf042a 100644 --- a/src/app2/shared/Note.svelte +++ b/src/app2/shared/Note.svelte @@ -31,6 +31,7 @@ export let invertColors = false let reply = null + let replyIsActive = false let actions = null let visibleNotes = [] let collapsed = false @@ -106,123 +107,140 @@ }) -
- - {#if !showParent} -
- {/if} -
- - - -
-
-
- -
- - {displayPerson($author)} - {#if $author.verified_as} - - {/if} - -
-
- -
-
- - {timestamp} +
+
+ + {#if !showParent} +
+ {/if} +
+ +
-
-
- {#if findReplyId(note) && showParent} - - - View Parent - - {/if} - {#if findRootId(note) && findRootId(note) !== findReplyId(note) && showParent} - - - View Thread - - {/if} +
+
+ +
+ + {displayPerson($author)} + {#if $author.verified_as} + + {/if} + +
+
+ +
+
+ + {timestamp} +
- {#if muted} -

- You have muted this note. -

- {:else} - - {/if} - +
+
+ {#if findReplyId(note) && showParent} + + + View Parent + + {/if} + {#if findRootId(note) && findRootId(note) !== findReplyId(note) && showParent} + + + View Thread + + {/if} +
+ {#if muted} +

+ You have muted this note. +

+ {:else} + + {/if} + +
+
+ +
+ + {#if !replyIsActive && visibleNotes.length > 0 && !showEntire && depth > 0 && !muted} +
+
{ + collapsed = !collapsed + }}> + +
+ {#if collapsed} + + {:else} + + {/if} +
+
+ {collapsed ? "Show replies" : "Hide replies"} +
+
- + {/if} + + { + replyIsActive = true + }} + on:reset={() => { + replyIsActive = false + }} + {note} + {borderColor} /> + + {#if !collapsed && visibleNotes.length > 0 && depth > 0 && !muted} +
+
+
+ {#if !showEntire && note.replies.length > visibleNotes.length} + + {/if} + {#each visibleNotes as r (r.id)} + + {/each} +
+
+ {/if}
- - - -{#if !reply?.isActive() && visibleNotes.length > 0 && !showEntire && depth > 0 && !muted} -
-
{ - collapsed = !collapsed - }}> - -
- {#if collapsed} - - {:else} - - {/if} -
-
- {collapsed ? "Show replies" : "Hide replies"} -
-
-
-
-{/if} - -{#if !collapsed && visibleNotes.length > 0 && depth > 0 && !muted} -
-
-
- {#if !showEntire && note.replies.length > visibleNotes.length} - - {/if} - {#each visibleNotes as r (r.id)} - - {/each} -
-
-{/if} diff --git a/src/app2/shared/NoteContent.svelte b/src/app2/shared/NoteContent.svelte index 59bccd52..a16e9f49 100644 --- a/src/app2/shared/NoteContent.svelte +++ b/src/app2/shared/NoteContent.svelte @@ -2,7 +2,7 @@ import {objOf, reverse} from "ramda" import {navigate} from "svelte-routing" import {fly} from "svelte/transition" - import {splice} from 'hurdak/lib/hurdak' + import {splice} from "hurdak/lib/hurdak" import {warn} from "src/util/logger" import {displayPerson, parseContent, Tags} from "src/util/nostr" import MediaSet from "src/partials/MediaSet.svelte" @@ -38,7 +38,7 @@ (type === "link" && !value.startsWith("ws")) || ["nostr:note", "nostr:nevent"].includes(type) ) { - if (type === 'link') { + if (type === "link") { links.push(value) } else { entities.push({type, value}) @@ -72,11 +72,11 @@ // Truncate content if needed let l = 0 if (shouldTruncate) { - for (const i in content) { + for (let i = 0; i < content.length; i++) { const prev = content[i - 1] // Avoid adding an ellipsis right after a newline - if (l > truncateAt && prev?.type != 'newline') { + if (l > truncateAt && prev?.type != "newline") { content = content.slice(0, i).concat({type: "text", value: "..."}) break diff --git a/src/app2/shared/NoteReply.svelte b/src/app2/shared/NoteReply.svelte index e0f263b4..569ca2bf 100644 --- a/src/app2/shared/NoteReply.svelte +++ b/src/app2/shared/NoteReply.svelte @@ -1,5 +1,6 @@