Repository navigation
feat(scanning): add row scanning, gentler scrolling and switch repeat stop - #199
Conversation
… stop - Add a Rows option: in grouped scanning each grid row of several controls becomes its own group inside its section, ending with a "Leave row" stop - Only scroll when the highlighted control is not fully visible in its scroll area, then centre it smoothly (instantly with reduced motion) instead of nudging each step - While pointer movement or a key repeats, the next switch press stops the repeat and is consumed, using @switchify/scanning v0.4.0's interceptPress - Cover row preferences, the scroll decision and scan interrupts with tests, and document the behaviour Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Hold automatic scanning on the chosen control while pointer movement or a key repeats, using @switchify/scanning v0.5.0's holdMovement - Choosing Manual adds any missing Next or Previous switch on a free key (Enter and Backspace first), so manual scanning works with the default switches - Test the switch helper and document both Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| const block = revealPlan(element.getBoundingClientRect(), scrollArea(element)); | ||
| if (block) element.scrollIntoView({ block, inline: 'nearest', behavior: reducedMotion ? 'auto' : 'smooth' }); |
There was a problem hiding this comment.
Highlighted controls stay off-screen
reveal skips scrolling whenever a control fits vertically, even if it is off-screen horizontally. Saved layouts use a horizontal ScrollView and can overflow on narrow screens. Scanning a clipped column now leaves its highlight hidden because scrollIntoView never runs, so switch users cannot see which control they are selecting. Check horizontal visibility too, and scroll when either axis is clipped before merging.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/scanning/useScannable.ts
Line: 43-44
Comment:
**Highlighted controls stay off-screen**
`reveal` skips scrolling whenever a control fits vertically, even if it is off-screen horizontally. Saved layouts use a horizontal `ScrollView` and can overflow on narrow screens. Scanning a clipped column now leaves its highlight hidden because `scrollIntoView` never runs, so switch users cannot see which control they are selecting. Check horizontal visibility too, and scroll when either axis is clipped before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const used = new Set(bindings.map((item) => item.key)); | ||
| const key = MANUAL_KEYS[action].find((candidate) => !used.has(candidate)); | ||
| if (!key) continue; | ||
| bindings.push({ id: `switch-${action}`, name: action === 'next' ? 'Next' : 'Previous', key, pressAction: action, holdActions: [] }); |
There was a problem hiding this comment.
withManualSwitches can reuse an existing switch ID. Choose Manual once, return to Automatic, change the added Previous switch to Pause, then choose Manual again. The helper adds another switch-back on a free key, but validateSwitchSettings rejects the duplicate ID, so Manual cannot be saved. Choose an unused ID as well as an unused key before merging.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/scanning/preferences.ts
Line: 84
Comment:
**Manual mode cannot be saved**
`withManualSwitches` can reuse an existing switch ID. Choose Manual once, return to Automatic, change the added Previous switch to Pause, then choose Manual again. The helper adds another `switch-back` on a free key, but `validateSwitchSettings` rejects the duplicate ID, so Manual cannot be saved. Choose an unused ID as well as an unused key before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Closes #198
Summary
ResponsiveGridturns each row of several controls into a nested scan group (section, then row, then control), ending with a labelled "Leave row" stop. Lone controls stay direct. Stored asscanning.rows, defaulting to off.interceptPressfrom @switchify/scanning v0.4.0 (Let apps consume a switch press with interceptPress switchify-scanning#4) through auseScanInterruptregistry that the Remote screen fills.holdMovementfrom v0.5.0 (Hold automatic movement for app-defined reasons switchify-scanning#5).Validation
npm run validate: lint, typecheck, 691 Jest tests and 21/21 Expo Doctor checks pass.mouse.repeat.start, and the highlight stayed on Move up for 2.8 seconds. The next press sentmouse.repeat.stopwithout a scan action, and scanning then carried on.🤖 Generated with Claude Code