Skip to content

feat(core,daemon,app): a key as the dial modifier, held or toggled (#189) - #207

Merged
q-horde merged 14 commits into
epic/180-betafrom
feature/189-key-dial-modifier
Oct 30, 2026
Merged

q-horde merged 14 commits into
epic/180-betafrom
feature/189-key-dial-modifier

Conversation

@q-horde

@q-horde q-horde commented Oct 30, 2026 •

Copy link
Copy Markdown

Summary

Slice 9 of the beta epic #180 (plan QUB-633, revision 2). A key can take the Dialpad's dial and roller over: modifier = "held" while the key is held, or modifier = "toggle" from a short press until the next press of any key, a Dialpad button, a page or profile change, a reload that drops the key, the lock or [timing].modifier_timeout. The key shows a ring and a dial badge for the whole active time, on the pad and in the app.

Closes #189

Changes

  • Core, profile (profile.rs, schemas/profile.schema.json): a key's modifier (held default, toggle), dial and roller tables with the [dialpad] fields; modifier without a table is a load error at the key's table (fixture modifier-without-binding.toml).
  • Core, state (state.rs, config.rs, schemas/config.schema.json): the held set (last pressed wins, a used mark), the armed toggle and its end rules (same key at its press, any other key, a Dialpad button, a page change, a profile switch, a reload that drops the key, the lock, modifier_timeout, default 0), KeyDown/KeyPress decisions for the caller's press detector, modifier_turn (the active key, else the held one before it that binds the roller), the page return held while a modifier is active; the view carries modifier: { key, mode }.
  • Core, wire and trace (socket.rs, trace.rs, dialpad.rs, fixtures): the modifier event and class, the trace modifier field, the modifier result (active), press with hold or release; dialpad::modifier_turn resolves a turn on the key's binding with its step and carry.
  • Core, render (feedback.rs, render.rs): the modifier look, an accent ring and a circle-gauge badge top left (a key's own badge stays top right); snapshots render__looks__modifier*.snap.png.
  • Core, editor (edit.rs, recipe.rs): KeyFields round-trips modifier, dial, roller (inline tables, step 1 left out, an empty table kept); a recipe keeps them.
  • Daemon (engine.rs, daemon.rs, exec.rs): held keys skip the long-press detector and fire short at a release without a turn; toggle presses arm or end; turns route to the key's binding; the look on the key; the timeout wake; hold/release from the socket; KEYVO_KEY and KEYVO_CONTROL both for a modifier turn's exec.
  • Client and CLI: the mirror applies the modifier event; a ctl press test for hold and release.
  • App: protocol and editor types, the Inspector's Modifier section (new RotaryFields.svelte, shared with the control editor), the mirror's ring and badge, the Dialpad panel's (held)/(toggled) labels, the mock (reads the fields, gives the dial to key 7 then key 8 on a timer).
  • Example profiles: global key 7 Brightness (held) and key 8 Zoom (toggle); VS Code's OK, Fail, Slow moved from keys 7 to 9 to 4 to 6, so the owner's VS Code test step holds.
  • Docs: spec §6.1 (rules and the modifier_timeout row), §6.3, §7.2, §8, §9, §10, changelog; docs/socket-api.md; CONTEXT.md (Modifier key, Toggle, Trace, View); docs/design/gui-ux.md §3.1 and §3.3; docs/beta-test.md block feat(core,daemon,app): a key as the dial modifier, held or toggled (#189) #207; roadmap row 9; CLAUDE.md; docs/pre-alpha-test.md VS Code key numbers.

Automated checks

  • just fmt-check
  • just lint (clippy -D warnings)
  • just test (818 passed, 1 skipped)
  • just deny (advisories, bans, licenses, sources ok)
  • just app-test (svelte-check 0 errors, vitest 2656 passed, audit at high clean, app deny ok)
  • Documentation updated in this PR

User test

Owner, host, both devices, the example profiles with the held Brightness key 7 and the toggled Zoom key 8 (docs/beta-test.md, section 5, block #207).

  • Hold key 7 (Brightness) and turn the dial: the screen brightness follows; the key shows the ring and the badge; the panel shows Brightness (held) on the dial; release: nothing else happens, the ring goes, the dial is back on volume.
  • Tap key 7 without turning: the key's own action runs (brightness to 50 %).
  • Hold key 7 for three seconds without turning and release: no long action, the short action runs once at the release.
  • Tap key 8 (Zoom): the ring and the badge stay on; turn the dial: Brave zooms in and out; the panel shows Zoom (toggled); tap key 8 again: the ring goes, the dial is back on volume.
  • Tap key 8, then tap key 1 (Notify): the notification appears and the ring on key 8 goes; the dial is back on volume. Tap key 8, then the left page button: the page changes and the toggle is off when you come back.
  • Tap key 8, then hold key 7 and turn: brightness (held wins, the toggle ended); release: the dial is back on volume, not on zoom.
  • config.toml with [timing] modifier_timeout = 5000: tap key 8, wait six seconds: the ring goes by itself; remove the file.
  • VS Code focused (its profile has no key 7 or 8): both modifiers still work; set a key 8 in vscode.toml without a dial table: under VS Code key 8 is an ordinary key again.
  • bin/keyvo ctl press '{"key":7,"hold":true}', turn, '{"key":7,"release":true}'; then '{"key":8}', turn, '{"key":8}': the same routing, the modifier events visible in ctl subscribe.
  • In the app, open key 8 in the Inspector: the Modifier section shows Toggle and both bindings; change the mode to Held and save: key 8 now needs to be held; change step to 4: the dial zooms every fourth detent.

Notes for reviewer

  • Where the logic lives: the modifier state and every end rule are in keyvo_core::state (tests in crates/keyvo-core/tests/state.rs); the key press detector stays in the controller as in feat(core,daemon,app): dialpad bindings and the dialpad panel #188, and State::key_down/key_up/key_press tell it whether a key is held (no long press) and what a press does.
  • Choices the issue left open: a toggle ends at the down edge of the next key (so a held key pressed next takes over at once); the armed key's own press ends it at the down edge and its release does not re-arm; a turn marks every held key used; a roller the active key does not bind falls to the held key before it, else to the profile; a modifier stays with the page it was pressed on (its look shows there).
  • Dry run: a dry_run hold, release or toggle press answers with modifier set and dry_run, and changes nothing, so the app's simulator cannot arm the real pad. The app's mock therefore cycles the modifier on a timer instead of on a press.
  • Not in this slice: the app's Daemon interface has no hold/release (the Tauri press command takes a key and a kind); ctl status prints the view's modifier as part of the raw JSON, no extra formatting.
  • Example profile change: VS Code's demo keys moved from 7 to 9 to 4 to 6, so keys 7 and 8 fall through to the global modifiers as the User test expects.
  • 5d6a98d holds the socket press fields, the modifier result and the daemon together: the Command::Press fields do not compile without their controller arm. 1eb8eee was committed with one client test red (the mirror's trace capacity), fixed in 92988dd.

Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.44381% with 25 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/keyvo-core/src/edit.rs 87.34% 10 Missing ⚠️
crates/keyvo-daemon/src/engine.rs 96.51% 6 Missing ⚠️
crates/keyvo-core/src/state.rs 98.52% 3 Missing ⚠️
crates/keyvo-daemon/src/daemon.rs 94.33% 3 Missing ⚠️
crates/keyvo-core/src/profile.rs 95.00% 2 Missing ⚠️
crates/keyvo-cli/src/ctl.rs 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
@q-horde
q-horde marked this pull request as ready for review October 30, 2026 17:30
@q-horde
q-horde requested a review from q-soriarty as a code owner October 30, 2026 17:30
@q-horde
q-horde merged commit 4a26c6b into epic/180-beta Oct 30, 2026
6 checks passed
@q-horde
q-horde deleted the feature/189-key-dial-modifier branch October 30, 2026 17:34
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