Repository navigation
feat: reply threads on crewmate chat messages (ui) - #12815
Conversation
|
Intent: Let the user open a reply thread on any message of a crewmate's chat — a footer under bubbles that have replies, "Reply in thread" on every bubble, and the thread itself in the right side panel with a Reply composer — while the main chat stays visible. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the carried #12923 commit is dropped by rebasing onto merged #12923 before this merges — otherwise ~2,500 unreviewed backend lines land under a [DESIGN-REVIEWED] bbb2078 |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Thread entry points are recognized only by inference: the blind reader rated both the hover speech-bubble icon and the reply-count footer "a guess." Watch
[UX-REVIEWED] bbb2078 |
e920798 to
6ceabed
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review —
|
6ceabed to
724debd
Compare
|
|
|
|
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the undeclared Work-log "chats"→"runs" relabel in every locale is intended to ship here rather than with #12923. Not justified as shipped
What this change shipsInventory (10 items, capped) — 8 justifiedIntent: let a user discuss one message of a crewmate's chat in a Slack-style side-panel thread (frontend of RFC screen 07) — an ADDITION, flagged off.
[FIRST-PRINCIPLES-REVIEWED] bbb2078 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsTwo advisory findings; nothing blocks the merge. FINDING — src/kiro_crew/dashboard/handlers/members.py:463 — the three new FINDING — website/src/pages/members/ThreadPanel.tsx:208 — [OPUS-REVIEWED] bbb2078 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
724debd to
1bf49af
Compare
|
|
|
|
|
|
|
|
a3df9e0 to
56233d5
Compare
GPT 5.6 Review —
|
GPT 5.6 Review —
|
56233d5 to
2009068
Compare
2009068 to
c1de825
Compare
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- docs/feature-map/README.md:107 -- Legacy messages cannot start claimed threads
BLOCKING -- website/src/pages/members/ThreadPanel.tsx:131 -- Lost responses can duplicate durable replies
[BLOCK-MERGE] c1de825 |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/history_projection.py:1304 -- Thread deletion follows a symlinked sidecar directory (origin: validation)
BLOCKING -- src/kiro_crew/dashboard/chat_threads.py:540 -- A lost 202 followed by a failed turn makes retry a no-op
[GPT-REVIEWED] e8f5f0b |
GPT 5.6 Review —
|
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/history.py:2145 -- Empty threads bypass the sidecar item budget BLOCKING -- src/kiro_crew/session_storage.py:1384 -- Pinned sidecar publication is finalized through an unpinned path [BLOCK-MERGE] aa5ca17 |
GPT 5.6 Review —
|
W4's feat/crewmate-chat-bubbles head 955d1f5, cherry-picked onto main e183a46 with four additive conflicts kept both ways (feature-map row, crew-mode section, ChatPane renderer options, transcriptRenderers option types). #13162 (threads flag) is in main and is dropped from the carry. Not this PR's review surface; merges with #12923.
Under a bubble that has replies, a footer: the faces of who took part, "N replies" in accent, "Last reply 2h ago" muted. Every bubble's hover action row, the user's included, gets "Reply in thread". Either opens the thread in the right side panel: the parent quoted as one bubble, a hairline reply count, the replies as small bubbles on the grouped-corner rule (crewmate left, user right-aligned), a typing row while the crewmate replies, and a one-line Reply composer. The main chat stays visible beside it; closing hands the panel's tabs back. Only a crewmate's chat offers threads: the Members page hands ChatPane a ThreadHooks set the assistant and user rows read off the render context; every other surface draws neither footer nor action. Stored replies and the per-slot footer data are React Query reads; the reply in progress streams through a small live store fed by chat.thread_reply frames.
|
Maintainer sweep (2026-09-24, on behalf of @bolichen97) — decision: holding until #12923 lands. This PR itself passes every gate ( |
Problem / Motivation
A crewmate's chat is one flat list. When the user wants to ask about ONE thing the crewmate said ("what about the other 8?"), the question and its answers land in the main chat, between everything else. There is no way to discuss one message on its own, the way a Slack thread does.
Implements the accepted RFC:
docs/request-for-change/rfc-crewmates-launch.md(screen 07, reply threads).The CrewMates launch review decided screen 07: any bubble, yours or the crewmate's, can carry a reply thread that opens in the right side panel while the main chat stays visible. This PR is the frontend half; the API half, #12797, and the
dashboard.crewmate_threadsflag, #13162, are merged. It carries the one open PR it stacks on, #12923 (the grouped bubbles this panel reads its corner rule from), as ONEchore: carry …commit under its own, so every check runs againstmain; that commit goes away when #12923 lands. Review only the second commit.Why it matters
Without threads, every follow-up question pushes the crewmate's real findings up and out of view. The main chat shows only what the crewmate says to you; side questions do not belong in it.
What changed (motivation → approach → change)
ThreadFooterunder a bubbleAssistantMessage,UserMessage); a mid-turn crewmate row has no Reply until the turn's last replypages/members/ThreadPanelThreadHookson the render contextdashboard.crewmate_threadsFlagged, default off.
hooks/useCrewmateThreadsFlag.tsreads the shared['kirocrewConfig']query:ononly once a read saidtrue; a failed read is its ownfailedstate, anErrorNoticewith Retry beside the chat while the last known value stands, never shown as "off". Off, the Members page makes no footer read, passes nothreadshooks, mounts no panel. The switch (pages/settings/CrewmatesSection.tsx, mounted byDeveloperPanel.tsxunder the Crew Members preview card) PATCHes the key and reads it back through the same query; a failed read or save is anErrorNoticewith the agent hand-off (a toggle holds no draft), the read with a Retry;scripts/settingsExtract.tsmaps the file sogen:settingsindexes the row (settingsRegistry.gen.ts,src/kiro_crew/docs/settings-registry.generated.json). Out of scope: config has no crewmate parent flag (Crew Members is a client-side preview flag); the Crewmates heading is visual only.Only the Members page hands
components/ChatPane.tsxathreadshook set;ChatMessageListputs it on theMessageRenderContext, andrenderAssistantBubble(app-sdk/messageRenderers.tsx, shared with #12923's run row inpages/chat/transcriptRenderers.tsx) and the user rows read it: a bubble whosemidhas replies gets the footer, its action row theMessageSquarebutton. Without the hooks the rows are unchanged. The action row keeps two buttons: Copy and Raw markdown move into More, as when Speak is on.Either opens the thread over the side panel's tabs (slides in; fades under
prefers-reduced-motion) and hands them back on close (Escape too). The draft is kept per thread (threadDrafts). Inside: the quoted parent, a hairline count, the replies as small bubbles on the chat's run and corner rule (components/chat/crewmateBubbles.ts), a typing row, and a "Reply in thread…" composer (SendBtndisabled while a reply is in flight or the draft is over 32 KiB; the over-long hint is muted text).Stored replies and footer data are React Query reads (
api/threads.ts); the reply in progress streams throughstate/threadLiveStore.tsfromchat.thread_replyframes (hooks/useWebSocket.ts); a stored frame refetches both, a reconnect every observed thread. A send's success clears the composer only if it still holds the sent text. Failures render throughErrorNotice, one plain sentence picked by the backendcode: a failed send keeps the draft and its reply id (threadPendingReplies), so re-sending is the same reply to the server; a failed thread read has a Retry and the composer waits for it, muted; a failed footer read says the replies are still saved, with a Retry. Twenty-two strings underpages.chat.threadplus six underpages.settings.crewmatesSection, twelve catalogs anden-XA; one plural key inpluralKeys.json.Carried commit: #12923's bubble run (
crewmateBubbles.ts,CrewmateMessage.tsx,handlers/members.py,eventlog/members_projections.py,eventlog_hooks.py,preview_text.py,crew_log/,system_notices.py,history.py,history_projection.py,.github/black-baseline.txt,crew-mode.md,test/CrewmateMessage.test.tsx, thecrewmate-chat-cleanscenario and registry rows), cherry-picked ontomainwith four additive conflicts kept both ways (#12923 meets the same four on its rebase). It also restates one recency comment inhistory_projection.py(an Opus finding on #12923's code; #12923 takes it). Spec:docs/system-specs/modules/history.md, a sentence increw-mode.md, a Reply threads row indocs/feature-map/README.mdwhose entry path starts at the switch; the nightly scenario (crewmate-reply-thread.yaml,features.json) turns it on first.Backwards compatibility
Compatible: new optional props and context fields only; a surface that passes no
threadshooks renders exactly as before. Everything is off untildashboard.crewmate_threadsis turned on.Tests
threadLiveStore.test.ts: deltas of one run accumulate, the terminal frame clears, another run replaces, an error is kept until the next reply, user frames are ignored, threads stay apart, reset drops every row, drafts and pending reply ids are kept per thread.ThreadFooter.test.tsx: the count in words, the last-reply time, the faces in first-appearance order, one button that opens the thread on its bubble's side.api/threads.test.ts: the three calls' URLs (slot and mid encoded), the reply body with and without the client reply id, a refusal as anApiErrorwith the backend code, stable query keys.ThreadPanel.test.tsx: the quoted parent, the count, the grouped crewmate run and the "You" label; Enter sends, the draft clears, send is disabled while the crewmate replies; the streamed reply shows and gives way to the stored one; a retry of the same text re-sends the same reply id, also after close and reopen, and an edited text gets a new one; a thread that failed to load takes no reply until it is retried and puts the keyboard on Retry; a 409 reads as a plain sentence and keeps the draft (a full chat points at a new chat, not a retry); the draft is measured in UTF-8 bytes, not characters; close hands the panel back; Escape closes and focus returns to the opener on unmount; the draft survives close and reopen and a sent reply clears it; a failed load shows the notice with a Retry that re-runs the read.threadLiveStore.test.tsalso coversreset(every row dropped, every thread notified) and the per-thread drafts.en.context.jsongains the translator note for the three-letteryoulabel.CrewmatesSection.test.tsx: the flag hook is off until the config saystrue, the switch saves the key and refetches the shared config, a refused save and a failed read are said (the read with a Retry that re-enables the switch);ThreadPanel.test.tsxalso: words typed while a send is in flight survive its success;MembersPage.test.tsx: off (the default) no footer read is issued and no thread notice or panel is drawn, on the read is issued for the confirmed slot and its failure is shown, a failed config read is a notice with a Retry that turns the feature on in place.CrewmatesSection.test.tsxalso: the hook reports a failed read as failed (not off) and keeps the last known value through a failed refetch.Agentic (gui-user) scenario, tier nightly:
test/gui_user/scenarios/crewmate-reply-thread.yaml— a first-time user turns on the Crew Members preview, chats with Nova Sky, hovers the crewmate's reply, clicks Reply in thread, sees the Thread panel open beside the chat with the bubble quoted and "No replies yet", and sends a reply there; expectations: the panel is open with the chat still visible, the reply is in the panel, the bubble's footer reads "1 reply" ("2 replies" once the crewmate answered), and the main chat does not carry the reply. Registered intest/gui_user/features.json(+ regeneratedFEATURES.md) and the shipped-scenario registry intest_scenarios_and_report.py. Not run locally; the nightly lane drives it.Manual verification
Screenshots: real components rendered against stubbed
/api(Vite + Playwright); backend exercised by CI only. The harness mounts the realMembersPage(roster, Radar's chat, side panel, the shippedThreadFooter, "Reply in thread" action andThreadPanel) with every/apianswer, the thread endpoints included, intercepted by the capture script; each frame's state was asserted (footer text, revealed action row, panel heading, quoted parent, reply order, corner rule, composer, main chat visible beside the panel, "No replies yet" with the composer focused, Copy text and Raw markdown in the open menu, the typing row with send disabled, the load notice with its Retry, the send-failure notice with the draft still in the box, the Members-page summary-failure row with Retry over the mounted chat, and the footer badge refetched to the panel's count after a send) before the shot; the recording's first frame is checked non-blank. Harness and script are not committed.Screenshots / video
The switch: Settings → Developer → Crewmates, off (the default) and on:
Footer under Radar's triage bubble ("4 replies", faces, last reply) and the hovered question bubble's action row with Reply in thread:
The reply thread open in the side panel beside the chat: quoted parent, hairline count, replies on the corner rule, composer:
Starting a new thread from Reply in thread on a message with no replies yet (parent quoted, "No replies yet", composer focused):
The crewmate reply's More menu on this surface, holding the relocated Copy text and Raw markdown:
A reply just sent: the stored row lands, "Radar is replying…" shows while the crewmate answers (send disabled), and the footer badge under the bubble has refetched to the same count the panel shows:
The reply streaming in: two
chat.thread_replydeltas so far, the growing bubble in place of the typing row, no stored crewmate row yet:A thread on the user's own bubble: the footer sits under the right-aligned bubble, Reply in thread on its hovered action row; opened, the panel quotes the user's message as the parent with Radar's reply first:
A send that failed: the notice above the composer names the affordance ("Press send to try again"), the draft kept, footer badge and panel count agreeing:
The per-slot footer read failed: the Members page says so above the chat ("Your replies are still saved; the chat itself is up to date."), with Retry, and the chat stays mounted:
A thread that failed to load: the notice with Retry (focus lands there), the composer muted and disabled with "Press Retry to load the thread, then reply." in place of its placeholder, the draft kept:
Open from the footer, close with Escape (recording starts on the painted chat):
shots 01–02 recorded from 16a5c4a (before the panel moved onto #12923's
crewmateBubblesmodule: same surface and corner rule, bubble padding now the chat'spx-3.5, 2px wider than shown); the panel stills (composer now reads "Reply in thread…") and the recording from the round-24 tree, the More-menu still from round 14 · feat/reply-threads-ui worktree · mode: Vite dev + Playwright,/apistubbed · real components, stubbed API (no backend), no fixtures in the commitRelated Issues
no linked issue: CrewMates launch screen 07 (reply threads), frontend half; depends on #12923 (#12797 and #13162 are in main).
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)