Repository navigation
feat(native): haptics that components own - #488
Conversation
A press on a Switch, Checkbox, Radio, ChoiceBox or unselected tab plays the selection haptic on iOS, marked `data-native-feedback` and played by the host as the finger lifts, before the runtime hears the press. Success, warning and error toasts play their outcome. Features never ask for one; the vocabulary and the rule for when each plays live in `platform/feedback.ts`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st its own ids Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o plays them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Maple's F1 note is addressed in df4ede8: scene tests now pin the haptic mark on an unselected tab (and its absence on the selected and the disabled tab), on a Checkbox (none when disabled), and on a ChoiceBox row (none on a disabled or read-only row). |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
… svg and paint without empty spreads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
…ress # Conflicts: # apps/web-foldkit/src/app/shell.scene.test.ts # packages/foldkit-rune/src/target.ts
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maple's F2 note: the toaster test now asserts the replaced toast runs exactly one |
Maple review🟢 Confidence 10/10 · safe to merge. Only the toaster test changed since the last pass and it now catches the defect F2 described; native haptic feel is still unverified on a device. Component-owned iOS haptics: presses are marked with Fixed since the last review
|
iOS haptics, owned by components rather than features.
The rule (
apps/web-foldkit/src/platform/feedback.ts): feature code never asks for a haptic. Each component plays the one its kind of interaction means:selectionimpactsuccess/warning/errorPlain buttons, links, navigation and typing play nothing. The browser and the desktop shells play nothing either.
How it works
data-native-feedback. The Rune host plays the haptic insideon_press, as the finger lifts and before the event reaches the runtime, so there's no round trip (host/src/feedback.rs,render/handlers.rs).Toaster.pushreturns aPlayToastFeedbackcommand for success, warning and error toasts. It goes over the bridge as{ feedback }.UISelectionFeedbackGenerator,UIImpactFeedbackGenerator(medium) andUINotificationFeedbackGenerator(host/ios/src/system.rs).SystemUi.haptic()is replaced byfeedback(kind).Verification
bun run typecheckpasses, and the full web-foldkit vitest suite passes: 2644 tests, including new scene tests (the switch is marked and a disabled one isn't, only an unselected radio is marked) and a toaster test (only outcome toasts play).cargo test --lib(162) pass. The new host test checks that only a marked press plays, exactly once, and that the click still goes through.NATIVE_DEBUG=1: the simulator can't play haptics, so the host logs each one.Next in the stack: #489 (long-press menus).
🤖 Generated with Claude Code
Summary by CodeRabbit