Add opt-out for unassigned-gesture toasts - #64
Open
NicolasBonduel wants to merge 2 commits into
Open
Conversation
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.
Author
|
Note on the default: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 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: newpref_show_toast_on_unassigned_gesturekey with getter/setter, defaulting totrue.QuickBarService.kt: the threeshowToast("No … action assigned")call sites (single-press, double-press, long-press) now route through a newhintUnassigned()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 = Noneand 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 ofhandleTriggerGestures(), which fires on every short tap regardless of whether the single-press slot was intentionally left asNone. 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 assembleDebugbuilds cleanly with no new warnings.adb.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
✅ Checklist