feat(web): Canvas chat, message send, and hide-completed default - #64
Merged
Conversation
Detail drawer becomes a conversation view: the user's prompt (turn.started.prompt, attached by the daemon on the initial turn and on every send) renders as a user bubble, assistant message events as full answer bubbles, and tool/permission/file events as compact lines. The transcript reads GET /api/sessions/:id/logs (up to 1000 events) instead of the 10-event session.get slice, and autoscrolls to the latest entry. Sending is wired through a new POST /api/sessions/:id/send, proxying to the existing daemon session.send method (resume turn). The body is capped at 64 KiB (413), validated (400), and daemon error codes map to HTTP statuses: SESSION_NOT_FOUND 404, SESSION_BUSY 409, CAPABILITY_NOT_SUPPORTED 400. The send box locks itself while the session is working/starting and for origin=open interactive heads, with the reason spelled out next to the input. Hiding completed sessions is now the default: a clean URL is the filtered state and ?hide=0 opts back in (?hide=1 keeps working).
Four tests repeated the expect(CANVAS_PAGE).toContain(...) shape; Sonar's CPD counted the new lines as duplicated blocks (11.8% > 3% on web-command.test.ts). One table + one assertion pattern replaces all four without losing coverage.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Chat transcript in the detail drawer. Clicking any node now opens a conversation view instead of a flat activity list:
turn.started.prompt(the daemon attaches it on the initial turn and on everysession.send)messageeventsGET /api/sessions/:id/logs(up to 1000 events, endpoint already existed but was unused by the canvas) instead of the 10-eventsession.getslice; renders the last 200 entries and autoscrolls to the latestSend messages from the web. New
POST /api/sessions/:id/sendproxies to the existing daemonsession.sendmethod (resume turn, same pathcodedeck senduses):SESSION_NOT_FOUND→ 404,SESSION_BUSY→ 409,CAPABILITY_NOT_SUPPORTED→ 400working/starting("aguarde o turno atual terminar") and fororigin=openinteractive heads ("sessão interativa não aceita mensagens"); the poll keeps the lock state fresh as turns start and endHide-completed is now the default. A clean URL is the filtered state;
?hide=0opts back in and?hide=1keeps working for existing bookmarks. The eye button starts active.Why
The orchestrator nodes only ever showed "Trabalhando agora · processando..." — there was no way to see what a session actually said, and no way to answer it from the browser. The daemon already persisted everything needed and already implemented
session.send; the web layer was the only gap.Verification
npx vitest run: 74 files / 885 tests green (web-command suite covers the send route end-to-end: proxy, validation, 413, error mapping, method guards)tsc --noEmitcleanPOST .../zzfake/send→ 404, broken JSON → 400; drawer verified in a real browser — 94-entry transcript rendered with autoscroll, input locked on anopen-origin orchestrator and enabled on a completed run session; default filter shows "97 ocultas" with 3 visible nodes and no URL params