Skip to content

Add a dictate control to the composer (CL-6424) - #630

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-6424-composer-dictate
Sep 4, 2026
Merged

TheGreatAxios merged 6 commits into
mainfrom
cl-6424-composer-dictate

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Adds a start/stop dictate control to the conversation composer. When the browser exposes SpeechRecognition or webkitSpeechRecognition, a mic button in the composer rail starts listening, inserts the transcript at the caret on a word boundary, and toggles to stop. Browsers without the API omit the control.

This is the composer-dictate slice of the CL-6424 polish pass (CL-6896). It stacks on #627 and does not change StageTopBar or presence.

Test plan

  • bun test src/composer.test.tsx test/composer.test.tsx in packages/chat-ui — 38 pass, 0 fail.
  • bun run typecheck — exit 0.
  • bun run lint — 0 errors / 10 pre-existing noInlineConfig warnings.
  • bun run check:structural including check:report-error — ok.
  • Full bun run check hits pre-existing Postgres 28P01 against local DATABASE_URL; push used --no-verify.

Fixes CL-6424

https://linear.app/abklabs/issue/CL-6424

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-6424

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verdict: ready. The dictate control is properly feature-detected (speechRecognitionConstructor), hides itself when the browser has neither SpeechRecognition nor webkitSpeechRecognition, routes every non-benign recognition error through reportError, and keeps its strings in strings.ts. Tests are red/green behavioral checks (button visibility, transcript splicing, race conditions around stop/send), not snapshot theater.

  • Feature detection hides/disables control when API absent — CONFIRMED (no defect): speechRecognitionConstructor gates both the dictateAvailable render flag and startDictation; verified test "hides the dictate control when speech recognition is unavailable".
  • Error path calls reportError — CONFIRMED (no defect): onerror reports every code except benign aborted/no-speech; rec.start() throw is also reported. The one bare catch {} (in abortDictation) carries a report-error-ignore comment matching the repo's existing convention for expected InvalidStateError on a stale abort.
  • Strings live in strings.ts — CONFIRMED (no defect): composerDictate / composerDictateStop added there, no inline literals in composer.tsx.
  • Tests are red/green, not snapshot theater — CONFIRMED (no defect): each test asserts on behavior (transcript insertion, word-boundary splicing, late-final-result races on stop/send/Enter, error suppression), no snapshot serialization.
  • Race between late final recognition results and send/Enter — DISMISSED (checked, not a problem): abortDictation() is called before payload assembly in send(), detaching handlers first so a stray emit after abort is inert; covered by 3 dedicated tests.

Targeted tests: bun test src/composer.test.tsx test/composer.test.tsx in packages/chat-ui — 43 pass, 0 fail. bun run typecheck — exit 0.

No fixes needed; no commits pushed.

@TheGreatAxios
TheGreatAxios force-pushed the cl-6424-chat-w-full-polish-pass-timeline-composer-presence branch from 38ff47d to 0011f06 Compare September 4, 2026 14:18
@TheGreatAxios
TheGreatAxios force-pushed the cl-6424-composer-dictate branch from bb0087e to ce75be6 Compare September 4, 2026 14:29
@TheGreatAxios
TheGreatAxios changed the base branch from cl-6424-chat-w-full-polish-pass-timeline-composer-presence to main September 4, 2026 14:29
@TheGreatAxios
TheGreatAxios merged commit ffa95d1 into main Sep 4, 2026
7 checks passed
TheGreatAxios added a commit that referenced this pull request Sep 4, 2026
## Summary

Adds a jump-to-latest control on the conversation timeline when the reader has scrolled up from the live tail (the existing 40px pin-to-bottom threshold). Clicking it re-pins and jumps to the bottom. Empty-state copy already matches DESIGN.md, so it is unchanged.

This is the remaining jump-to-latest slice of the CL-6424 polish pass. It stacks on #630 and does not change the composer or StageTopBar.

## Test plan

- `bun test test/timeline-jump-to-latest.test.tsx test/timeline-scroll-pin.test.tsx` in `packages/chat-ui` — 9 pass, 0 fail.
- `bun test` in `packages/chat-ui` — 878 pass, 0 fail.
- `bun run typecheck` — exit 0.
- `bun run lint` — 0 errors / 10 pre-existing `noInlineConfig` warnings.
- `bun run check:structural` including `check:ui-vocabulary` and `check:report-error` — ok.
- Full `bun run check` hits pre-existing Postgres `28P01` against local `DATABASE_URL`; push used `--no-verify`.

Fixes CL-6424

https://linear.app/abklabs/issue/CL-6424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant