Fix five issues found testing with a real paper menu - #45
Open
AnirudhG15 wants to merge 1 commit into
Open
Conversation
All five come from one real session with a printed menu. Two of them turned out to be the same root cause. 1. Read menu was buried, and the camera started too wide -------------------------------------------------------- Read menu is the step that actually starts the reading, and it sat at the bottom of a long control stack: a VoiceOver user had to swipe past the preview, both zoom buttons, the shutter, the retake button and the upload button to reach it. It now sits directly under the heading, and its label carries the photo count, so it doubles as the running progress report. The camera also opened at 0.5x. That was chosen to fit more of a page in frame, but people hold the phone well above the menu, and at 0.5x the text lands too small to read. Now 0.8x, named as DEFAULT_ZOOM with the reasoning next to it. 2 + 3. Messages cut each other off, so "turn the page" was never heard ---------------------------------------------------------------------- "It'll start reading it, and then a new message will pop up so quickly it just interrupts it." And: "It doesn't tell the person to switch the page." Those are the same bug. A screen reader restarts the moment a live region's text changes, and the capture screen had TWO live regions updating independently — coaching every ~170ms, plus photo confirmations on top. "Photo taken, turn to the next page" lands exactly when coaching resumes, so it was the message most reliably destroyed. Now one region, fed by lib/announcer.ts: a paced queue that gives each message time to be heard before it can be replaced (estimated from word count, 1.3s to 4.5s). Coaching is superseded freely — only the newest is worth hearing, since advice for a position the phone has already left is worse than silence. A photo confirmation is urgent: it preempts coaching immediately, because by the time the shutter has fired the framing advice is already history, but it is never cut off by anything else. The confirmation itself now says plainly "Photo 2 taken. Turn to the next page, or tap Read menu." 4. "Retake the picture" never said how ---------------------------------------- Three separate messages suggested retaking without naming any control, which is not an instruction if you cannot see the button. All of them now name it: "Tap Retake last photo". The button already existed. Writing a test that checked ONE phrase let the upload path's own "Consider retaking it" through — which was the exact message on screen. The test now checks every string in the file that mentions retaking, which immediately found a third one on the analysis-failure path. 5. Auto zoom, and a beat to flip the page ------------------------------------------- Auto zoom was working, but its "Adjusting zoom in/out" announcements were being stomped like everything else, so it read as doing nothing. Fixed by the pacing. The chance to flip the page is the confirmation message above, which now holds the region for its full reading time before coaching resumes. Tests: 15 new. The pacing is clock-injected, so the timing is checked without a browser; the reported case is asserted directly (a confirmation must hold the region for its full reading time while coaching floods in at the real frame rate). Removing the pacing fails 4 of them. The rest are source-level guards on the screen: one live region, the turn-the-page wording, every retake message naming its button, Read menu rendered above the preview, and a floor on the starting zoom. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
All five come from one session with a printed menu. Two of them turned out to be the same root cause.
1. Read menu was buried, and the camera started too wide
Read menu is the step that actually starts the reading, and it sat at the bottom of a long control stack. A VoiceOver user had to swipe past the preview, both zoom buttons, the shutter, the retake button and the upload button to reach it. It now sits directly under the heading. Its label carries the photo count, so it doubles as the running progress report.
Confirmed in the browser — reading order is now:
The camera also opened at 0.5x. That was chosen to fit more of a page in frame, but people hold the phone well above the menu and at 0.5x the text lands too small to read. Now 0.8x, as a named
DEFAULT_ZOOMwith the reasoning beside it.2 + 3. Messages cut each other off — which is why "turn the page" was never heard
These are one bug. A screen reader restarts the moment a live region's text changes, and the capture screen had two live regions updating independently — coaching every ~170ms, plus photo confirmations on top. "Photo taken, turn to the next page" lands exactly when coaching resumes, so it was the message most reliably destroyed.
Now one region, fed by
lib/announcer.ts— a paced queue that gives each message time to be heard (estimated from word count, 1.3s–4.5s) before it can be replaced:The confirmation now says plainly: "Photo 2 taken. Turn to the next page, or tap Read menu."
4. "Retake the picture" never said how
Three separate messages suggested retaking without naming any control, which isn't an instruction if you can't see the button. All now name it: "Tap Retake last photo". The button already existed — nothing pointed at it.
Worth noting: my first test checked one phrase, and let the upload path's own "Consider retaking it" straight through — which was the exact message on screen when I inspected the running app. The test now checks every string in the file that mentions retaking, which immediately turned up a third one on the analysis-failure path.
5. Auto zoom, and a beat to flip the page
Auto zoom was in fact working — but its "Adjusting zoom in/out" announcements were being stomped like everything else, so it read as doing nothing. Fixed by the pacing. The chance to flip the page is the confirmation above, which now holds the region for its full reading time before coaching resumes.
Tests
15 new. The pacing is clock-injected, so timing is verified without a browser or a screen reader. The reported case is asserted directly: a confirmation must hold the region for its full reading time while coaching floods in at the real frame rate.
Mutation-checked — removing the pacing fails 4 of them.
The rest are source-level guards on the screen: one live region, the turn-the-page wording, every retake message naming its button, Read menu rendered above the preview, and a floor on the starting zoom.
Full suite 204/205,
tsc -bclean,vite buildclean. The one failure (auth.test.ts) fails identically onmain—joseis declared but not installed.getUserMediais blocked in the sandbox. The layout, the single live region, the new wording and the pacing are all confirmed on the running app — but the auto-capture path itself still needs a real phone, and so does whether 0.8x is the right starting zoom. That one is worth trying on the actual menu; it's a one-line change if it wants to be 0.7 or 0.9.🤖 Generated with Claude Code