Skip to content

feat(core,daemon,app): dialpad bindings and the dialpad panel (#188) - #206

Merged
q-horde merged 6 commits into
epic/180-betafrom
feature/188-dialpad-bindings-panel
Oct 30, 2026
Merged

q-horde merged 6 commits into
epic/180-betafrom
feature/188-dialpad-bindings-panel

Conversation

@q-horde

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

Copy link
Copy Markdown

Summary

Slice 8 of the beta epic #180 (plan QUB-633, revision 2). The Dialpad now does something: a profile's [dialpad] table binds the dial, the roller and the four buttons, the daemon drives the Dialpad on its own actor next to the Keypad, the socket reports it, and the Pad screen gets the Dialpad panel.

Closes #188

Changes

  • Core (profile.rs, new dialpad.rs, edit.rs, socket.rs, trace.rs, config.rs, schemas/): [dialpad] with dial and roller (cw, ccw as a full action or a chord string, step default 1, label) and buttons.1 to buttons.4 (label, action, on_fail); unknown fields rejected with position. Per-control fallback to the global table (Bindings), the step and carry arithmetic (Turns), [dialpad].max_per_event in config.toml (default 8). Trace records carry control and an optional key. The editor writes controls (set_rotary, set_button), keeps a short-form chord short, drops step = 1 and removes a control left empty.
  • Daemon (new dialpad.rs actor, daemon.rs, engine.rs, linux.rs, main.rs, exec.rs, socket.rs): a second actor on its own thread and connector (the Bolt receiver under sysfs or --dialpad-device), so either device may be absent; status.dialpad and the dialpad event; the dial event class; buttons as key events with control; press with control (+ delta) and dry_run; KEYVO_CONTROL for an exec; a turn under the lock is traced blocked; a turn is no pad activity for the page return, a button press is.
  • Client and Tauri: Editor::control / set_control, the mirror keeps the Dialpad block and held buttons; control and edit_control commands (build.rs and the capability list).
  • App: Dialpad.svelte (panel under the mirror, collapsible, No Dialpad connected, the pulse), ControlEditor.svelte in the Inspector, ActionFields.svelte shared with the key editor, the catalogue assigning to a control, protocol.ts, editor.ts, pad.ts, the mock (a connected Dialpad reading contrib's bindings, a dial event every 3 s).
  • Example profiles: global dial = volume (step 6), roller = tabs (step 4), button 1 = mute; VS Code dial = indent (step 15).
  • Docs: spec §4.1, §5.8, §6.3 page return, §7.2, §8, §10, changelog; docs/socket-api.md; CONTEXT.md (Control, Detent); docs/design/gui-ux.md §3.3 as built; docs/beta-test.md block feat(core,daemon,app): dialpad bindings and the dialpad panel (#188) #206; roadmap status; README device row; CLAUDE.md layout and test doubles; the socket fixtures README.

Automated checks

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

User test

Owner, host, both devices, the daemon under the unit, the example profiles (docs/beta-test.md, section 5, block #206).

  • bin/keyvo ctl status carries the dialpad block with "connected":true, the slot and both rollers.
  • Global profile: the dial changes the volume about every 12 degrees both ways; the roller switches tabs in Brave; button 1 mutes. The app's panel pulses the control that moved.
  • VS Code focused: the dial indents and outdents; the roller still switches tabs (global fallback); bin/keyvo ctl subscribe shows dial events with actions and trace entries with "control":"dial".
  • With step = 1 on the dial, a flick gives dial events with actions at most 8; with [dialpad] max_per_event = 2 in config.toml, at most 2.
  • Unplug the receiver: the pad keeps working, the panel says No Dialpad connected; plug it back and touch the Dialpad: works again within about two seconds.
  • Lock, turn the dial, unlock: nothing changed, the trace shows blocked.
  • On the global general page keep turning the dial: the page returns after 10 s anyway; button presses keep it.
  • In the app select the dial, assign Brightness up to cw: the file carries it and the dial raises the brightness; undo in the file: back on the volume.
  • bin/keyvo ctl press '{"control":"dial","delta":6,"dry_run":true}' answers "runs":1 with a dry_run entry; nothing changes.

Notes for reviewer

  • Defaults from test(hardware): verify the dialpad over bolt and bluetooth #187's numbers: a slow dial turn reports 1 to 6 detents, a fast one up to 18, the roller 1 to 2. step stays default 1 as the issue says (one action per reported increment); the example profiles set 6 (volume), 4 (tabs), 15 (indent) so a turn feels like a ratchet. max_per_event default 8 caps a flick at step = 1.
  • Press detection of the buttons lives with the keys' in the controller (one PressDetector over keys and buttons) rather than in state.rs; the page-return rule is tested end to end (a_turn_does_not_hold_the_page_return_and_a_button_does). The turn arithmetic and fallback are core tests in crates/keyvo-core/tests/dialpad.rs instead of state.rs.
  • Wire compatibility: key is now optional in trace records and key events, and a status carries dialpad; an older client would fail on a Dialpad record. All in-repo clients are updated.
  • Tracing rate: a turn traces one record per run; a turn below one step or without a binding traces nothing (the turn reports come at about 45 Hz); under the lock one blocked record per report.
  • Not in this slice: no dry-run turn from the app (the Tauri press command takes a key); the panel's "no profile has a table" check looks at the shown and the global profile only (the profile list carries no Dialpad flag).
  • Commit 4a6a308 holds core, daemon, client and the Tauri commands together: the trace and press changes do not compile in smaller steps.

A profile's [dialpad] table binds the dial, the roller (cw, ccw, step,
label; a chord string is the short form) and buttons 1 to 4 (label,
action, on_fail); an app profile falls back to the global table per
control. A turn runs its action once per step detents, the rest carried,
at most [dialpad].max_per_event (config.toml, default 8) per report.

The daemon drives the Dialpad on its own actor next to the Keypad's
(the Bolt receiver found under sysfs or --dialpad-device), reports it in
status and as the dialpad event, turns as the new dial event class and
buttons as key events with a control. Trace records and press requests
name a control (dial, roller, button:N) instead of a key. A turn under
the session lock is traced blocked and runs nothing; a turn is no pad
activity for the page return, a button press is.

The profile editor reads and writes the controls (keyvo-client
Editor::control and set_control, the app's control and edit_control
commands), keeping a short-form chord short.

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>
…t link

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

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

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 15:50
@q-horde
q-horde requested a review from q-soriarty as a code owner October 30, 2026 15:50
@q-horde
q-horde merged commit 2c23933 into epic/180-beta Oct 30, 2026
6 checks passed
@q-horde
q-horde deleted the feature/188-dialpad-bindings-panel branch October 30, 2026 15:55
@q-horde

q-horde commented Oct 30, 2026

Copy link
Copy Markdown
Author

Merge summary: PR #206 feat(core,daemon,app): dialpad bindings and the dialpad panel (#188)

What changes and why: The Dialpad now does something. A profile's [dialpad] table binds the dial, the roller and four buttons, with a per-control fallback to the global profile. step and the carry decide how many times a turn runs its action, and [dialpad].max_per_event (default 8) caps the runs per report. The daemon drives the Dialpad on its own actor and connector next to the Keypad, so either device may be absent. The socket reports the dialpad block, the dial event class, and buttons as key events with control. press accepts control/delta with dry_run. The Pad screen gets the collapsible Dialpad panel and a control editor in the Inspector.
Risk: medium. This is a wide slice (85 files) and changes the wire format: key is optional in trace records and key events. Every in-repo client is updated and the fixtures move with it. The Keypad path is refactored only through the shared run/Pressable, and its existing tests stay green.
Test evidence: Run locally in the review worktree in native mode (AGENT_HORDE=1), at head ccb6c12: just fmt-check ok, just lint ok, just test 792 passed / 1 skipped, just deny advisories, bans, licenses, sources ok, just app-test svelte-check 0 errors 0 warnings, vitest 2627 passed, the two low npm audit findings predate this PR (no lockfile change). CI on the PR: ci, app, flatpak, codecov all pass.
Files touched: 85 (+6715/-421). The main ones are crates/keyvo-core/src/dialpad.rs, crates/keyvo-daemon/src/dialpad.rs with daemon.rs, and app/src/Dialpad.svelte with ControlEditor.svelte.
Checklist: Automated checks are all ticked. The User test is the owner's, on the hardware (docs/beta-test.md block #206), and is left unticked.
Coverage: codecov/patch and codecov/project are green on the slice. The gate is measured again on the epic PR.
Specialist review: Heinrich: not requested (no trigger: no new dependency, listener, secret or workflow change). Kat: not requested.
Notes (non-blocking):

  1. Turns is cleared only on reload (engine.rs reload). A focus switch keeps the carry of up to step - 1 detents from the old binding. For example, 14 detents left from VS Code's indent (step 15) count toward the global volume (step 6) after the switch, so the first turn can run one step early. Clearing on a profile change would match Turns::clear's doc ("as when another binding takes over"). This is worth a small follow-up if the owner notices it on the hardware.
  2. While the receiver stays but the Dialpad sleeps (LinkLost), status.dialpad.connected stays true. The panel only says No Dialpad connected when the receiver is gone. This matches the User test as written.
  3. The deviations named in the PR notes are accepted. Button press detection lives in the controller instead of state.rs, and the turn arithmetic tests live in crates/keyvo-core/tests/dialpad.rs. Both are tested through public interfaces, including the page-return rule end to end.
    Link: feat(core,daemon,app): dialpad bindings and the dialpad panel (#188) #206

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