Repository navigation
feat(app,firmware): configurable single, double and triple tap - #13185
singhharsh1708 wants to merge 22 commits into
Conversation
Single and double tap now resolve through a shared ButtonAction instead of the double tap branch owning its own effect handling. Single tap defaults to asking a question, which is the existing behaviour, and the stored double tap encoding is unchanged.
There was a problem hiding this comment.
All reported issues were addressed across 104 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…p maps to Interactive onboarding step one lets a single tap through to record the ask a question demo. Resolving the stored mapping there hijacked that tap, so the step could not be completed with a non default mapping.
|
Fixed in 125ac99. Onboarding step one now forces the question action whatever single tap maps to, with two tests covering it. Hebrew singleTap is now לחץ בודד to match the לחץ כפול next to it. |
|
I don't have an Omi here, so the one thing I couldn't exercise is a remapped single tap on the actual button. You mentioned on #2825 you'd help test with a device. Still up for that? |
|
Solid, well-scoped contribution - the consolidation direction is right and the description is refreshingly explicit about what was and wasn't verified. What I checked against the head:
The firmware claim checks out: omi/firmware/omi/src/lib/core/button.c notifies SINGLE_TAP 1 / DOUBLE_TAP 2 / LONG_TAP 3 with no triple-tap state, so deferring triple press until the firmware can emit it was the right call. Two things to settle before merge:
Leaving merge sign-off to maintainers for those two items. Thanks for the clean work and the honest testing notes. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile feature (configurable single-tap action), defaults preserve existing behavior, large diff mostly l10n .arb files. Feature -> approve only per policy.
|
Verified on head 125ac99 — thank you for the careful write-up and the follow-up commits; the earlier review notes are addressed on this head. What I checked:
Two things a maintainer may still want to rule on before merge, both already surfaced in the discussion: real-device verification of a remapped single tap, and whether single tap should get its own analytics event name — sending nothing rather than polluting the @kodjima33 has approved this head, so I'm dropping the needs-maintainer-review label; positive-signal and flutter stay. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
The legacy button characteristic is left exactly as it is. A second notify characteristic on the button service sends [1, n] when tap n is released and [2, n] once 350 ms pass without another press (or a press turns into a hold), and feature bit 9 advertises it. The recogniser is a Zephyr-free header on k_uptime_get_32, so the legacy FSM's tick resets cannot skew it, and a host test covers single, double, triple, a hold after a tap, a lone hold and uptime wraparound.
…is mapped When the firmware advertises the tap sequence characteristic, the app reads tap counts from it and ButtonTapDispatcher runs tap n straight away if nothing is mapped to a higher count, otherwise it waits for the sequence end. Double and triple tap can now be turned off, triple tap defaults to ending the conversation, and Device Settings shows the triple tap row and the fixed hold-to-power-off row only on firmware that supports it. Older firmware keeps the legacy single and double tap path, and onboarding still reads the legacy stream.
Whitespace-only move so the handler can be driven from a test; git diff -w shows just the new method signature and the call.
…the button On CV1 firmware a single tap arrives as 1 followed by a trailing 5, so the legacy handler started the question on 1 and ended it straight away on the 5 meant for hold-to-talk. The release now only ends a session that a long press (3) started.
|
Updated this to cover the whole #2825 checklist, triple tap included, firmware and app. It only waits out the triple tap window when a longer tap is actually mapped, so double tap stays instant for anyone who turns triple tap off, and the existing button characteristic is unchanged for shipped apps. What still needs a real build and a hardware pass is at the bottom of the description. |
src/lib/core has its own features.h, and with -I glibc's stdint.h picked it up instead of the system one, so the host test failed to compile on Linux. -iquote only affects quoted includes.
|
Follow-up on the current head (2dcce3d), which adds the firmware side and triple tap to the earlier app-only change. The previous verification covered the app mapping layer on 125ac99; what is new here is a second BLE characteristic, a firmware recogniser, and the triple-tap wiring, so this pass focused on that. What I verified on this head:
Two things to confirm during the hardware pass:
Checks are green on this head, including the Dart suite and generated-files. The new GATT characteristic and feature bit are a device-protocol addition and the approval on record predates the firmware expansion, so an on-device pass (the author is ready to coordinate testing) should be the final gate before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…ction # Conflicts: # .github/checks-manifest.yaml
…ction # Conflicts: # app/lib/services/capture/capture_controller.dart
|
@kodjima33 this has moved on since your approval: it now covers the whole #2825 checklist (triple tap in firmware, remappable taps, and the trailing release fix), it is up to date with main including the CaptureLifetime changes, and the firmware builds with the release workflow's Docker build. CI is green. Would you mind taking another look? |
kodjima33
left a comment
There was a problem hiding this comment.
feat(app): configurable tap actions — reclassified to mobile/app (no firmware source files present in current diff despite label); feature, approve-only. CI green.
…ction # Conflicts: # app/lib/services/capture/capture_controller.dart
|
Merged main in. Only conflict was the button closure this PR pulls out into _onLegacyButton, and main had changed _isPaused to the isPaused getter inside it, so that carried over. Full suite, ratchet and preflight rerun on the merge, and the line count exception is updated to main's new size. |
streamButton detaches the taps listener and re-attaches it several BLE round trips later, and it runs on every connect and every unmute. In that window the legacy stream handled the gesture, then the sequence end arrived and the dispatcher, which had no idea it had missed the taps, ran the action a second time. A double tap mapped to starring ended up unstarring. Suppression now follows the device's capability rather than the listener's attachment state, and the dispatcher ignores an end it never saw taps for, which also covers the taps dropped while onboarding is active.
The Off row was rendered only when the device had reported bit 9, but the chip reads Off from the stored value regardless. A user who set Off and then opened Device Settings while disconnected saw four options with none selected and no way back to Off.
|
The dispatch path had a race that could run the opposite of the mapped action. streamButton detaches the taps listener and re-attaches it several BLE round trips later, and it runs on every connect and every unmute. _buttonTapsActive was false for that whole window, so the legacy stream handled the gesture, then the firmware's sequence end arrived and the dispatcher, with no way to know it had missed the taps, ran the action again. With double tap mapped to starring the second run took the toggle's other branch and left the conversation unstarred, and an Omi Double Tap unstar event went with it. Suppression now follows the device's capability rather than the listener's attachment state, and the dispatcher ignores a sequence end it never saw taps for, which also covers taps dropped while onboarding is active. Two other things worth flagging. The wraparound case in the firmware host test was not testing what it printed: hold() computed now_ms + duration_ms, so past the overflow the loop ran a single poll and the 120/160/120 ms double tap it describes was really a 40 ms press. It measures elapsed time with an unsigned difference now, and still passes, so the recogniser was right across the boundary. And the description said two new strings when the diff adds four: singleTap, singleTapAction, tripleTap and tripleTapAction. Corrected above. Also fixed: Off stayed in the stored value but the row was only rendered on firmware that had reported bit 9, so opening Device Settings while disconnected showed four options with none selected and no way back to Off. Four tests, each checked against the previous head. Suite 2426 passed, ratchet passed, preflight 21 checks. Firmware is unchanged since the Docker build quoted above apart from the test harness. |
kodjima33
left a comment
There was a problem hiding this comment.
Configurable tap-actions feature (confirmed no firmware/ files actually touched despite title - pure app/l10n diff), feature not bug fix - approve-only.
…ction # Conflicts: # app/lib/pages/settings/device_settings.dart
kodjima33
left a comment
There was a problem hiding this comment.
Re-approving after new commits (button-actions-switch integration fix + main merge, 2026-09-22). Feature PR (app tap-config), no firmware paths despite title/label (0/100 files under omi/firmware/), predates and is unrelated to the singhharsh1708 self-bounty-issue pattern seen elsewhere in this account's queue (closes old issue #2825, not a same-day self-filed bounty proposal). Approve-only per policy (feature, not bug fix); already approved 3x by kodjima33 across iterations.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (configurable single/double/triple tap) - verified app-side only, approve only per policy; DIRTY.
|
Thanks @singhharsh1708 — this is a well-put-together feature. I reviewed the diff file by file; some observations and one small nit. Firmware
App
All checks are green, including the new firmware host test. The maintainers have already approved this head, so this is in good shape — the remaining product call (e.g. whether triple tap's default should end the conversation, per #2825) stays with them before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…-action Main rebuilt the device page on the lib/ui primitives and pulled the button handler out of its closure, so both halves are ported: - The tap rows are OmiSettingsRows in _customizationGroup and the three pickers share one sheet in device_control_sheets.dart. - _handleButtonEvent routes single and double tap through _runButtonAction and steps aside for a device that reports tap counts. The ask-a-question toggle is main's code moved into _toggleVoiceQuestion, so the tap path shares the auto-submit grace and the drop telemetry. - Main fixed the trailing release on its own, so that fix and its tests are dropped here. - ScriptedDeviceConnection answers the feature query and can emit tap counts, since the tap path asks every connection for its features. - The two new preferences live in button_action.dart, because main keeps preferences.dart at 1500 lines.
|
Merged main and ported both halves onto it: the rows onto the new device page, and the tap dispatch onto the extracted Renders through the visual audit harness (the production widgets in flutter-tester, no device behind them). The page has no paired device in this render, so it shows the single and double tap rows; the triple tap and Turn Off rows need firmware with bit 9. Double tap with Off, and triple tap: Fork CI skips the Dart jobs without |
…-action Only app_en.arb conflicted: main appended new strings where the triple tap descriptions sat, so the descriptions are re-added after them.
|
The implementation is in good shape and the backward-compatibility story is careful — one robustness gap in the tap-stream setup below, plus a hardware-verification ask. No blocking correctness issue found in review. What I verified:
UX: with the defaults on bit-9 firmware, a single tap now waits out the ~350 ms sequence window before starting a question (so double/triple can still fire); turning the higher taps off makes it instant. Blast radius: new behaviour is gated on feature bit 9 — older firmware keeps today's behaviour exactly. USER IMPACT: on updated firmware, users can remap single, double and triple tap in Settings -> Device; defaults stay as today (a single tap's question start gains up to ~350 ms of latency), and older firmware is unchanged. Still wanted before merge:
Leaving for human maintainer review: this adds a new BLE characteristic and feature-bit protocol across firmware and app, and the existing maintainer approvals predate the current head. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Verdict: solid, well-scoped implementation — a clean extension of the existing double-tap configuration to single and triple taps with a firmware-side tap recogniser, careful legacy back-compat, and unusually good test coverage. No blocking issues found; a few follow-ups below. What I verified:
Notes (non-blocking):
Still wanted before merge:
USER IMPACT: On firmware with tap counting, users can now choose what single, double and triple taps do (Settings → Device Settings); the highest mapped tap responds immediately, lower ones respond after a short (~0.35s) wait. Leaving for human maintainer re-approval: the last maintainer approval predates the current head, and the dispatcher's wait-vs-fire tradeoff is a product-visible latency decision worth a maintainer's sign-off. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |






