Skip to content

[CTX-0715] feat(config): Leader key binding contract (OQ-088) - #1307

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-0715/leader
Sep 23, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-0715/leader

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: area:config | Labels: feat,P1,area:config | Milestone: v0.1.0 | RFC: OQ-088 | Task: CTX-0715

Implements the OQ-088 Leader key binding contract (adopted 2026-09-23), leader half of #981 (hint/leader overlay) and #1045 (UX-38 Mod - Leader part only; Mod unification stays OQ-052 deferred and is untouched).

Relates #981 #1045 (NOT Closes - needs review + OQ-089 engine sequencing before the overlay/dispatch half can land).

What changed

  • Default Leader chord Alt+Space (LEADER_DEFAULT_CHORD_RAW) + Windows fallback set (Ctrl+Space, Alt+Space is OS-reserved on Windows) in `bitty-config/src/keymap.rs"; reuses the shared chord grammar, no duplication.
  • Fail-open timeout (LEADER_TIMEOUT_MS_DEFAULT = 1000ms, override range 100..=60000) + Esc cancel via headless LeaderState machine (caller clock, saturating deadline, expiry returns to Idle so keys route back to the shell).
  • Config override surface: top-level leader_key (chord string) + leader_timeout_ms (integer) through lua extraction -> plan -> scalar-replace merge with attribution -> Live reload diff -> project-trust rejection (keymap-adjacent).
  • Leader stays independent of ModKey: overrides keep exact spelling under any mod; platform defaults never rewrite (pinned by test).

Verified

  • cargo check --workspace, RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets, cargo fmt --check, full cargo test --workspace (zero failures), cargo +1.85 check (MSRV, no let-chains).
  • 11 new tests: default resolution, Windows fallback, override precedence (both platforms + independent chord/timeout), timeout fail-open + Esc cancel, bad-timeout fail-closed, mod-flip independence, lua parse/merge/trust/reload pipeline.

Left for follow-up (OQ-089)

  • App input-path wiring: arm on Leader press, route follow-ups to HintSession, paint overlay (CW-02: Wire hint overlay + dispatch #981 engine half).
  • config check/inspect display rows for the resolved Leader.

Alt+Space default, Ctrl+Space Windows fallback set, fail-open
timeout with Esc cancel, and leader_key/leader_timeout_ms config
overrides through the lua/plan/merge pipeline. Leader stays
independent of ModKey (OQ-052 deferred); app input-path wiring
rides OQ-089 (#981).
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 23, 2026
@Xuepoo Xuepoo added feat Feature P1 Priority: high area:config Area: configuration labels Sep 23, 2026
@Xuepoo
Xuepoo merged commit 733da17 into main Sep 23, 2026
15 checks passed
@Xuepoo
Xuepoo deleted the ctx-0715/leader branch September 23, 2026 05:22
Xuepoo added a commit that referenced this pull request Sep 23, 2026
#1312)

* [CTX-0723] feat(present): wire fold/hint/composer into live input path

Leader chord (OQ-088, via #1307) arms a live hint session from the
single cross-panel engine: operator+label keystrokes dispatch with
prefix completion behind the operator-conflict gate, with fail-open
timeout expiry and Esc cancel. Fold verbs (fold_toggle/expand/collapse)
resolve the focused view's latest OSC 133 command block. Composer opens
for real with modal input routing and single-frame PTY submit; the
$EDITOR request stays a loud routing flag (no terminal fd in the GUI
root). Fold persistence replays anchor ordinals; provider unregister
completes the P6 dispose symmetry. Engine now includes command targets
by default (headless-neutral).

Tests: 14 runtime integration (cw_uipresent.rs), 5 app intercept, 1
config. fmt/clippy/test green (workspace).

Closes #980, Closes #983, Closes #984.
Relates #981, #982, #985, #990, #1088 (HOLD, see per-issue comments).

Task: CTX-0723

* [CTX-0723] fix(app): hint tests use platform leader mods (Ctrl+Space on Windows)

* [CTX-0723] fix(app): fail-closed leader fallback in ChromeState::new (review PX-3309)

---------

Co-authored-by: reviewer <[email protected]>
Co-authored-by: hermes-planner <hermes-planner@local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Area: configuration feat Feature P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant