Skip to content

feat(app): add device button action switch - #12305

Closed
arhxam wants to merge 1 commit into
BasedHardware:mainfrom
arhxam:feat/disable-device-button-actions
Closed

arhxam wants to merge 1 commit into
BasedHardware:mainfrom
arhxam:feat/disable-device-button-actions

Conversation

@arhxam

@arhxam arhxam commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Add a default-on, persisted master switch for Omi device button actions. Interactive onboarding still receives the button event first, while normal single-, double-, and long-press actions return before side effects when the user disables the switch.

Closes #4458

Product invariants affected

none

How it was verified

  • flutter test test/unit/device_button_policy_test.dart test/widgets/device_settings_double_tap_test.dart — all 9 preference, policy, persistence, and settings-widget tests passed.
  • flutter gen-l10n — generated all 48 supported locale implementations with zero untranslated messages.
  • bash scripts/analyze_ratchet.sh — analyzer ratchet passed.
  • The physical button path was not exercised because no paired Omi device is available locally.

Tests

  • Added default-on, disabled, and persistence policy coverage.
  • Added widget coverage for toggling and reloading the setting.
  • Regenerated and validated every supported locale.
  • Physical-device button presses (hardware unavailable).

Failure-Class: none

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @arhxam - this is a clean, well-scoped implementation of #4458, and the default-on choice preserves today's behavior for existing users.

What I verified:

  • app/lib/services/capture/capture_controller.dart - the gate sits inside the single onButtonReceived handler (the only BLE button listener registration; every device connector funnels through it), after the interactive-onboarding interception and before the double-tap, single-tap, and legacy long-press branches (button states 1/2/3/5), so one check covers every user-configured action with no bypass path.
  • app/lib/backend/preferences.dart - deviceButtonEnabled defaults to true, so existing users are unaffected until they opt out.
  • app/lib/services/capture/device_button_policy.dart - small policy seam that keeps the gate unit-testable; app/test/unit/device_button_policy_test.dart covers default-on, disabled, and reload persistence, and app/test/widgets/device_settings_double_tap_test.dart exercises the actual switch widget plus persistence across a reload.
  • l10n - the two new strings carry @ descriptions in app_en.arb, all supported locales are populated, and the regenerated app_localizations*.dart files match (Generated Files check is green).
  • CI: Dart Analyze & Tests, Formatting, Android Compile Smoke, and PR Metadata Preflight all pass.

Two non-blocking notes for the maintainer:

  1. The switch is a single global preference but lives on a per-device settings page - worth deciding whether v1 should stay global (matches the issue's ask) or become per-device.
  2. During interactive onboarding step 1, the single-tap fall-through reaches the new gate, so a user who has disabled button actions will not get the voice-command demo tap during re-onboarding (the onboarding provider still receives the event first). Probably the right trade-off, just flagging the interaction.

Nice work shipping tests alongside the feature. Product direction decision on the switch scope (global vs per-device) needs maintainer sign-off before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge flutter flutter work positive-signal Automation verified a genuine fix/quality contribution labels Aug 27, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (not bug fix) in app/mobile area - approve only per policy, do not merge.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (device button action switch), not a bug fix — mobile/app area default is approve-only per confidence gate. Diff mostly auto-generated l10n; core change is small and tested. No abuse signals.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal feature (default-on button-action master switch, single gate point in capture_controller.dart, well tested). It's a feat, not a bug fix, so approve-only per policy; also the cleaner of two competing implementations of this same feature (see #11193).

@undivisible

Copy link
Copy Markdown
Collaborator

This is already on main. Main has persisted omiButtonActionsEnabled, settings toggle, tests, and capture gating.

Closing. Thanks for the contribution.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @arhxam 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work needs-maintainer-review Needs a human maintainer to sign off before merge positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow button to be completely disabled because kids exist...

4 participants