Persist recorded keybinds (#925); settings tab "Desktop app" everywhere #952

Closed
charles wants to merge 0 commits from fix-925-keybinds-persist into textchat
Owner

Closes #925

Two commits.

1. Recorded keybinds persist across restarts (#925)

Cause. Nothing joined LocalSettings::keybinds (the [keybinds] table that fluxer-platform reads and writes) to app.shell.keybinds. Persisted(Loaded) never applied the table, and the Settings → Shortcuts edits were never written back. Every binding except the push-to-talk key (which goes through [voice.settings].ptt_key) was lost at restart.

Fix.

  • On Persisted(Loaded), shell::keybinds::reduce applies the table to the bindings, then reconciles ptt_key as before. Unknown ids and combos without a trigger are skipped. This runs on the same event, before the matcher and system_shortcuts (the system-wide back end) take the bindings, so a loaded binding is registered exactly like one recorded in the session.
  • persist::reduce writes the bindings back with keybinds::store on every ShellAction::Keybind edit (record, clear, global switch, reset to default) and on a PttKey change. Each changed action gets its entry, an action back at its defaults loses its entry, and ids this version does not know are left untouched. Unparsable combos are still dropped by fluxer-platform's codec, as before; preserving unknown fields is #882.

Tests.

  • fluxer-core/tests/shell_keybinds.rs: keybinds_load_from_and_save_to_the_settings_table and ptt_key_change_writes_the_keybinds_table. Both failed before the fix and pass after it.
  • fluxer-platform/tests/settings_keybinds_join.rs: a round trip through the real settings.toml in a temp dir. It records, restarts, and checks that the binding is back, the hook back end is started, and the matcher fires on the loaded chord but not on the replaced default. It also covers reset, clear (unbound, and with nothing global left no back end is started), and damaged entries: a bad combo next to a good one, a non-list entry, a combo with a wrong-type field, and an unknown id that survives a save.
  • apps/fluxer/tests/shell_acceptance.rs: recorded_shortcut_survives_a_restart. A whole-client run records Ctrl+Shift+J for Toggle mute and shuts down cleanly. After the restart the FakeBackend runs, Ctrl+Shift+M does nothing, and Ctrl+Shift+J mutes.

2. The settings tab is "Desktop app" on every platform

This is the owner's decision (2026-11-19). The original names the tab after the platform (getDesktopSettingsTabLabel: "Windows app", "Linux app") to tell the desktop app's settings apart from the web app's. This client has no web version, so it uses the original's fallback label, "Desktop app". The change is recorded as a deliberate divergence in docs/parity/shell.md.

Goldens: the settings-rows text golden and the four PNG goldens whose page title shows the tab (settings_desktop, settings_desktop_no_tray, settings_companion_control, settings_companion_port_in_use) were redrawn on lavapipe in fluxer-native-shots:u2204. A pixel diff of a full lavapipe redraw against HEAD found no other golden with a change beyond sub-threshold noise.

Verification

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: ==> xtask ci: all steps passed.

🤖 Generated with Claude Code

Closes #925 Two commits. ### 1. Recorded keybinds persist across restarts (#925) **Cause.** Nothing joined `LocalSettings::keybinds` (the `[keybinds]` table that fluxer-platform reads and writes) to `app.shell.keybinds`. `Persisted(Loaded)` never applied the table, and the Settings → Shortcuts edits were never written back. Every binding except the push-to-talk key (which goes through `[voice.settings].ptt_key`) was lost at restart. **Fix.** - On `Persisted(Loaded)`, `shell::keybinds::reduce` applies the table to the bindings, then reconciles `ptt_key` as before. Unknown ids and combos without a trigger are skipped. This runs on the same event, before the matcher and `system_shortcuts` (the system-wide back end) take the bindings, so a loaded binding is registered exactly like one recorded in the session. - `persist::reduce` writes the bindings back with `keybinds::store` on every `ShellAction::Keybind` edit (record, clear, global switch, reset to default) and on a `PttKey` change. Each changed action gets its entry, an action back at its defaults loses its entry, and ids this version does not know are left untouched. Unparsable combos are still dropped by fluxer-platform's codec, as before; preserving unknown fields is #882. **Tests.** - `fluxer-core/tests/shell_keybinds.rs`: `keybinds_load_from_and_save_to_the_settings_table` and `ptt_key_change_writes_the_keybinds_table`. Both failed before the fix and pass after it. - `fluxer-platform/tests/settings_keybinds_join.rs`: a round trip through the real `settings.toml` in a temp dir. It records, restarts, and checks that the binding is back, the hook back end is started, and the matcher fires on the loaded chord but not on the replaced default. It also covers reset, clear (unbound, and with nothing global left no back end is started), and damaged entries: a bad combo next to a good one, a non-list entry, a combo with a wrong-type field, and an unknown id that survives a save. - `apps/fluxer/tests/shell_acceptance.rs`: `recorded_shortcut_survives_a_restart`. A whole-client run records Ctrl+Shift+J for Toggle mute and shuts down cleanly. After the restart the `FakeBackend` runs, Ctrl+Shift+M does nothing, and Ctrl+Shift+J mutes. ### 2. The settings tab is "Desktop app" on every platform This is the owner's decision (2026-11-19). The original names the tab after the platform (`getDesktopSettingsTabLabel`: "Windows app", "Linux app") to tell the desktop app's settings apart from the web app's. This client has no web version, so it uses the original's fallback label, "Desktop app". The change is recorded as a deliberate divergence in `docs/parity/shell.md`. Goldens: the settings-rows text golden and the four PNG goldens whose page title shows the tab (`settings_desktop`, `settings_desktop_no_tray`, `settings_companion_control`, `settings_companion_port_in_use`) were redrawn on lavapipe in `fluxer-native-shots:u2204`. A pixel diff of a full lavapipe redraw against HEAD found no other golden with a change beyond sub-threshold noise. ### Verification `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: `==> xtask ci: all steps passed`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Nothing joined `LocalSettings::keybinds` (the `[keybinds]` table that
fluxer-platform reads and writes) to `app.shell.keybinds`: the startup
load never applied the table and the Settings -> Keybinds edits were never
written back, so every binding but the push-to-talk key was lost at
restart.

- `Persisted(Loaded)`: `shell::keybinds::reduce` applies the table to the
  bindings (unknown ids and combos without a trigger skipped) before the
  matcher and the system-wide back end take them on the same event, then
  reconciles `ptt_key` as before.
- `persist::reduce` writes the bindings back on every `ShellAction::Keybind`
  edit (record, clear, global switch, reset) and on a `PttKey` change, with
  `keybinds::store`: one entry per changed action, removed when back at the
  defaults, ids this version does not know left as they are.

Tests: the store's load and save (shell_keybinds), a round trip through
the real settings file with restart, reset, clear and damaged entries
(fluxer-platform settings_keybinds_join), and a restart in the shell
acceptance run whose fake back end matches the loaded chord.

Closes #925

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Charles's decision (2026-11-19): the original names the tab after the
platform ("Windows app", "Linux app"; getDesktopSettingsTabLabel) to tell
the desktop app's settings from the web app's. This client has no web
version, so the tab keeps the original's fallback label, "Desktop app",
everywhere.

Recorded as a deliberate divergence in docs/parity/shell.md. The settings
rows text golden and the four goldens whose page title shows the tab
(settings_desktop, settings_desktop_no_tray, settings_companion_control,
settings_companion_port_in_use) are redrawn on lavapipe; no other golden
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Merged by hand into textchat; the merge has the same tree as the branch, which passed the full gate.

Merged by hand into textchat; the merge has the same tree as the branch, which passed the full gate.
charles closed this pull request 2026-11-19 21:02:10 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.