M18-5: Architect chat UI (streaming, markdown, slash commands) #166

Closed
opened 2026-04-20 16:02:59 +00:00 by code-lead · 1 comment
Collaborator

As an operator, I want a chat surface on /app/planner that streams the architect's responses with tool-call rendering, markdown, and session history, so that I can think out loud with the architect about what to build next.

Acceptance criteria

Layout

  • Two-pane: left is sessions list (collapse/expand, new-session button); right is active chat transcript + composer
  • Composer: multi-line textarea with ⌘/ctrl+Enter send; auto-growing; attach/reference file picker (lists specs/*.md, config/agents.json initially)

Streaming

  • Messages render incrementally from /architect/stream/:task_id. Partial text shows a blinking cursor at the tail; tool calls collapse to a titled pill until finished
  • Markdown rendering via react-markdown + GFM + syntax-highlighted code (Shiki; token palette tuned to Tokyo Night Storm)
  • Tool-call blocks are expandable, showing input args and output (reuse component from #M18-3 event log)

Session management

  • New session starts empty with the architect's default system prompt surfaced (read-only, collapsible "System" block)
  • Switching sessions restores the full transcript from /architect/sessions/:id
  • Delete button with confirm modal (Base UI Dialog)

Integrations

  • Slash-command palette in the composer:
    • /spec <name> — asks the architect to draft specs/<name>.md
    • /breakdown specs/<name>.md — triggers the existing breakdown skill via architect
    • /assign <issue#> <agent> — updates the issue's assignee through architect's Forgejo MCP
  • Pointing at a file via @specs/foo.md in the composer attaches its contents to the prompt automatically

Tests

  • Component test for the transcript renderer with a fixture stream
  • Playwright: start a session, send a message, mock the stream, assert tool-call pill toggles + final markdown renders

Out of scope

  • Voice input, image paste, file upload beyond specs/ + config/ references
  • Real-time multi-client sync (single operator assumption)
  • Re-running a past message in a past session (start a new session instead)

Dependencies

  • Blocks on #M18-2 + #M18-4.
  • Unblocks #M18-6 + #M18-7.

References

  • Spec: specs/m18-ui-rewrite-and-architect.md §Story M18-5
As an operator, I want a chat surface on `/app/planner` that streams the architect's responses with tool-call rendering, markdown, and session history, so that I can think out loud with the architect about what to build next. ## Acceptance criteria ### Layout - [ ] Two-pane: left is sessions list (collapse/expand, new-session button); right is active chat transcript + composer - [ ] Composer: multi-line textarea with ⌘/ctrl+Enter send; auto-growing; attach/reference file picker (lists `specs/*.md`, `config/agents.json` initially) ### Streaming - [ ] Messages render incrementally from `/architect/stream/:task_id`. Partial text shows a blinking cursor at the tail; tool calls collapse to a titled pill until finished - [ ] Markdown rendering via `react-markdown` + GFM + syntax-highlighted code (Shiki; token palette tuned to Tokyo Night Storm) - [ ] Tool-call blocks are expandable, showing input args and output (reuse component from #M18-3 event log) ### Session management - [ ] New session starts empty with the architect's default system prompt surfaced (read-only, collapsible "System" block) - [ ] Switching sessions restores the full transcript from `/architect/sessions/:id` - [ ] Delete button with confirm modal (Base UI `Dialog`) ### Integrations - [ ] Slash-command palette in the composer: - `/spec <name>` — asks the architect to draft `specs/<name>.md` - `/breakdown specs/<name>.md` — triggers the existing `breakdown` skill via architect - `/assign <issue#> <agent>` — updates the issue's assignee through architect's Forgejo MCP - [ ] Pointing at a file via `@specs/foo.md` in the composer attaches its contents to the prompt automatically ### Tests - [ ] Component test for the transcript renderer with a fixture stream - [ ] Playwright: start a session, send a message, mock the stream, assert tool-call pill toggles + final markdown renders ## Out of scope - Voice input, image paste, file upload beyond `specs/` + `config/` references - Real-time multi-client sync (single operator assumption) - Re-running a past message in a past session (start a new session instead) ## Dependencies - **Blocks on #M18-2 + #M18-4.** - **Unblocks #M18-6 + #M18-7.** ## References - Spec: `specs/m18-ui-rewrite-and-architect.md` §Story M18-5
Collaborator

Mockup reference: this story blocks on the Penpot frames produced by #187 (M18-5.1) — 3 frames covering the chat surface at rest, active transcript with streaming + tool-call pills, and the slash palette + @file popup. Do not start CSS/layout work until the designer hands off and the design-reviewer verdict is APPROVED. Primary visual inspiration = t3code's chat screens, adapted to design/tokens.json.

**Mockup reference**: this story blocks on the Penpot frames produced by **#187 (M18-5.1)** — 3 frames covering the chat surface at rest, active transcript with streaming + tool-call pills, and the slash palette + @file popup. Do not start CSS/layout work until the designer hands off and the `design-reviewer` verdict is APPROVED. Primary visual inspiration = t3code's chat screens, adapted to `design/tokens.json`.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#166
No description provided.