fix(settings): persist activation mode across restarts - #2
Merged
Conversation
karamouche
self-requested a review
August 3, 2026 16:22
karamouche
approved these changes
Aug 3, 2026
karamouche
self-requested a review
August 3, 2026 20:48
karamouche
requested changes
Aug 3, 2026
karamouche
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution, this looks good to me!
One small ask so CI can pass: the commitlint check is failing on body-max-line-length (body lines must be ≤ 100 characters). The subject is fine; it’s the body paragraph that’s too long.
Could you amend/reword the commit message body so each line stays under 100 chars? Thanks
Activation mode lived only in React state: there was no config field and no save/get command, so every launch fell back to the hardcoded push-to-talk default. Store it in config.json alongside the other settings.
hl9020
force-pushed
the
fix/persist-activation-mode
branch
from
August 3, 2026 20:53
e559137 to
7afc9f8
Compare
Contributor
Author
|
Good catch, thanks - amended and force-pushed, body lines are now well under 100 characters. |
karamouche
approved these changes
Aug 4, 2026
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.
Problem
Activation mode is the only setting on the App settings screen that does not survive a restart. Selecting "Toggle", quitting and relaunching brings the app back in "Hold" mode.
The reason is that
activationModeonly ever existed in React state. There is no field for it inConfig, and nosave_/get_command pair, unlikehotkey,languages,endpointing,copy_to_clipboardandaudio_device_selection. On every launch the value falls back to the hardcodedpush-to-talkdefault inApp.tsx.Approach
Store it the same way the neighbouring settings are stored, so nothing new is introduced:
activation_mode: Option<String>inConfig, defaulting topush-to-talk, and covered byfill_defaultsso existingconfig.jsonfiles migrate silently.save_activation_mode/get_activation_modecommands, with the setter rejecting anything other than the two valid values.loadedref exactly likecopyToClipboard.No change to hotkey handling or dictation behaviour - only where the already-existing value is read from and written to.
Testing
Windows 11, installed NSIS build. Set the mode to Toggle, quit, relaunch: the setting is retained and hold-to-talk no longer reactivates. Verified the same for switching back to Hold, and that an existing
config.jsonwithout the field starts up on the previous default instead of erroring.npm test: 119 Rust tests, 26 vitest tests, typecheck all passnpm run build: cleannpm run format: no changes to the files in this PRcargo clippy --all-targets -- -D warnings: fails identically on this branch and on unmodifiedmain(22 pre-existingnever usederrors on Windows, since much of the accessibility code is macOS-only). No new warnings introduced.Not verified on macOS - I have no Mac available. The change is platform-independent, but a second pair of eyes there would be welcome.