Skip to content

Add opt-out for unassigned-gesture toasts - #64

Open
NicolasBonduel wants to merge 2 commits into
Trooped:mainfrom
NicolasBonduel:fix/quiet-unassigned-gesture-toasts
Open

Add opt-out for unassigned-gesture toasts#64
NicolasBonduel wants to merge 2 commits into
Trooped:mainfrom
NicolasBonduel:fix/quiet-unassigned-gesture-toasts

Conversation

@NicolasBonduel

@NicolasBonduel NicolasBonduel commented Sep 4, 2026

Copy link
Copy Markdown

📝 Description

Adds a new Settings toggle, "Show Toast for Unassigned Gestures", placed directly below the existing "Show Toast for Entity Trigger" row in the Advanced Settings card. It is on by default, matching current behavior exactly, so no existing behavior changes unless a user explicitly opts out.

Changes:

  • AppPrefs.kt: new pref_show_toast_on_unassigned_gesture key with getter/setter, defaulting to true.
  • QuickBarService.kt: the three showToast("No … action assigned") call sites (single-press, double-press, long-press) now route through a new hintUnassigned() helper that checks the pref before toasting.
  • fragment_settings.xml / SettingsFragment.kt: new switch row wired the same way as the existing toast toggle.

🔍 Related Issue

Fixes #63

💡 Motivation and Context

Reported in #63: mapping a key (e.g. Home) with Single Press Action = None and a double or long-press action assigned causes "No single-press action assigned" to toast on every normal press. This happens because that toast lives inside the double-press branch of handleTriggerGestures(), which fires on every short tap regardless of whether the single-press slot was intentionally left as None. There was previously no way to suppress it. This PR adds an explicit opt-out rather than changing the default, so existing users relying on the toast for other unmapped gestures see no change unless they choose to turn it off.

📺 Screenshots / Video (if applicable)

N/A — this is a single new switch row, structurally identical to the existing "Show Toast for Entity Trigger" row directly above it.

🧪 How Has This Been Tested?

  • ./gradlew assembleDebug builds cleanly with no new warnings.
  • Installed on a physical Google TV Streamer, Android 14 (the device from the original report), via adb.
  • Verified: mapping Home with single = None / double = <QuickBar>, toggling the new setting off silences the toast on a normal Home press while the double-press action still fires; toggling it back on restores the toast.

📚 Documentation Updates

  • No documentation changes required.

✅ Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings or build errors.

Mapping a key with e.g. single-press = None and a double-press action
set causes "No single-press action assigned" to toast on every normal
press, since that toast lives inside the double-press branch of
handleTriggerGestures() with no way to suppress it. Adds a Settings
toggle (default on, matching current behavior) so it can be turned off.
Rationale for defaulting to true belongs in the PR discussion, not as
an inline comment.
@NicolasBonduel

NicolasBonduel commented Sep 4, 2026

Copy link
Copy Markdown
Author

Note on the default: isShowToastOnUnassignedGestureEnabled defaults to true when the pref hasn't been written yet. That's intentional: it preserves current behavior for existing users exactly as-is.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] "No single press action assigned" on every home press key

1 participant