Skip to content

feat(panel): change hotkeys from the panel, and show when one is taken - #34

Merged
machado144 merged 1 commit into
release/v0.1.7from
feat/hotkey-settings
Oct 13, 2026
Merged

machado144 merged 1 commit into
release/v0.1.7from
feat/hotkey-settings

Conversation

@machado144

Copy link
Copy Markdown
Contributor

Stacked on #32 (base release/v0.1.7).

Why

A hotkey another program already owns silently did nothing. On Windows, NVIDIA's overlay holds Ctrl+Alt+M (the practice key): snowlearner logged Hotkey unavailable to a file nobody reads, and every hint on screen kept saying "press Ctrl+Alt+M". The only fix was editing config.toml by hand and restarting.

What

  • New TECLAS / KEYS tab in the panel, one row per hotkey (practice, recap, panel, magic hand, progress). ← → or Enter's list move it to any letter or digit under the modifiers it already has (Ctrl+Alt by default; modifiers written in config.toml are kept). A key another snowlearner action holds is never offered.
  • Applied at once: Hotkeys::rebind releases the old set and registers the new one, no restart. Where the desktop owns the shortcuts (GNOME on Wayland), they are reinstalled; on other Wayland desktops a toast says to run snowlearner setup.
  • A taken hotkey is visible: marked (in use) in its row and in the list, said in a toast when picked, and said at startup instead of the welcome.
  • Every hint follows the change: the warrior's tips ("Press … and say a phrase"), the lesson footers, the idle nudge and the shortcut sheet all read the new keys right away.
  • Every new string in lang/text.rs, pt-BR and English. No new dependency.

Not in this PR: capturing an arbitrary combination by pressing it. The rows pick the key; other modifiers still come from config.toml.

Tests

  • Menu: a row changes the key and keeps its modifiers; a key another action holds is skipped by the arrows and absent from the list (32 options); a taken combination is marked in the row and in the list, in both languages; the tab cycles and clicks; the new rows and the help fit the panel; all five rows open a list like every other choice row.
  • Hotkeys: the action that lost its key is named; every letter and digit parses.
  • Against the real Windows API (one-off probe, not committed): registering Ctrl+Alt+Y + Ctrl+Alt+M reported M as taken (NVIDIA's overlay has it on this machine); after rebind to U, another manager could take Y and could not take U.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings (default features and --no-default-features) clean. cargo test on Windows: 513 lib + 26 CLI pass.

Two lib tests fail on Windows only, both unrelated and failing without this PR's code paths: command_engine_passes_text_on_stdin_when_not_in_the_template (calls tee) and, intermittently, a_foreign_program_on_the_port_is_detected (its fake server closes the socket before the client reads; passes when run alone).

Not verified: clicking through the tab in the running app, the GNOME reinstall path, macOS.

Closes #31

🤖 Generated with Claude Code

* new TECLAS / KEYS tab: one row per hotkey; arrows or the list move it to
  any letter or digit under its modifiers, never one another action holds
* applied at once: Hotkeys::rebind releases the old set and registers the
  new one, no restart; on GNOME the desktop shortcuts are reinstalled
* a combination another program has is marked "(in use)" in its row and in
  the list, and said in a toast at startup and when picked
* the warrior's tips, the lesson footers and the shortcut sheet show the
  new keys right away

Refs #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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