Skip to content

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

Merged
Xuepoo merged 3 commits into
mainfrom
ctx-0723/uipresent
Sep 23, 2026
Merged

Xuepoo merged 3 commits into
mainfrom
ctx-0723/uipresent

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: area:ui | Labels: feat,P1,area:ui | Milestone: v0.1.0 | RFC: ui-compositor-gap-analysis.md gap 1; semantic-terminal-rfc.md P1/P2/P3/P4/P5/P6 | Task: CTX-0723

Wires the CW present candidates into the live app input path (present-path state, keymap dispatch, modal routing), on top of CTX-0700 headless ownership and the OQ-088 Leader contract (#1307).

Closes #980
Closes #983
Closes #984

Relates #981, #982, #985, #990, #1088 (HOLD — per-issue comments with precise gaps).

What lands

  • CW-01: Wire fold toggle/expand/collapse into present path #980: fold_toggle/fold_expand/fold_collapse keymap actions (parse + canonical + aliases, never in defaults) dispatch through apply_fold_verb to Runtime::cw_fold_latest, which resolves the focused view's latest OSC 133 command block fail-closed (no marks, no target). Live fold projection feeds every present derivation.
  • CW-02: Wire hint overlay + dispatch #981 (Leader half): the OQ-088 Leader binding resolves at startup (resolve_leader_for) and arms a live hint session from the single cross-panel engine in a new modal tier (below copy/search, above user keymap). Operator+label keystrokes feed cw_hint_push_key with prefix-completion dispatch behind the operator-conflict gate; expiry fail-opens to the shell, Esc cancels. No PTY byte leaks (tested).
  • CW-03: Wire composer overlay + input routing + editor #982 (overlay/routing/submit): open_composer opens the live session for real; while open the press routes to cw_composer_feed; Ctrl+Enter writes exactly one bracketed frame to the focused PTY via the single input router.
  • CW-04: Cross-panel hint API (P6) #983: CwHintEngine::unregister_provider + Runtime::cw_hint_unregister complete the P6 dispose symmetry; the live engine now includes command targets by default (headless-neutral: zero zones yield zero targets).
  • CW-05: Semantic anchor identity decision #984: fold persistence owned by the present layer as anchor ordinals (cw_fold_snapshot_ordinals / cw_fold_restore_ordinals, idempotent, fail-closed past the fold cap); ordinal anchors ride every present plan.
  • Re-exports (ComposerKey(Event), DispatchOutcome, HintScope) so bitty-app consumes the path without a direct bitty-rich dependency.

What stays HOLD (partial wiring only, gaps named in code + comments)

Follow-ups named (not silent)

  • Renderer row-hiding for folded blocks (projection exists; paint skip is render-path work).
  • Hint Jump scroll-to-target, FocusPanel host view-map, CopyRequested target-byte extraction seam.
  • PanelRuntime mount/dispose auto-registration policy for hint providers.

Evidence

  • New crates/bitty-runtime/tests/cw_uipresent.rs: 14 tests (fold-latest verbs, arm/feed/disarm/conflict-gate/prefix-completion, submit-to-PTY frame bytes, unregister lifecycle, snapshot/restore incl. cap saturation).
  • chrome_keys.rs headless intercept tests: 5 (fold verbs, Leader arm + dispatch with zero PTY bytes, Esc/expiry, composer typing + submit frame bytes).
  • keymap.rs: fold-verb parse/canonical/never-default test.
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo test --workspace --all-targets --locked: green.

Task: CTX-0723

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
@Xuepoo
Xuepoo merged commit b9ff521 into main Sep 23, 2026
15 checks passed
@Xuepoo
Xuepoo deleted the ctx-0723/uipresent branch September 23, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Area: UI / layout feat Feature P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CW-05: Semantic anchor identity decision CW-04: Cross-panel hint API (P6) CW-01: Wire fold toggle/expand/collapse into present path

1 participant