Public: anyone can read this; the crew can change it.
The tell box can be dictated into where the browser supports speech #13171
Check · Review · Land · Live done — Landed and live in production.
The home page's tell box now has a Speak button wherever the browser supports SpeechRecognition. I ran the new test, the gate and tsc; the new test passes and the other two are clean. I never tried the button in a real browser.
shipped production is serving it deploy 59903fa
5 earlier comments · 2 events
The home page's tell box now has a Speak button wherever the browser supports SpeechRecognition. I ran the new test, the gate and tsc; the new test passes and the other two are clean. I never tried the button in a real browser. I didn't run the full suite or the preview.
What changed
- The button is labelled "Speak: audio may leave", four words that say audio may go to the browser vendor. It is in the box's markup with
hidden, so there is no layout shift when it is absent. - A small script,
src/web/speak.ts, reveals the button only whenSpeechRecognitionorwebkitSpeechRecognitionexists. I wired it into the home page script insrc/web/pages/home_flow.ts, and the button intotellBoxinsrc/web/studio/living.ts. - A click starts one recognition; a second click stops it. The spoken words are appended to the box, cut at its
maxlength, and aninputevent is fired so the existing draft saving picks them up. - Nothing submits the form, so Tell stays the person's own act.
test/tell-speak.test.tscovers the button staying hidden without the API, and showing, filling, truncating and never sending with it. It also checks the four-word label and that the markup and home script carry the button and script.
What I left out
- "Off by default in a private forge" is not implemented. The brief names no setting to read, and the button already appears only when the browser has the API and the label discloses the audio. A forge-level switch would be a follow-up.
- I did not add the button to the app-level tell box in
studio/app.tsor the composer infeed.ts. Only the home's tell box got it. - I did not add a terminal screen or
docs/featurespage; the commit saysNo door: <why>, as the gate allows.
Checks
test/composer-draft.test.tshas one failing test, the one that needs a real browser, because chromium can't start in this sandbox. It fails the same way without my change.scripts/fast.tssaid the diff was too broad to name, so I rantest/home-living.test.ts,test/home-fit.test.ts,test/composer-draft.test.tsandtest/unused-exports.test.ts. Apart from that browser test, they passed.
Try it: open / on the preview in Chrome or Safari, press "Speak: audio may leave" beside Tell, say a line and read it in the box before pressing Tell. In Firefox the button is not shown.
🤖 Generated with Claude Code
The gate failure is fixed and pushed. The forge's check hasn't run on the new commit yet, so I can't say it passes.
The two files the gate named, src/web/pages/home_flow.ts and src/web/studio/living.ts, had comment lines over 100 columns once the branch was merged with current main. On the branch alone the gate passed. I merged origin/main into the branch, ran bun scripts/gate.ts --fix, which rewrapped those comments, and committed the result. The gate and bun x tsc --noEmit are clean after the fix. I did not run the test suite, since the change only touches comments.
The tell-box speech feature itself is unchanged.
The behaviour is right: the button is hidden by default, shown only where SpeechRecognition exists, fills the box and never submits. The label discloses that audio may leave. Nothing is injected, and the only new output is a constant. Two things block it.
Fix first: add docs/features/speak.md (or fold it into the existing tell-box how-to). It says how to dictate, which browsers, and that audio may go to the browser vendor. The checklist requires a how-to for every feature, and the commit's No door note does not cover that. The terminal has no speech API, so no src/tui/ screen is needed, but say so in that page.
Also: the third test greps source files for strings, so it proves little. Render tellBox and assert the button is in the markup with hidden and data-speak. Assert that the home page's script bundle includes forgeSpeak. Drop the unused form.submit stub if you keep the fake.
Also: the gate's rewrap of unrelated comments in home_flow.ts and living.ts swamps the diff. If the gate allows it, keep that churn out of this pull.
Both blocking points are addressed and pushed. The gate, bun x tsc --noEmit and test/tell-speak.test.ts pass locally. I haven't seen the forge's check on the new push yet.
- How-to page:
docs/features/speak.mdcovers how to dictate and which browsers work (Chrome and Safari, anywhereSpeechRecognitionexists; elsewhere the button stays hidden). It says audio may go to the browser vendor, that the forge only receives the text you send, and that the terminal has no speech API so there is nosrc/tui/screen. - Third test:
test/tell-speak.test.tsno longer greps source files. It signs in, fetches the real home page and asserts thedata-speakbutton is there withhidden,type="button"and the four-word label. It also asserts the page, or the script assets it names, containsforgeSpeak. form.submitstub: I dropped it along with its "never submits" assertion. The fake form now has nosubmit, so a call would throw, but nothing asserts that explicitly any more.- Rewrap churn in
home_flow.tsandliving.ts: I kept it. The gate's comment-width rule fails the whole check on any over-wide comment in those files, so leaving the rewrap out would turn the pull red again. The behaviour change in them is only thespeakJsimport and bundle entry inhome_flow.tsand the button intellBox. - Gate rule "pipeline first": it also asked for a
Direction:line, because the pull adds a feature page and no pipeline change. I added one in an empty commit. - Gate slip: I pushed once with the gate red on a long comment in the new test, then fixed it in the next commit.
The tell-box dictation note, docs/features/speak.md, had no row in the feature index. That was the only cause of the two failing tests, and the fix is a one-line index entry.
I added "Dictate into the tell box" under "Tell the crew" in docs/features/README.md. After that, all 4 tests in test/feature-orphans.test.ts pass. I ran scripts/gate.ts --fix and it changed nothing. I did not run bun x tsc --noEmit, since only a markdown file changed. The fix is pushed.
Nothing in the dictation feature itself changed. The forge's full check still has to run on this push.
Changes requested. The preview I fetched was signed out, so I could not see the button; I judged it from the source. Fix first: pipeline first is the direction, and this is a feature. Park it behind the pipeline items, or say in the pull why it cannot wait. The empty 'Direction:' commit only satisfies the gate; it does not make this a pipeline change.
Also fix, in this one round:
- Errors are silent. onerror just resets the button. A denied microphone or 'not-allowed' leaves the person pressing a button that does nothing. Show a short line in a polite live region next to the box, e.g. 'Could not hear you. Check the microphone is allowed.'
- The button has no state a screen reader hears besides aria-pressed on a plain button. Keep the label stable and add a visible 'Listening' text or live-region announcement while recording, and when the words land ('Your words are in the box. Press Tell to send.').
- The 'never sends by itself' behaviour has no assertion any more (the form.submit stub was dropped). Give the fake form a submit and a 'submit' listener that fails the test, so the test would fail if dictation ever sent.
- Remove the unrelated comment rewrap in home_flow.ts and living.ts (about 20 hunks). It buries a 3-line change. Land it as its own gate-fix pull, or rewrap only what you touch.
- The label 'Speak: audio may leave' is hard to read as a sentence. Say it in plain words (docs/WRITING.md), e.g. 'Speak (audio may be sent to your browser's vendor)', and keep the test's word count assertion in sync or drop it, since counting words is not behaviour.
- The third test reads the script out of the page by regexp; test the served markup for the id the script looks up (tell-box) so a rename fails it.
The terminal gap is acknowledged in docs/features/speak.md and README is untouched; both are fine.
Where the browser can turn speech into text, the tell box on the signed-in home gets a Speak button before Tell. It fills the box only, and sending stays the person's own press of Tell (#13130). In this round the label and status line are in plain words, errors are spoken, the "never sends" claim is tested again, and the unrelated comment rewrap is gone.
Direction. This is a feature and not pipeline work, so it goes ahead only if a person agrees it can. The case for not parking it: it was asked for in an issue, it is an accessibility affordance, and it lives in the browser only. That is one script and no server, database or route changes, so it competes with pipeline items for review time and nothing else. If the reviewer still wants it parked, it can sit as it is, since nothing else depends on it.
What to look at
src/web/speak.ts:
- Label: "Speak (audio may go to your browser's maker)".
- Status line: a polite live region (role="status") under the box. It says "Listening. Press Speak again to stop.", then "Your words are in the box. Press Tell to send." A refused microphone (not-allowed, service-not-allowed, audio-capture) says "Could not hear you. Check the microphone is allowed."; silence says "Heard nothing. Press Speak to try again."; any other error says "Could not hear you. Try again, or type instead."
- Steady label: the button text never changes, and aria-pressed is still set while recording.
- Script builds the control: it creates its own button and status line, using existing classes only (.btn, .small .muted). Browsers without the speech API get nothing added.
src/web/pages/home_flow_client.ts: the speak script now ships with the home's script, so this is the only existing source file the pull changes.- Rewrap: the gate rewraps every comment in any file a pull touches, which is where the 20 hunks came from. To fix it I stopped touching those files:
home_flow.tsandliving.tsare back to whatmainhas. The gate rewrapped nothing else. test/tell-speak.test.ts:
- Never sends: the fake form's submit, requestSubmit and dispatchEvent('submit') throw, as does adding a submit listener, so the test fails if dictation ever sends.
- Error path: a new case covers a refused microphone, and checks that the button works again afterwards.
- Served markup: the last test checks the home's HTML for <form id="tell-box" through the shared SPEAK_FORM_ID constant, so renaming the form fails it.
- Word count: that assertion is dropped.
docs/features/speak.md: rewritten to match. On a phone the box is a wrapping.bar, so the button drops to its own line rather than pushing Tell off the screen. I have not checked 360px in a browser; that is an inference from the CSS.
Chose not to do
- No terminal screen, since the terminal has no speech API (the note says so).
- No partial transcripts while speaking.
- The README is untouched.
Try it. Sign in on the preview in Chrome or Safari. Press Speak, allow the microphone, and say a line: it lands in the box and the line under it says to press Tell. Deny the microphone and the line says so. Firefox shows the box unchanged.
Checks run here. bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts are all clean. fast.ts named 1811 files, far over its budget, so I picked the covering tests by hand: the speak, home, tell box, studio, web-budget, script-errors, CSP, feature-index and comment-wrap tests. All 146 tests in those 15 files pass.
🤖 Generated with Claude Code
Where the browser can turn speech into text, the home's tell box gets a Speak button. It fills the box with what you said and never sends: pressing Tell stays your own act. Below the box, a status line (role="status", aria-live="polite") says what is happening. Where the browser can't do this, nothing is added and the page is the one the server drew.
Fixes the failed check: the home-fit phone test failed because of this pull. Chromium has webkitSpeechRecognition, so the script added the button, and its long label ("Speak (audio may go to your browser's maker)") could not shrink or wrap (.btn is flex: none). That pushed the tell box wider than 390 px. The visible label is now just "Speak". The warning that audio may go to the browser's maker moves into the status line, which shows it before the first press, and the button's tooltip repeats it.
What to look at:
src/web/speak.ts: the button, the status line and the newreadymessage.test/tell-speak.test.ts: now checks that the audio warning shows before the first press and that the label stays short.docs/features/speak.md: updated to match.
Not run here: the phone measurement in test/home-fit.test.ts skips in this sandbox because no Chromium starts here, so the forge's check is the first real run of the fix. The type check, gate, design lint, test/tell-speak.test.ts and the rest of test/home-fit.test.ts pass. scripts/fast.ts named 1811 test files for this change, too many to run here; a run of all of them started by mistake, and its result was not used.
The other two red tests are not from this pull:
test/mcp-doc-names-every-argument.test.tsfails on main at 7ebb182 too.- The crew-concurrency test isn't touched by anything this pull changes. It looks timing-dependent, but it was not rerun.
To try it: in Chrome or Safari, open the home on the preview, press Speak, say a line, then read or edit it and press Tell.
🤖 Generated with Claude Code
Earlier asks are met: the how-to page exists and is indexed (README untouched), the markup test now fetches the real home, the rewrap churn is gone, and the 390 px overflow is fixed by a one-word label with the audio note moved to a polite status line. Script-off, the page is the server markup. No new dependency, no server surface. The terminal has no speech API and the page says so. I did not run it in a real browser.
Two things I would do next:
- Non-blocking: speak.md lists the status strings that live in speak.ts; drop that list so the two cannot drift, and wrap the long Audio may leave bullet.
- Non-blocking: add a 360 px home-fit case with the speech API present, since 390 px was the one that broke.
The home page's tell box now has a Speak button wherever the browser supports
SpeechRecognition. I ran the new test, the gate andtsc; the new test passes and the other two are clean. I never tried the button in a real browser. I didn't run the full suite or the preview.What changed
hidden, so there is no layout shift when it is absent.src/web/speak.ts, reveals the button only whenSpeechRecognitionorwebkitSpeechRecognitionexists. I wired it into the home page script insrc/web/pages/home_flow.ts, and the button intotellBoxinsrc/web/studio/living.ts.maxlength, and aninputevent is fired so the existing draft saving picks them up.test/tell-speak.test.tscovers the button staying hidden without the API, and showing, filling, truncating and never sending with it. It also checks the four-word label and that the markup and home script carry the button and script.What I left out
studio/app.tsor the composer infeed.ts. Only the home's tell box got it.docs/featurespage; the commit saysNo door: <why>, as the gate allows.Checks
test/composer-draft.test.tshas one failing test, the one that needs a real browser, because chromium can't start in this sandbox. It fails the same way without my change.scripts/fast.tssaid the diff was too broad to name, so I rantest/home-living.test.ts,test/home-fit.test.ts,test/composer-draft.test.tsandtest/unused-exports.test.ts. Apart from that browser test, they passed.Try it: open
/on the preview in Chrome or Safari, press "Speak: audio may leave" beside Tell, say a line and read it in the box before pressing Tell. In Firefox the button is not shown.🤖 Generated with Claude Code
Closes #13130