Repository navigation
CONTRACT: feat(ui-react): show the draft's save state as a compact indicator beside Attach (#3155) - #3776
Conversation
…dicator beside Attach (#3155) The composer's draft status is now the kit StatusIndicator, beside Attach (rev 4 §1, E1 A), in place of D52's persistent line under the field. It shows success only when the host acknowledged this exact edit with every original bound and nothing of it still uploading. An older revision's acknowledgement never shows success. The other states come from rev 4 §1: active, queued, offline, unconfirmed, upload failed or unconfirmed, and space refusal with Open Storage. D52's too large, full and unavailable become indicator states. Compare drafts and Open other version are detail actions. An empty draft keeps the slot with no control. A save whose answer was lost reads as unconfirmed. Check again (BrainUiConnection.drafts.checkSave) reads the draft once and compares revision, text, images, files[].fileId and snapshots with that save. It never sends a PUT. The kit Composer gains an optional status slot: a 44px box that takes a 28px place in the row, so the field keeps its height. A reload names files that were still uploading instead of restoring their chips. The device-kept work context records their names, never bytes, and the composer shows a dismissible notice with no claim about storage or cleanup. Docs: package-api and integration-contract index, the chat-attachments record, and the scoped D52 amendment. Re-anchors one draft-client citation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e clock (#3155) Main moved draft-files.test.ts onto vi.useFakeTimers(); the reload-names case's Bun.sleep(10) never resolved there. It now uses the file's turn(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No uploads on this PR yet This PR changes UI files (
Tips for agentsLabel each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one uploads put after.png --pr 3776 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 3776 --app ios --screen "Chat" --state afterNo CLI? With the Uploads MCP, call This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with Workspace admins can turn this comment off in Settings → GitHub · docs |
#3155) draft-indicator.offline.tsx reset the page to prefers-reduced-motion: no-preference after each case. The pinned runner starts with reduce, so later files in the same layout shard (handoff-sheet, agent-orbit, turn-time) measured mid-animation layouts and failed. The file now restores the preference it found, and case 18 sets its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ison #3776 put the save indicator beside Attach; no dictation story draws it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heet (#3772) * feat(ui-react): tap the composer mic to dictate, hold it to open Start The composer's resting mic is now the kit's MicButton in the Composer micControl slot (#3727). A tap, Enter or Space dictates through the existing path. A press fills the ring from elapsed time; at 0.6 s (V1) a light haptic fires and the existing Start disclosure opens, or the S4 notice where live conversation is not available (V4). An earlier release is a tap, and leaving the mic cancels the hold. Shift+Enter and the "Talk live..." action open Start from a keyboard or screen reader. A hold starts a timer and a frame loop only: no microphone, provider or history work. The offline "Record on this device" mic has no hold (M1). Dictating, a recording in progress, an undecided mic, and a host with neither dictation nor live conversation keep the kit's own mic. The attach menu's "Live conversation" row and its naming are removed, with their tests; the D37 note records the move. A new rail-* browser test presses the real mic with mouse and touch input and instruments getUserMedia and the network to prove a hold, or a cancelled one, captures nothing. Refs #3693 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ui-kit): let a Composer's micControl come and go without a margin fault The textarea set `margin: 0` and, with micControl, `marginBottom` beside it. A mounted field that drops micControl (the app does, on dictating) made React remove the longhand under the shorthand: the bottom margin went unset, and React warned, which the capture gate reports as a browser fault. One shorthand now carries the lift; the pixels are the same. Refs #3693 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(ui-react): dictate in the voice field and remove the dictation sheet Dictation is drawn with the signed-off kit components, unchanged (#3694, stories from #3738). The capture states (Dc connecting, D2 asking for the microphone, D3 listening, D4 quiet, D5 finishing) replace the composer with the compact VoiceField, naming the destination in the label meta. D0, Dx, D7 and D8 are VoiceNotices above the composer. D6 puts what a take heard into the draft as plain editable text, caret at the end, and the mic reads "Dictate more". A take stops itself after 30 s without speech (V3). The dictation sheet and review card are removed, with their CSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(ui-react): drive every dictation state of the voice field in Chromium The dictation project's suite now runs D0 to D8, Dc and Dx through the real composer with a local speech double, and compares each state with its kit story. The notice suite covers D7 and D8 through the shipped clients. Suites that drove the old sheet or review card follow the field, and the failure screenshots committed with the old suite are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(ui-react): describe dictation in the voice field Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(ui-react): follow dictated and reviewed voice text into the draft The runtime and offline suites that read the removed review card or pressed Done now finish with "Finish dictation" and read the composer's draft: external speech, dictation selection, local work, draft branches and the live conversation's "Review in composer" transfers. The resting and D6 mics name the next take's service ("Dictate more · <service>"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(ui-kit): leave the draft's save state out of the D6 story comparison #3776 put the save indicator beside Attach; no dictation story draws it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ui-react): say what happens to the audio per service on the first-take card Gemini keeps "The audio isn't kept." Deepgram, browser speech and any other service can't be verified here, so D0 says that service's own retention policy applies instead (maintainer decision on #3694, 2026-11-09). Same VoiceNotice; only its body text differs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Refs #3155
What changed
The composer now shows the draft's save state as the #3281
StatusIndicatorbeside Attach, in place of the persistent save line (rev 4 §1, the D2 ruling, a scoped amendment to D52).BrainUiConnection.drafts.checkSave(draftId). It makes oneGET /api/drafts/:draftIdand compares revision, text, images,files[].fileIdand snapshots with the save whose answer was lost. It never sends a PUT.Composergains an optionalstatusslot.DraftSaveLinestays exported and is still used by the voice conversation strip.Open visual question, for the human visual review
Indicator placement. Rev 4 §1 places the draft indicator in the composer tool row, in the order attach · indicator · model label · send. This slice puts it beside Attach inside the existing field row (attach · indicator · field · mic · send) and leaves the model label in the hint row below. Moving the model label into that row would be a broader composer redesign, which #3155's scope excludes. The indicator's box is 44 px and touches its neighbours' boxes without overlapping, and Attach and Send keep their current kit sizes. The maintainer referred this to the reserved human visual review: please confirm this placement or ask for rev 4's order. Screenshots:
packages/ui-react/.vitest-attachments/draft-indicator/{dark,light}-{320,1280}.png.Why this shape
Choices the rulings leave open, made conservatively
announce={false}. The old line was silent, and upload outcomes keep the composer's own announcement.fetchcannot tell "never arrived" from "answer lost". Offline means only that the browser or the socket is down.Proof
Unit tests:
draft-indicator.test.ts11 pass;draft-client.test.ts5 pass;draft-files.test.ts;composer-status.test.tsx3 pass.With the other draft suites, 87 pass and the kit composer tests 7 pass.
Real browser (pinned Chromium 1243, keyless and offline):
draft-indicator.offline.tsxpasses 8 of 8.Updated existing suites now assert the same facts through
data-draft-saveanddata-draft-summary:session-drafts.pointer(fine and coarse),draft-branches.offline,review-dialogs.layout,composer-files.offlineandoutgoing-snapshots.offline.Failing first. Against the base
src, all 8 new browser cases fail for want of an indicator (Cannot read properties of null,expected null to be 'success').Mutations. Each was applied, shown failing, then restored:
d.host.edit !== d.editcheck)expected 'success' to be 'active'api.savebefore the GET)no PUT: expected 1 to be +0expected 'harbor-permit-2026.pdf was stored bef…' to be 'harbor-permit-2026.pdf was still uplo…'On this branch, rebased onto main
a12515e35(which includes #3758 and #3742):composer-view.tsxkeeps CONTRACT: feat(ui-kit): let the composer host the hold-to-talk MicButton #3742'smicTip/micUnavailablebesidestatus, and one citation was re-anchored.draft-files.test.tsontovi.useFakeTimers(), so the reload-names case'sBun.sleep(10)never resolved. It now uses the file'sturn(). I bisected it: it passes with every source file from the rebased head and fails only with that test file.tscand lint pass, and the API report is unchanged after the rebase.draft-indicator,outgoing-snapshots,composer-files,draft-branches,review-dialogsandcomposer-attachments, 178 of 178.connection-continuity15 of 15,draft-runtime3 of 3 andlocal-work-runtime10 of 10. The latter two need a prebuilt tree on this host: their setup hook's stale-package rebuild took longer than 180 s otherwise.Hosted candidate proof 1 (run 42616704987, head
cf2ae0f): failed, diagnosed, fixedlayout (1), a test regression from this PR. 21 cases failed in three files that ran later in the same shard:handoff-sheet(the dialog measured 476.38 px, not 480),agent-orbit, andturn-time(no time stamp or speaker found to measure).draft-indicator.offline.tsxreset the page toprefers-reduced-motion: no-preferenceafter each case. The pinned runner starts withreduce, so the later files measured mid-animation layouts.draft-indicator.offline.tsxin one process, they fail exactly as hosted.no-preferenceitself before checking that active work animates. The same four files in shard order now pass 45 of 45.no-preferencebelong to other features.Collisions
At head
d586c1566,bun scripts/collisions.ts --json --pr 3776found 5 textual overlaps, all with draft PRs:api-report/ui-react.txtdocs/integration-contract.mdandpackage-api.mdcomposer-view.tsxcomposer-view.tsxandcomposer.tsxThe rest are closure-only.
Merge-only refresh: main (
81f1240dd) is merged into this branch. The merged commits touch none of this PR's files, so thecheck:prreceipt below is from the last real change and was not rerun.{"version":1,"kind":"brain-check-pr-receipt","head":"ac4e664e25db9c750d6c01e7c483decaec035fb5","base":"origin/main","mode":"focused","startedAt":"2026-11-09T12:56:08.803Z","finishedAt":"2026-11-09T12:58:00.190Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":19251.933677999998},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":517.5382279999976},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":1016.1940309999991},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":32.16358500000206},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":90541.232323}]}Checklist
integrate.ts confirm.Refsslice; see below.package-api.mdand theintegration-contract.mdindex are updated in theCONTRACT:commit. The additions areComposer.statusandBrainUiConnection.drafts.checkSave. The API reports are updated.Anything left open
read_attachment;🤖 Generated with Claude Code