diff --git a/e2e/USER_STORIES.md b/e2e/USER_STORIES.md index 2af80352..fb4c91d4 100644 --- a/e2e/USER_STORIES.md +++ b/e2e/USER_STORIES.md @@ -1571,6 +1571,9 @@ Acceptance: - The Network section lists notes from her follows, resolved through the relays those people publish to. +- It is a list of notes: a reply is counted on the note it answers rather than + drawn underneath it, and never appears as an item of its own. +- Every note carries its reply count, including the ones with no replies. - Scrolling to the end of the feed loads more rather than asking her to. ### US-106 — Share text into the app diff --git a/e2e/specs/notifications.spec.ts b/e2e/specs/notifications.spec.ts index 3f2ffe9a..2656a665 100644 --- a/e2e/specs/notifications.spec.ts +++ b/e2e/specs/notifications.spec.ts @@ -417,6 +417,8 @@ test("US-116 read the home dashboard", async ({seed, as}) => { test("US-117 read the network feed on home", async ({seed, as}) => { const note = "the tide charts are wrong again" + const quiet = "the ferry is running on time" + const reply = "they were reprinted last week" await seed(({relay, user}) => { const space = relay("space") @@ -433,13 +435,31 @@ test("US-117 read the network feed on home", async ({seed, as}) => { space.event(user.alice, () => space.kind(FollowList).writer().follow(user.bob.pubkey).renderTemplate(), ) - space.event(user.bob, () => space.kind(Note).writer().setContent(note).renderTemplate()) + + const posted = space.event(user.bob, () => + space.kind(Note).writer().setContent(note).renderTemplate(), + ) + + space.event(user.bob, () => space.kind(Note).writer().setContent(quiet).renderTemplate()) + + space.event(user.bob, () => + space.kind(Note).writer().setParent(posted.event).setContent(reply).renderTemplate(), + ) }) const page = await as(users.alice, "/home") await expect(page.getByRole("heading", {name: "Network"})).toBeVisible() await expect(page.getByText(note)).toBeVisible() + + // The feed is notes only: a reply is counted on the note it answers rather than drawn + // underneath it, and it never gets a card of its own. + await expect(page.getByRole("button", {name: "1 reply", exact: true})).toBeVisible() + await expect(page.getByText(reply)).toHaveCount(0) + + // The count is there whether or not anybody replied, so every note reads the same. + await expect(page.getByText(quiet)).toBeVisible() + await expect(page.getByRole("button", {name: "0 replies"})).toBeVisible() }) test("US-106 share text into the app", async ({seed, as}) => { diff --git a/src/app/components/CommentTree.svelte b/src/app/components/CommentTree.svelte index eb63fbca..8b2c7668 100644 --- a/src/app/components/CommentTree.svelte +++ b/src/app/components/CommentTree.svelte @@ -24,10 +24,9 @@ setReplyTo?: (comment?: TrustedEvent) => void url?: string context: FeedContext - maxDepth?: number } - const {node, root, replyTo, setReplyTo, url, context, maxDepth = Infinity}: Props = $props() + const {node, root, replyTo, setReplyTo, url, context}: Props = $props() const composing = $derived(replyTo?.id === node.comment.id) @@ -94,21 +93,14 @@ onSubmit={clearReplyTo} /> {/if} - {#if node.children.length > 0 && maxDepth > 1} + {#if node.children.length > 0}