Skip to content

Add a switch to turn the global hotkey off#66

Merged
StuartMeeks merged 1 commit into
mainfrom
feat/hotkey-enable-toggle
Jul 1, 2026
Merged

Add a switch to turn the global hotkey off#66
StuartMeeks merged 1 commit into
mainfrom
feat/hotkey-enable-toggle

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Summary

Adds a setting to turn the global hotkey on/off, per request. In Settings → Global hotkey there is now an Enabled checkbox next to the chord:

  • Clearing it turns the hotkey off immediately (unregisters it) and disables the shortcut-capture box.
  • Ticking it re-registers the stored chord immediately.
  • The choice persists across restarts — no Save button; it saves on toggle.
  • The Reset button now also switches the hotkey back on and restores the Ctrl+Alt+S default.
  • The stored chord is retained while disabled, so re-enabling brings it back.

How it works

  • New AppConfig.HotkeyEnabled (defaults to true, so existing settings files keep their hotkey — no schema bump needed since the field is purely additive and older builds simply ignore it).
  • SettingsViewModel.HotkeyEnabled observable persists and registers/unregisters on change; the change handler is inert during construction (respects _suppressPersist) so opening Settings never re-registers.
  • Startup (App.InitialiseHotkey) skips registration when disabled.

Incidental: unblock the build

Microsoft.Data.Sqlite 10.0.9 transitively pulls SQLitePCLRaw.lib.e_sqlite3 2.1.11, which a newly-published advisory (NU1903 / GHSA-2m69-gcr7-jv3q) now flags. With TreatWarningsAsErrors this fails restore on main too, unrelated to this change. The patched native lib is a SQLitePCLRaw 2.x→3.x major jump that Microsoft.Data.Sqlite 10.x doesn't yet bind (11.x is preview-only), so this adds a scoped, documented NuGetAuditSuppress for the advisory ID. The vuln concerns native SQLite parsing of untrusted DB files; Snipdeck only ever opens its own local history.db. Remove once Microsoft.Data.Sqlite ships a patched bundle.

Version

Bumps the minor version to 1.1.0 and promotes the changelog.

Testing

  • Snipdeck.Core.Tests: 245 pass, including 5 new tests covering initial enabled state, disable→unregister+persist, enable→register+persist, enable-with-registration-failure error, and Reset re-enabling when off.
  • Full solution compiles clean on the Windows head (WinUI/XAML), 0 warnings.

🤖 Generated with Claude Code

Settings gains an "Enabled" checkbox alongside the global-hotkey chord. The
choice persists in app config (AppConfig.HotkeyEnabled, default true so existing
settings files keep their hotkey) and is observed immediately: clearing the box
unregisters the hotkey and disables the capture box; ticking it re-registers the
stored chord. Reset now also switches the hotkey back on and restores Ctrl+Alt+S.
Startup skips registration when the hotkey is disabled.

Also suppress the transitive SQLitePCLRaw.lib.e_sqlite3 advisory
(GHSA-2m69-gcr7-jv3q) that TreatWarningsAsErrors turns into a hard restore
failure; the fix is a SQLitePCLRaw major bump Microsoft.Data.Sqlite 10.x doesn't
yet bind, and Snipdeck only ever opens its own local history.db.

Bumps the minor version to 1.1.0 and promotes the changelog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@StuartMeeks StuartMeeks merged commit 54f0106 into main Jul 1, 2026
6 checks passed
@StuartMeeks StuartMeeks deleted the feat/hotkey-enable-toggle branch July 1, 2026 07:47
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.

1 participant