diff --git a/e2e/USER_STORIES.md b/e2e/USER_STORIES.md index 57b7d8ff..6bc9f7f8 100644 --- a/e2e/USER_STORIES.md +++ b/e2e/USER_STORIES.md @@ -727,7 +727,7 @@ so that responses connect to the right thing. Acceptance: - "Reply to thread" opens a composer with no quoted parent, and submitting - appends a post and increments the reply count in the header. + appends a post and increments the reply count on the opening post. - "Reply" on a single post shows "Replying to" that post, which can be cleared before submitting. - A reply to a thread in a room is tagged into that room, so the relay handles diff --git a/e2e/specs/articles-threads.spec.ts b/e2e/specs/articles-threads.spec.ts index f2a49192..869f9934 100644 --- a/e2e/specs/articles-threads.spec.ts +++ b/e2e/specs/articles-threads.spec.ts @@ -754,8 +754,8 @@ test("US-043 reply to a thread and to a specific post", async ({seed, as}) => { await expect(openingPost.getByText("OP", {exact: true})).toBeVisible() await expect(bob.getByText("20 replies")).toBeVisible() - // The page bar carries the title, so the opening post does not repeat it. - await expect(bob.getByText("Bed rotation")).toHaveCount(1) + // The opening post carries the title, and the summary bar replaces it once it scrolls away. + await expect(openingPost).toContainText("Bed rotation") await bob.getByRole("button", {name: "Reply to thread"}).click() @@ -975,6 +975,6 @@ test("US-045 turn a chat message into a thread", async ({seed, as}) => { await row.click() - await expect(page.getByRole("heading", {name: "Deploy failures"})).toBeVisible() + await expect(page.locator("article").filter({hasText: "Deploy failures"})).toBeVisible() await expect(page.getByText("the deploy broke again")).toBeVisible() }) diff --git a/e2e/specs/content-rendering.spec.ts b/e2e/specs/content-rendering.spec.ts index 716b50fb..b8879412 100644 --- a/e2e/specs/content-rendering.spec.ts +++ b/e2e/specs/content-rendering.spec.ts @@ -393,7 +393,7 @@ test("US-065 see quoted and embedded content", async ({seed, as}) => { await page.waitForURL(next => next.pathname === `${spacePath(url)}/threads/${thread.id}`) - await expect(page.getByRole("heading", {name: "Roadmap for Q3"})).toBeVisible() + await expect(page.locator(`[data-event="${thread.id}"]`)).toContainText("Roadmap for Q3") }) test("US-066 see distinctive inline tokens", async ({seed, as}) => { diff --git a/e2e/specs/notifications.spec.ts b/e2e/specs/notifications.spec.ts index e2d2f2f1..dfc0cdf2 100644 --- a/e2e/specs/notifications.spec.ts +++ b/e2e/specs/notifications.spec.ts @@ -791,7 +791,7 @@ test("US-112 see which threads are unread", async ({seed, as}) => { await hers.click() - await expect(pageBar(bob)).toContainText("the server is on fire") + await expect(bob.locator("article").filter({hasText: "the server is on fire"})).toBeVisible() // Opening a thread is what marks it read, so only the one he opened loses its dot await bob.goBack() diff --git a/src/app/components/ThreadPost.svelte b/src/app/components/ThreadPost.svelte index cd5ff950..77f01153 100644 --- a/src/app/components/ThreadPost.svelte +++ b/src/app/components/ThreadPost.svelte @@ -25,9 +25,10 @@ threadPubkey: string onReply: (event: TrustedEvent) => void context: FeedContext + replyCount?: number } - const {url, event, threadPubkey, onReply, context}: Props = $props() + const {url, event, threadPubkey, onReply, context, replyCount}: Props = $props() const profileDisplay = $profiles.display(event.pubkey, [url]).$ const handle = $handles.forPubkey(event.pubkey).$ @@ -69,7 +70,13 @@
- {formatTimestamp(event.created_at)} +
+ {formatTimestamp(event.created_at)} + {#if replyCount !== undefined} + ยท + {replyCount} {replyCount === 1 ? "reply" : "replies"} + {/if} +
{#if hiddenCount > 0}