Closes #2825
Single, double and triple tap are configurable on the device page. Long press stays the fixed 3 second power off.
Firmware (CV1,
omi/firmware/omi). The existing button characteristic (23ba7925) is untouched, so shipped apps and onboarding see what they see today. A second notify characteristic on the button service (23ba7926) sends[1, n]when tap n is released and[2, n]once 350 ms pass without another press, or as soon as a press turns into a hold. Feature bit 9 advertises it. The recogniser istap_sequence.h, a Zephyr-free header with a host test registered in the checks manifest.App. With bit 9 the app reads tap counts from the new characteristic and
ButtonTapDispatcherdecides when to act: tap n's action runs on the tap itself when no higher count is mapped, otherwise at the end of the sequence. With the defaults a double tap waits for the window; setting triple tap to Off makes it instant, and turning both off makes single tap instant. Older firmware keeps the legacy stream, where single and double tap can be remapped too. Triple tap has an Off option, and double tap gets one on firmware with bit 9. The triple tap row and the fixed Turn Off row only show on firmware with bit 9. The rows sit inside the Omi button actions switch and the tap path honours it.Ported to current main. Main rebuilt the device page and pulled the button handler out of its closure, so both halves moved:
OmiSettingsRows in_customizationGroup, and the three pickers share one sheet indevice_control_sheets.dart._handleButtonEventroutes single and double tap through_runButtonActionand steps aside for a device that reports tap counts. The ask-a-question toggle is main's code moved into_toggleVoiceQuestion, so the tap path shares the auto-submit grace and the drop telemetry.ScriptedDeviceConnectionanswers the feature query and can emit tap counts, since the tap path asks every connection for its features.button_action.dart, because main keepspreferences.dartat 1500 lines.tripleTapandtripleTapActionhave descriptions inapp_en.arb(the nit from the last review).New tests on the legacy stream: a remapped single tap runs its action instead of starting a question, a double tap set to Off does nothing, a device that reports tap counts is handled once by the tap stream, and firmware without tap counts keeps the legacy stream. The first and third fail with the remap or the hand-off removed.
Verified from
app/:What I could not check: I don't have an Omi, so the button behaviour needs a hardware pass with Thinh before this merges. The firmware files are the ones built earlier with the release workflow's Docker image; I have not rebuilt them on this merge, and this machine has no C compiler for the host test, which CI runs.
Product invariants affected
The tap listener is a second notify on the button service, subscribed next to the existing button listener. The audio subscription, the uplink policy and the sync fence are not changed, and the two guard tests (
tiered_capture_test.dart,resume_sync_fence_test.dart) pass.Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4230 -> 4323 | the tap dispatch sits next to the button handling this file already owns
UI-Evidence: none -- renders of the rows and the sheets are in a comment below, there is no device here to capture on
Failure-Class: none