From fe306173029c8ec6679ae0a0f9d8ac4820d2c875 Mon Sep 17 00:00:00 2001 From: Stuart Meeks Date: Wed, 1 Jul 2026 07:42:29 +0000 Subject: [PATCH] feat: add a switch to turn the global hotkey off 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) --- CHANGELOG.md | 9 +++ Directory.Build.props | 11 +++ README.md | 2 +- src/Snipdeck.App/App.xaml.cs | 5 +- src/Snipdeck.App/Views/ShellPage.xaml | 9 ++- src/Snipdeck.Core/Models/AppConfig.cs | 8 ++ .../ViewModels/SettingsViewModel.cs | 42 ++++++++++ .../ViewModels/SettingsViewModelTests.cs | 76 +++++++++++++++++++ version.json | 2 +- 9 files changed, 159 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79ad7de..49de299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2026-07-01 + +### Added +- Settings now has an **Enabled** checkbox for the global hotkey. Clearing it + turns the hotkey off immediately and disables the shortcut-capture box; the + choice persists across restarts, and the stored chord is kept so re-enabling + restores it. The Reset button turns the hotkey back on and restores the + Ctrl+Alt+S default. + ## [1.0.4] - 2026-06-10 ### Changed diff --git a/Directory.Build.props b/Directory.Build.props index a8a6205..d422903 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,4 +22,15 @@ + + + + + diff --git a/README.md b/README.md index 4bd1c95..d7b13b3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The v1 feature set: colours, spinners, progress bars and interactive prompts all work — watch it live, and keep a clean, searchable plain-text run history you can replay. Per-CLI shell, executable path and working directory configure how runs launch. -- Global hotkey (default **Ctrl+Alt+S**, rebindable), system tray with +- Global hotkey (default **Ctrl+Alt+S**, rebindable, and switchable off), system tray with configurable close-to-tray, Light/Dark/System theme, and per-write plus pre-update store backups. - Migrate from SnipCommand with the [`snipdeck-importer`](tools/Snipdeck.Importer) diff --git a/src/Snipdeck.App/App.xaml.cs b/src/Snipdeck.App/App.xaml.cs index bdffb2e..9696c8e 100644 --- a/src/Snipdeck.App/App.xaml.cs +++ b/src/Snipdeck.App/App.xaml.cs @@ -94,7 +94,10 @@ private void InitialiseHotkey(AppConfig config) { _hotkey = Services.GetRequiredService(); _hotkey.Pressed += OnHotkeyPressed; - _ = _hotkey.TryRegister(config.Hotkey); + if (config.HotkeyEnabled) + { + _ = _hotkey.TryRegister(config.Hotkey); + } } private void OnTrayShowRequested(object? sender, EventArgs e) => BringToFront(); diff --git a/src/Snipdeck.App/Views/ShellPage.xaml b/src/Snipdeck.App/Views/ShellPage.xaml index 32b4544..15ed934 100644 --- a/src/Snipdeck.App/Views/ShellPage.xaml +++ b/src/Snipdeck.App/Views/ShellPage.xaml @@ -310,12 +310,17 @@ TextWrapping="Wrap" MaxWidth="200" Visibility="{x:Bind HotkeyError, Mode=OneWay, Converter={StaticResource EmptyStringToVisibility}}" /> + + Command="{x:Bind RebindHotkeyCommand}" + IsEnabled="{x:Bind HotkeyEnabled, Mode=OneWay}" />