Files
Lumotia/docs/issues/hotkey-linux-device-filter.md
Jake 26c7307607
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
agent: lumotia-rebrand — docs, scripts, root config, residuals
Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.

transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
  -> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
  as immutable audit trail). Includes architecture-map references
  to magnotia_core::*, magnotia_storage::*, etc. now pointing at
  lumotia_*; dev-setup.md tracing output examples (lumotia_startup
  target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
  audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
  hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
  crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
  crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
  doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
  ("lumotia_task_sync"); magnotia_locale i18n localStorage key
  renamed + migration shim added; CSS keyframe names
  magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
  system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
  keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
  wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
  to "lumotia era" earlier — restored).

Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
  legacy detection strings in legacy_and_target_paths() so the
  migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
  — migration call sites reference the legacy magnotia keys
  deliberately.
- docs/handovers/ — historical audit trail.

cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:38:03 +01:00

2.0 KiB

RB-12 MAJOR: hotkey device filtering hard-codes KEY_A / KEY_R

Severity: MAJOR Path: crates/hotkey/src/linux.rs:236-241 Source: 2026-04-22 code review Labels: release-blocker, major, hotkey, correctness Status: RESOLVED (2026-04-22)

Resolution

Extracted device_supports_combo(supported, combo) -> bool as a pure helper. try_attach_device now snapshots the current HotkeyCombo from hotkey_rx (returning early with false if the listener is unconfigured) and uses the helper to filter devices by the configured trigger key.

Tests in crates/hotkey/src/linux.rs (linux::tests):

  • attaches_when_device_supports_configured_trigger
  • rejects_when_device_lacks_configured_trigger
  • rejects_when_device_reports_no_keys
  • attaches_for_non_a_non_r_trigger (direct regression)

Manual verification of the Ctrl+Shift+D binding in Settings remains on the ship-gate checklist — code path is correct; runtime GUI check is deferred.

Problem

try_attach_device claims to check whether an input device supports the configured hotkey's key, but the implementation tests for hard-coded KEY_A or KEY_R instead of consulting the actual HotkeyCombo that was configured. Hotkeys bound to any other key (which is most of them) can be silently skipped even when the device supports them.

This is a correctness bug in a user-facing feature. A user who binds Lumotia to Ctrl+Shift+D and sees "no hotkey fires" has no obvious path to diagnose it.

Acceptance

  • Device attachment consults the actual configured HotkeyCombo.trigger key code.
  • Regression test: try_attach_device called with a mock device that supports KEY_D attaches when the configured hotkey's trigger is D, does not attach when the trigger is a key the device doesn't support.
  • Manual verification: bind Ctrl+Shift+D in Settings, confirm it fires in a running Lumotia.

Fix scope

Small. Replace the hard-coded constants with a lookup from the passed-in HotkeyCombo.

Dependencies

  • None — standalone fix.