From 7e82429a1a214e4651d16dfd4309a037d3bfe840 Mon Sep 17 00:00:00 2001 From: Coracle-Bot Date: Wed, 9 Sep 2026 15:22:44 +0000 Subject: [PATCH] Let the threads page choose which board a new thread goes to --- e2e/USER_STORIES.md | 2 +- e2e/specs/articles-threads.spec.ts | 14 +++++++ src/app/components/ThreadCreate.svelte | 40 ++++++++++++++++--- .../spaces/[relay]/threads/+page.svelte | 2 +- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/e2e/USER_STORIES.md b/e2e/USER_STORIES.md index be03cfb7..e2c6b9a6 100644 --- a/e2e/USER_STORIES.md +++ b/e2e/USER_STORIES.md @@ -669,7 +669,7 @@ Acceptance: - Creating a thread from a room's compose menu files it under that room's board and posts a quote of it into the room's chat. - Creating a thread from the top-level Threads page files it under a "General" - board. + board, or under whichever board is picked from its board selector. - Each board row shows the topic title, author, reply count, and last-post time. ### US-043 — Reply to a thread and to a specific post diff --git a/e2e/specs/articles-threads.spec.ts b/e2e/specs/articles-threads.spec.ts index 9174bcbf..0ce99535 100644 --- a/e2e/specs/articles-threads.spec.ts +++ b/e2e/specs/articles-threads.spec.ts @@ -691,6 +691,20 @@ test("US-042 start a thread and see it filed under its room", async ({seed, as}) .filter({has: page.getByRole("heading", {name: "General", exact: true})}) await expect(general.getByRole("row").filter({hasText: "Open floor"})).toBeVisible() + + // The threads page has no room of its own, so the form offers one. + await pageBar(page).getByRole("button", {name: "Create", exact: true}).click() + + const toLounge = modal(page, "Create a Thread") + + await toLounge.getByRole("combobox").selectOption({label: "Lounge"}) + await toLounge.getByPlaceholder("What is this thread about?").fill("Carpet swatches") + await editorOf(toLounge).pressSequentially("Beige is a choice.") + await toLounge.getByRole("button", {name: "Create Thread"}).click() + + await expect(page.getByRole("heading", {name: "Create a Thread"})).toHaveCount(0) + + await expect(lounge.getByRole("row").filter({hasText: "Carpet swatches"})).toBeVisible() }) test("US-043 reply to a thread and to a specific post", async ({seed, as}) => { diff --git a/src/app/components/ThreadCreate.svelte b/src/app/components/ThreadCreate.svelte index 044d26f1..67bc8f25 100644 --- a/src/app/components/ThreadCreate.svelte +++ b/src/app/components/ThreadCreate.svelte @@ -1,5 +1,6 @@ @@ -151,6 +164,21 @@ {/snippet} + {#if selectRoom && roomOptions.length > 0} + + {#snippet label()} +

Board

+ {/snippet} + {#snippet input()} + + {/snippet} +
+ {/if} {#snippet label()}

Message*

diff --git a/src/routes/spaces/[relay]/threads/+page.svelte b/src/routes/spaces/[relay]/threads/+page.svelte index 01c73701..d5d54f49 100644 --- a/src/routes/spaces/[relay]/threads/+page.svelte +++ b/src/routes/spaces/[relay]/threads/+page.svelte @@ -34,7 +34,7 @@ let element: HTMLElement | undefined = $state() let events: Readable = $state(readable([])) - const createThread = () => pushModal(ThreadCreate, {url}) + const createThread = () => pushModal(ThreadCreate, {url, selectRoom: true}) const threadFeed = $derived.by(() => { const scores = new Map()