Skip to content

[CTX-1784] refactor(runtime,config,render): retire the Core-drawn help/which-key paint (Related #2397) - #3105

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-1784/feat-retire-core-help-paint
Nov 10, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-1784/feat-retire-core-help-paint

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Retire the Core-drawn help/which-key paint (ADR-0014)

Core no longer paints a help/which-key surface. The presentation lives in the
first-party extension bitty-terminal.help (bitty-plugins/plugins/help,
bitty-plugins#122, manifest id bitty-terminal.help, grants
runtime.keymaps.read + ui.rich + ui.overlay + ui.present), which reads
the live registry through bitty.keymaps.list and presents through
bitty.ui.present.show/hide. Core keeps the mechanism only: the keymap/command
registry, overlay geometry/stacking, and routing.

Related #2397 (not Closes: the plugin side and the docs/ADR follow-ups are
tracked separately; the Core paint path named in the issue is fully removed).

Migration — configs that still name toggle_help / show_help

The Core action is gone, and so is its show_help alias. Both spellings are
kept as retired action spellings so a config written against the shipped
defaults still loads:

  • Only the retired binding is dropped. Every other keymaps entry — in the
    same table and in every other layer — stays live. The whole-table startup
    salvage path (warning: ignoring 'keymaps' ...) no longer triggers on this
    spelling, and bitty config check exits 0 instead of 2.

  • One diagnostic per dropped binding, naming the retired action and the
    replacement:

    bitty: warning: ignoring retired keymap binding: binding 'alt+`' uses retired action 'toggle_help'; the help overlay moved to the 'bitty-terminal.help' plugin (run 'bitty plugin install bitty-terminal.help', then bind 'command:bitty-terminal.help:toggle_help' to keep the chord)
    

    The same line is printed by bitty config check and at startup.

  • Nothing dispatches a retired spelling. ChromeAction::parse still
    rejects it (answering with the migration instead of the closed-catalog hint),
    and resolve_keymaps / resolve_prefix_bindings skip it, so it can neither
    dispatch nor shadow a shipped default.

  • To restore the gesture: bitty plugin install bitty-terminal.help (now
    resolvable from the embedded official catalog, regenerated from bitty-plugins
    2da1c875 with the help entry pinned at ae1d8a9a), which rebinds the four
    historical chords by suggestion; or bind
    command:bitty-terminal.help:toggle_help explicitly.

Step 1 — parity audit (Core paint row -> plugin evidence)

Audited crates/bitty-runtime/src/runtime/help.rs (pre-change) against
bitty-plugins/plugins/help/lua/help/init.lua and
bitty-plugins/plugins/help/tests/ (spec/help_spec.lua, manifest.test.ts).

Core painted element (pre-change) Plugin evidence
Title "Keyboard shortcuts" (HELP_PANEL_TITLE, help.rs:19, painted help.rs:256-262) M.PANEL_TITLE init.lua:41, painted as scene child 1 init.lua:409; asserted help_spec.lua:65
Rows = <chord> <action> per resolved binding (help_rows_from_keymaps, bitty-config/src/keymap.rs:2166), resolved-table order (sort at keymap.rs:2133) M.read_keymaps pages bitty.keymaps.list (init.lua:192-255); the page contract emits rows in resolved-table order (bitty-lua/src/keymaps.rs:19-24); M.format_binding_row renders <chord> <action> (init.lua:259-302, 294-296); asserted help_spec.lua:66-71
Ordering = live registry order, no cached copy No row cache across shows (init.lua:189-191, 450-451); test mutates the registry then re-shows, help_spec.lua:80-95
Footer "Esc closes | repeat toggle closes" (HELP_PANEL_FOOTER, help.rs:22, painted help.rs:291-297) M.PANEL_FOOTER init.lua:42, painted last init.lua:416; asserted help_spec.lua:72,124
+N more overflow tail (help.rs:281) string.format("+%d more", remaining) init.lua:399-403; asserted help_spec.lua:123
Empty registry: Core painted nothing (help.rs:192 early return) Explicit No keybindings configured / unavailable: <code>: <msg> rows init.lua:43-44, 343-367; asserted help_spec.lua:164-193
Card tokens: ChromeTokens::resolve -> surface (Raised) + border_muted ring + radius_px (help.rs:228-241); text help_panel_fg_in = palette.foreground (bitty-render/src/grid.rs:488) Scene paints through the presentation overlay, which resolves the same chrome tokens: ChromeTokens::resolve(&self.config.theme) -> surface_for(ChromeElevation::Overlay) + border_muted ring + radius_px (present.rs:6622-6630), pinned by presentation_overlay_paints_one_shared_chrome_card (present.rs:10457-10499). Deltas: (a) elevation Overlay (surface_elevated) instead of Raised (selection) — the documented "floating overlay" step; ring/radius tokens identical; (b) plugin tone hints are ignored by the v1 node reader (bitty-lua/src/ui.rs:829-848 reads fg/bg/bold), so rows paint in the overlay's default theme text colour — the same uniform-foreground result the retired paint produced
Toggle action ChromeAction::ToggleHelp + dispatch (bitty-terminal/src/chrome_keys.rs:2448-2461) Lazy command bitty-terminal.help:toggle_help init.lua:26-28, 570-585; manifest command list manifest.test.ts:76-79; behavior help_spec.lua:12-13, 59-78
Four default chords alt+\``, alt+?, alt+shift+?, alt+shift+/` with the Mod slot (keymap.rs:2021-2024) M.SUGGESTED_CHORDS init.lua:34-39 -> bitty.keymaps.suggest init.lua:587-595; exact set and order asserted help_spec.lua:14-26; README pin manifest.test.ts:96-103; the host applies the configured mod_key and yields to user bindings (SuggestedBindingDirectory, bitty-lua/src/host.rs:2555-2558; app lookup TerminalApp::match_plugin_binding, chrome_keys.rs:2561-2583)
Esc dismiss without consuming the press (selection.rs:2947-2950) overlay.dismissed subscription init.lua:597-601 + M.on_dismissed init.lua:517-531; Core queues the observation for the presentation overlay on Esc/view close (bitty-runtime/src/plugin_runtime/presentation_overlay.rs:51-58, 219); asserted help_spec.lua:128-162
Too-small view: skip the paint (HELP_MIN_INNER, help.rs:36/73) Mechanism-level: PRESENTATION_OVERLAY_MIN_COLS refuses the frame (present.rs:6509-6532)
Row bound HELP_MAX_ROWS = 256 Scene bounded to 64 rows / 16 KiB with an explicit overflow tail (init.lua:50-52, 369-404); registry read capped at 1024 addressable rows (init.lua:48-49)

Verdict: every painted element (title, row derivation, ordering, footer,
overflow tail, empty state, card tokens, toggle action, the four chords,
Esc dismissal) is reproduced by the plugin. Documented deltas are all
supersets or mechanism-owned token choices: richer row text ( (title)
suffix when a title is known), explicit empty-state row where Core painted
nothing, and the one-step-higher Overlay card elevation. No painted element
is missing, so the removal proceeded.

Step 2 — symbols removed

  • crates/bitty-runtime/src/runtime/help.rs — deleted (418 lines):
    HELP_PANEL_TITLE, HELP_PANEL_FOOTER, HELP_MAX_ROWS, HELP_MIN_INNER,
    HelpPanelLayout, help_panel_layout, Runtime::help_visible,
    Runtime::help_rows, Runtime::set_help_rows, Runtime::toggle_help,
    Runtime::dismiss_help, Runtime::paint_help_panel.
    glyph_overlaps_rect (shared with the plugin overlay card occlusion) moved
    to runtime/present.rs.
  • bitty-runtime/src/runtime.rs — mod help, help_visible / help_rows
    fields, both constructor initializers, and the two Debug fields.
  • bitty-runtime/src/lib.rs — pub use runtime::help::{HELP_MAX_ROWS, HELP_PANEL_FOOTER, HELP_PANEL_TITLE}.
  • bitty-runtime/src/runtime/present.rs — paint_help_overlay and its call in
    the overlay paint sequence.
  • bitty-runtime/src/runtime/selection.rs — the Esc help-dismiss block.
  • bitty-config/src/keymap.rs — ChromeAction::ToggleHelp (variant, parse
    arm including the show_help alias, canonical, description,
    all_chrome_actions row, KNOWN_ACTIONS_HINT entry), the four
    toggle_help default chords, and help_rows_from_keymaps.
  • bitty-render/src/grid.rs — HELP_PANEL_BG, HELP_PANEL_BORDER,
    HELP_PANEL_FG, help_panel_bg_in, help_panel_border_in,
    help_panel_fg_in, HELP_PANEL_ACCENT_ANSI_INDEX (dead constant; its only
    doc reference in scene.rs now points at
    bitty_config::theme::help_ring_source). The contrast-report accent probe
    (theme::help_ring_source, ContrastRole::HelpRing) is a theme diagnostic,
    not a paint token, and stays.
  • bitty-terminal/src/chrome_keys.rs — the A::ToggleHelp dispatch arm.

No #[allow(dead_code)] was added; orphaned code was deleted.

Tests

Removed/rewritten (they asserted the retired paint):
tests/help_popup.rs (deleted), golden_help_overlay_shown_then_hidden,
help_panel_follows_the_theme (and its now-unused Probe::color_bounds),
the help cases in tests/esc_routing.rs, help_card_uses_the_overlay_rounded_layer,
help_toggle_action_shows_live_registry_rows, help_popup_lists_added_chord_by_construction,
help_toggle_gestures_drive_intercept_and_esc_dismisses,
help_question_gesture_matches_physical_shift,
help_super_flip_spelling_toggles_and_lists,
toggle_help_action_parses_and_canonicalizes,
help_chords_resolve_to_toggle_help_both_mods,
help_rows_derive_from_live_registry.

Added (mechanism preserved, paint gone):

  • bitty-runtime plugin_runtime::services::tests::keymaps_list_serves_the_complete_default_registry_in_table_order
    — the registry read the plugin consumes still serves every shipped binding,
    in resolved-table order, with canonical chord/action spellings, and none of
    the retired help chords/actions.
  • bitty-runtime runtime::present::tests::presentation_overlay_surface_follows_the_theme
    — the surface the plugin paints through resolves theme-derived card and ring
    colours (replaces the removed help-panel recolor proof).
  • bitty-config keymap::tests::toggle_help_action_and_its_default_chords_are_retired
    — toggle_help/show_help no longer parse, the catalog/hint carry no such
    action, and the four chords are unbound under both alt and super.
  • bitty-terminal retired_help_chord_reaches_the_shell_instead_of_painting
    — through the real intercept Mod+\`` and Mod+?` are not consumed and the
    bytes reach the PTY (no Core paint path is reachable).
  • bitty-terminal retired_help_chord_is_owned_by_the_plugin_suggestion
    — with Core's default gone, the plugin suggestion dispatches the chord at
    DispatchPriority::Plugin through the host-mediated command path.
  • bitty-terminal workspace_creation_chord_stays_in_the_live_registry
    — the [P1] Mod+number workspace switching broken (stuck on workspace 1); Mod+Shift+number does not move panels #1446 discoverability rows are still in the live table.

Gates actually run (all offline, no remote CI, no act, no just ci-local)

  • cargo check -p bitty-config -p bitty-render --tests --offline — ok
  • cargo check -p bitty-runtime --tests --offline — ok
  • cargo check -p bitty-terminal --tests --offline — ok
  • cargo test -p bitty-runtime --offline — ok (227 suites, 0 failed)
  • cargo test -p bitty-config -p bitty-render --offline — ok (0 failed)
  • cargo test -p bitty-terminal --offline --bin bitty <retired_help_chord | workspace_creation_chord_stays_in_the_live_registry | mouse_action_is_captured_by_a_pending_close_confirmation | mouse_action_gate_matches_the_chord_modal_rules> — ok (the crate's unit tests live in the bitty bin target; [lib] test = false)
  • cargo fmt --check — clean

No GUI/Hyprland test was run. No Cargo.toml dependency edge changed, so
Cargo.lock is untouched.

Follow-up fix commit (review findings 1 + 2)

  • cargo test -p bitty-config --offline — ok (535 passed, 0 failed)
  • cargo test -p bitty-plugin-host --offline — ok (0 failed)
  • cargo test -p bitty-runtime --offline — ok (1552 passed, 0 failed)
  • cargo check -p bitty-terminal --tests --offline — ok
  • cargo fmt --check — clean
  • just catalog-check — ok (12 entries, source 2da1c875…)
  • cargo test -p bitty-terminal --offline retired_toggle_help_binding_keeps_the_rest_of_the_table — ok
    (runs the real bitty config check path and the startup loader: exit 0,
    retired bindings dropped, sibling bindings live, migration diagnostic
    asserted, no ignoring 'keymaps' salvage)
  • Headless CLI, pre-fix reproduction re-run on this build: a config binding
    alt+` to toggle_help, ctrl+alt+2 to show_help, plus two valid
    bindings → bitty config check --config exits 0 and prints both
    migration diagnostics on stderr, and bitty list keymaps shows the live
    siblings (focus:1, toggle_zoom) with the retired bindings absent.
  • Headless CLI install resolution: bitty plugin install bitty-terminal.help
    resolves the catalog entry and proceeds to the pinned fetch of
    https://github.com/bitty-terminal/help.git (the sandbox's dead proxy is the
    only failure), instead of failing as an unknown plugin id.

Residual follow-ups

  • Docs still describe the retired surface and are tracked separately (not in
    this PR): bitty-terminal-docs/architecture/core-boundaries.md (the
    help.rs sections), specifications/input-pointer-rfc.md, and
    configuration/lua-and-xdg.md (still lists toggle_help as a Core action).
  • ContrastRole::HelpRing / help_ring_source stay (still consumed by the
    contrast report), though the chrome.help-ring role label now names a
    surface Core no longer paints.
  • The plugin's parity suite lives in bitty-plugins; Core gates it only through
    the bitty.keymaps.list registry read.
  • The retired-spelling tolerance is deliberately narrow (exactly
    toggle_help / show_help, no argument form). Any future retired action
    needs the same treatment: a RETIRED_ACTIONS row plus a loader drop, never a
    dispatchable variant.

Summary by CodeRabbit

  • Changes
    • The informational help popup and its Escape-to-dismiss behavior are no longer available.
    • The default shortcuts previously used to open the popup have been removed. Those key combinations can now be handled by the shell or by plugin-provided key bindings.
    • Other keyboard navigation and confirmation behavior remains available.

…p/which-key paint (Related #2397)

ADR-0014 puts the help/which-key presentation in the first-party
`bitty-terminal.help` extension (bitty-plugins#122) and keeps only the
mechanism in Core. The shipped plugin reproduces every painted element —
title, registry-derived rows in resolved-table order, footer, `+N more`
tail, empty state, chrome card tokens, the toggle command, the four
historical chords (suggested, mod-aware), and `Esc` dismissal through
`overlay.dismissed` — so the Core paint path is removed:

- delete `runtime::help` (title/footer/row bounds, `HelpPanelLayout`,
  `help_panel_layout`, `help_visible`/`help_rows`/`set_help_rows`/
  `toggle_help`/`dismiss_help`, `paint_help_panel`) and move the shared
  `glyph_overlaps_rect` helper into `runtime::present`
- drop the `Runtime` help fields, the `paint_help_overlay` step, and the
  `Esc` help-dismiss branch
- remove `ChromeAction::ToggleHelp` (variant, parse alias, canonical,
  description, catalog row, hint entry), the four `toggle_help` default
  chords, and `help_rows_from_keymaps`
- remove the `help_panel_*` tokens and the dead
  `HELP_PANEL_ACCENT_ANSI_INDEX` from `bitty-render`
- remove the `A::ToggleHelp` dispatch arm

The keymap/command registry, overlay geometry/stacking, routing, and the
`bitty.keymaps.list` read the plugin consumes are untouched. Tests that
asserted the paint are deleted or rewritten; new coverage pins the
registry page completeness, the theme-derived presentation surface, the
retired action/chords, and that the plugin suggestion now owns the chord.
@Xuepoo Xuepoo added feat Feature area:ui Area: UI / layout area:config Area: configuration area:runtime Area: runtime orchestration P2 Priority: medium labels Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 295d1be9-2c13-4fa2-bbdd-9332eee845b1
Commits

Reviewing files that changed from the base of the PR and between c56fa84 and 4fc555b.

Files selected for processing: 7

  • crates/bitty-config/src/file.rs
  • crates/bitty-config/src/keymap.rs
  • crates/bitty-config/src/lib.rs
  • crates/bitty-plugin-host/src/official.rs
  • crates/bitty-plugin-host/src/official_catalog.rs
  • crates/bitty-terminal/src/config_cli.rs
  • validation-pins.env

No actionable comments were generated in the recent review.

Walkthrough

The Core help popup is removed from the keymap action catalog, runtime state, and presentation path. Its four default chords are removed. Updated tests cover keymap listings, terminal input routing, plugin suggestions, and remaining presentation behavior.

Changes: Core Help Overlay Removal

Layer / File(s) Summary
Retire the Core help keymap action
crates/bitty-config/src/keymap.rs, crates/bitty-runtime/src/plugin_runtime/services.rs
The parser, action catalog, and default keymaps no longer include the help action or its four chords. Tests verify the retired action and chords are absent, and that keymap listings contain the expected bindings.
Remove runtime help state and painting
crates/bitty-runtime/src/runtime.rs, crates/bitty-runtime/src/runtime/help.rs, crates/bitty-runtime/src/runtime/present.rs, crates/bitty-runtime/src/runtime/selection.rs, crates/bitty-runtime/src/lib.rs, crates/bitty-runtime/tests/*, crates/bitty-render/src/grid.rs, crates/bitty-render/src/grid/tests.rs, crates/bitty-render/src/scene.rs
Runtime help state and painting are removed. Glyph overlap handling remains in presentation code. Help-specific renderer helpers and related tests are removed or updated.
Update terminal action and input routing
crates/bitty-terminal/src/chrome_keys.rs, crates/bitty-terminal/src/tests.rs
The terminal no longer handles the help action. Tests cover former help chords reaching the shell or plugin suggestions, and update related modal and keymap assertions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Possibly related issues

  • bitty-terminal/bitty#2397 — The issue asks to move the Core-painted help panel into a first-party plugin; this PR removes the Core help presentation path.

Possibly related PRs

  • bitty-terminal/bitty#2584 — Adds the shared chrome tokens and rendering behavior that this PR removes from the Core help-panel path.
  • bitty-terminal/bitty#2552 — Adds plugin-suggested keybinding dispatch, which the updated tests exercise for a retired help chord.

Suggested labels: area:architecture, area:render, area:plugins

Merge Risk: Minimal · previous review c56fa

No actionable merge-blocking issue was identified in the Core help removal. The extension’s implementation was not available for verification.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the removal of Core-drawn help/which-key presentation, which is the main change in the pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 15 functions across 6 files. (3 skipped: 3 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6091f6ca-9f8e-4074-a116-481fc7850802
Commits

Reviewing files that changed from the base of the PR and between b514567 and c56fa84.

Files selected for processing: 16

  • crates/bitty-config/src/keymap.rs
  • crates/bitty-render/src/grid.rs
  • crates/bitty-render/src/grid/tests.rs
  • crates/bitty-render/src/scene.rs
  • crates/bitty-runtime/src/lib.rs
  • crates/bitty-runtime/src/plugin_runtime/services.rs
  • crates/bitty-runtime/src/runtime.rs
  • crates/bitty-runtime/src/runtime/help.rs
  • crates/bitty-runtime/src/runtime/present.rs
  • crates/bitty-runtime/src/runtime/selection.rs
  • crates/bitty-runtime/tests/esc_routing.rs
  • crates/bitty-runtime/tests/help_popup.rs
  • crates/bitty-runtime/tests/present_golden.rs
  • crates/bitty-runtime/tests/theme_recolor_2333.rs
  • crates/bitty-terminal/src/chrome_keys.rs
  • crates/bitty-terminal/src/tests.rs
Files with no reviewable changes: 7

  • crates/bitty-runtime/tests/help_popup.rs
  • crates/bitty-runtime/tests/present_golden.rs
  • crates/bitty-runtime/src/runtime.rs
  • crates/bitty-runtime/src/runtime/help.rs
  • crates/bitty-runtime/src/lib.rs
  • crates/bitty-runtime/src/runtime/selection.rs
  • crates/bitty-render/src/grid.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review — read-only; no edits, commits, or cargo runs in the lane worktree. All discrimination claims were proven on a throwaway copy under /home/fuyu/.hermes/cache/scratch/.

Checks

  1. PASS — parity is real, not asserted. Every retired painted element has reproducing code plus a passing spec in bitty-plugins/plugins/help (plugin suite run here: lua5.4 tests/run.lua → 6 specs, 61/61 assertions):

    • title: help.rs:19 (HELP_PANEL_TITLE) → init.lua:41, painted init.lua:409, asserted help_spec.lua:65.
    • rows + ordering from the live registry: help_rows_from_keymaps (keymap.rs:2166 @ base) → M.read_keymaps init.lua:192-255 + M.format_binding_row init.lua:259-302; registry order comes from the untouched bitty.keymaps.list page (bitty-lua/src/keymaps.rs:19-24); no row cache across shows (init.lua:189-191), asserted by registry mutation + re-show at help_spec.lua:80-95.
    • footer: help.rs:22 → init.lua:42, painted init.lua:416, asserted help_spec.lua:72,124.
    • +N more tail: help.rs:281 → init.lua:399-403, asserted help_spec.lua:123 ("+239 more" for 300 bindings).
    • empty state: help.rs:192 painted nothing → explicit No keybindings configured / unavailable: <code>: <msg> rows (init.lua:43-44,343-367), asserted help_spec.lua:164-193. Documented superset.
    • four chords alt+backtick, alt+?, alt+shift+?, alt+shift+/: init.lua:34-39 via bitty.keymaps.suggest (init.lua:587-595), exact set/order asserted help_spec.lua:14-26; the host applies mod_key and user bindings win (SuggestedBindingDirectory, bitty-runtime/src/plugin_runtime/keybindings.rs:123).
    • Esc dismissal: selection.rs:2941-2950 (base) → init.lua:517-531 + overlay.dismissed subscription init.lua:598-601; Core still hides and queues the observation without consuming the press (chrome_keys.rs:3038-3049, presentation_overlay.rs:219-224), pinned by presentation_overlay_esc_dismisses_and_reaches_pty (tests.rs:18716).
    • Documented deltas are supersets or mechanism-owned ((title) suffix, explicit empty row, Overlay instead of Raised elevation, tone ignored by the v1 node reader). No element is missing.
  2. PASS — removal is complete. git grep -n -E 'paint_help_panel|help_rows|help_panel_|HELP_PANEL_|ToggleHelp|toggle_help|dismiss_help|set_help_rows' at head finds zero production hits. The only survivors are the deliberate retirement fixtures — crates/bitty-config/src/keymap.rs:4882, crates/bitty-runtime/src/plugin_runtime/services.rs:13300 (assertions at :13338, :13343), crates/bitty-terminal/src/chrome_keys.rs:8401,9241 — plus the plugin command id bitty-terminal.help:toggle_help (bitty-lua/src/keymaps.rs:691,720,727 and its tests; a different symbol), and the historical CHANGELOG.md:2821.

  3. PASS — no band-aids. No #[allow(...)] line is added anywhere in the diff (grep '^+.*#\[allow(' → 0 hits). glyph_overlaps_rect is byte-identical to the deleted copy — diff of old vs new shows one doc-comment word ("shared with" → "used by") and nothing else (present.rs:8896); the caller keeps the same (glyph, rect) order (present.rs:6666). grep -n 'HELP_PANEL\|help_panel' crates/bitty-render/src → 0 hits; no dead constant left. Minor, non-blocking: ContrastRole::HelpRing / help_ring_source survive and are still consumed by the contrast report (theme.rs:747, config_cli.rs:1876), so they are not orphaned, but the role label chrome.help-ring now names a surface Core no longer paints.

  4. FAIL — config compatibility is a breaking change with no migration note. ChromeAction::parse fails closed (keymap.rs:1267-1270), so an existing keymaps = [{ chord = "alt+backtick", action = "toggle_help" }] now errors at keymaps[].action. Verified on a head build:

    • bitty config check → exit 2, unknown action 'toggle_help'; expected one of ... (hint list at keymap.rs:1574 no longer names it).
    • startup → the entire keymaps table is salvaged away, not just the one entry: bitty: warning: ignoring 'keymaps' in '<file>': ... unknown action 'toggle_help' ...; ignored; using defaults and remaining layers (file.rs:1548,1620,1673; config_cli.rs:872,878). Verified with bitty --headless. So a user who kept the previously documented default also loses every unrelated binding in that table.
      The PR body mentions the retirement but carries no migration note for toggle_help / show_help configs.
  5. PASS — new tests discriminate (3 proven by reverting production on a scratch copy). Each fails when the production change is undone and passes at head:

    • keymap::tests::toggle_help_action_and_its_default_chords_are_retired (keymap.rs:4882): re-adding the variant/parse arm/4 default chords → panicked at keymap.rs:4901: assertion failed: ChromeAction::parse("toggle_help").is_err().
    • plugin_runtime::services::history_tests::keymaps_list_serves_the_complete_default_registry_in_table_order (services.rs:13300): same revert → panicked at services.rs:13338: no Core help action survives in the live registry.
    • chrome_keys::tests::retired_help_chord_reaches_the_shell_instead_of_painting (chrome_keys.rs:8401): revert + restoring a consuming A::ToggleHelp arm → panicked at chrome_keys.rs:8414: Mod+backtick must not be a Core-bound chord.
      retired_help_chord_is_owned_by_the_plugin_suggestion (chrome_keys.rs:9241) discriminates on the same revert by inspection (match_keymap returns Some(ToggleHelp) instead of None), though I did not re-run it separately. Note (not a failure): presentation_overlay_surface_follows_the_theme (present.rs:10496) and workspace_creation_chord_stays_in_the_live_registry (chrome_keys.rs:10356) pass unchanged on base — they guard the surviving mechanism, which is how the PR body presents them, but they are not retirement proofs.
  6. FAIL — the replacement surface is not installable from this repo, so a stock user loses the feature silently. The chord correctly reaches the PTY (chrome_keys.rs:8401 proves no Core consume), which is right for an unbound key — but the only thing that re-binds it is the plugin's suggestion, and bitty-terminal.help cannot be installed from the catalog shipped at this commit: crates/bitty-plugin-host/src/official_catalog.rs:17 pins SOURCE_REVISION = dcd6777…, which predates the help onboarding in bitty-plugins (5485fe7 — git cat-file -e dcd6777:registry/official/help.toml → missing). The catalog has 11 entries (official_catalog.rs:20) and no bitty-terminal.help, so official_plugin_for("bitty-terminal.help") (official.rs:80) → None and bitty plugin install bitty-terminal.help fails as an unknown id. The plugin is also not bundled (the bundled set is shell-integration only, bitty-plugin-host/src/bundled.rs). Net effect at this revision: help is removed from Core, and there is no supported install path for its replacement — the chord just types a backtick into the shell with no diagnostic.

  7. PASS — docs are honest about being unsynced. The body says "Related #2397 (not Closes: the plugin side and the docs/ADR follow-ups are tracked separately)" and does not claim docs are updated. That is accurate: bitty-terminal-docs/architecture/core-boundaries.md:295-298,356,380,577 and specifications/input-pointer-rfc.md:339-355 still describe help.rs as the shipped surface, and configuration/lua-and-xdg.md:1382 still lists toggle_help as a Core action. No dependency edge changed: the diff touches 16 files, none of them Cargo.toml/Cargo.lock (git diff --stat origin/main...HEAD).

  8. PASS — MSRV 1.85 safe. grep -c '&& let ' over the patch → 0. No const-only dead_code read is introduced (the relocated helper is a plain fn, not a const).

Required fixes

  1. Ship the catalog entry with (or before) this retirement. Regenerate crates/bitty-plugin-host/src/official_catalog.rs from a bitty-plugins revision that contains registry/official/help.toml (pin ae1d8a9), so bitty plugin install bitty-terminal.help resolves. As it stands the PR removes the last installable path to the feature for a stock user.
  2. Add a migration note to the PR body (and the release notes). State the actual behavior for configs that still say toggle_help/show_help: bitty config check exits 2, and at startup the whole keymaps table is dropped with warning: ignoring 'keymaps' … — every other binding in it included. Point users at the replacement: drop the entry (the plugin suggestion rebinds alt+backtick, alt+?, alt+shift+?, alt+shift+/), or bind command:bitty-terminal.help:toggle_help explicitly.
  3. Optional: consider a one-time startup diagnostic when a config names the retired action, so the drop is attributed to the migration rather than looking like a config mistake.

VERDICT: CHANGES-REQUESTED

… tolerant and pin the help plugin in the official catalog

FIX 1 — retired `toggle_help` / `show_help` no longer invalidate the table.

`ChromeAction::parse` fails closed, and a parse failure invalidates the whole
`keymaps` table (startup salvage drops it with `warning: ignoring 'keymaps'`,
`bitty config check` exits 2), so a config that kept the retired default lost
every unrelated binding. Both spellings are now recorded as `RETIRED_ACTIONS`
and handled per binding:

- `validate_entry` tolerates a retired spelling (chord and context still
  validate), so plan validation, merge, `config check`, and reload pass.
- `ChromeAction::parse` still rejects the spelling — now with a migration
  answer that names the `bitty-terminal.help` plugin instead of the
  closed-catalog hint — so no dispatchable variant comes back.
- `resolve_keymaps` / `resolve_prefix_bindings` skip a retired entry, so it can
  neither dispatch nor shadow a shipped default.
- `strip_retired_bindings` (called on the one shared load path used by startup,
  `config check`, doctor, and reload) drops only that binding and reports one
  diagnostic naming the action and the plugin; `config check` prints it too.

FIX 2 — the replacement surface is installable again.

The official catalog pin predated the help-plugin onboarding, so
`bitty plugin install bitty-terminal.help` failed as an unknown id.
`BITTY_PLUGINS_REV` moves to 2da1c87 (help entry pinned ae1d8a9) and
`crates/bitty-plugin-host/src/official_catalog.rs` is regenerated with
`just catalog-generate` (12 entries); `just catalog-check` passes.

Tests: retired spellings keep every sibling binding live and never dispatch
(bitty-config keymap + Lua-layer tests, diagnostic text asserted), `bitty
config check` exits 0 on the retired spelling (bitty-terminal), and the help
plugin resolves from the official catalog (bitty-plugin-host). No Cargo
dependency edge changed.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent re-review at head 4fc555bb (fix commit [CTX-1784] fix(config,plugin-host): …). Read-only on the lane worktree; every run below executed on a throwaway git clone --shared of 4fc555bb under ~/.hermes/cache/scratch/rr3105/ with its own CARGO_TARGET_DIR. No edits, commits, pushes, or merges in the lane.

Checks

  1. PASS — FIX 1 closed: the retired binding is dropped alone, with a diagnostic that names the action and bitty-terminal.help.
    Loader path: validate_entry tolerates a retired spelling (keymap.rs:2237, chord still parsed) so the table never fails validation, and config_cli.rs:946 strips it from the merged config on the one load path shared by startup, config check, doctor, and reload (strip_retired_bindings, keymap.rs:1658; table RETIRED_ACTIONS keymap.rs:1615; message retired_binding_diagnostic, keymap.rs:1646).
    Proven on the head build, config with alt+backtick → toggle_help, ctrl+alt+2 → show_help, plus two valid siblings:

    • bitty config check --config cfg/init.lua → exit 0, stderr exactly two lines, each naming the retired action, the chord and the plugin:

      bitty: warning: ignoring retired keymap binding: binding 'alt+`' uses retired action 'toggle_help'; the help overlay moved to the 'bitty-terminal.help' plugin (run 'bitty plugin install bitty-terminal.help', then bind 'command:bitty-terminal.help:toggle_help' to keep the chord)
      bitty: warning: ignoring retired keymap binding: binding 'ctrl+alt+2' uses retired action 'show_help'; the help overlay moved to the 'bitty-terminal.help' plugin (…)
      
    • bitty list keymaps --config cfg/init.lua → ctrl+alt+1 focus:1 user and ctrl+alt+z toggle_zoom user still live; alt+backtick and ctrl+alt+2 absent; 97 rows total (defaults intact).

    • Startup path, bitty --headless --config cfg/init.lua: the same two warnings, no warning: ignoring 'keymaps', then headless smoke: ok — tick presented. The whole-table salvage is gone.

    • Unit level: cargo test -p bitty-config retired_ → 6 passed (retired_help_spellings_keep_every_other_binding_live, lua_retired_toggle_help_binding_keeps_the_rest_of_the_table, retired_prefix_binding_is_dropped_not_dispatched, retired_action_parse_error_names_the_migration, …); cargo test -p bitty-terminal --bin bitty retired_toggle_help_binding_keeps_the_rest_of_the_table → ok (asserts exit 0, 1 surviving sibling, 2 migration lines, and no ignoring 'keymaps' on the startup mode).

  2. PASS — the retired spelling is not a silent capability.
    It cannot parse: ChromeAction::parse answers with the migration and never the closed-catalog hint (keymap.rs:1271-1278). It cannot resolve: resolve_keymaps skips it before chord/action resolution (keymap.rs:2185), and resolve_prefix_bindings skips it (keymap.rs:2726); the runtime prefix paths (main.rs:1050, config_reload.rs:358) go through that function. It cannot shadow a default: binding alt+t → toggle_help leaves alt+t workspace_new global default in bitty list keymaps (the retired entry is dropped before resolution, so the shipped default wins). toggle_help:arg is not treated as retired (keymap.rs:5146), so no argument form slips through.

  3. PASS — FIX 2 closed: the catalog entry ships and installs.

    • python3 scripts/generate-official-catalog.py --check (= just catalog-check) → official catalog: OK (12 entries, source 2da1c87571b6641b5361b46fe12f60c5e052c940).
    • SOURCE_REVISION (official_catalog.rs:17) == BITTY_PLUGINS_REV (validation-pins.env:32) == 2da1c875…, which is the tip of bitty-plugins origin/main (git log -1 origin/main → 2da1c87), so generated file and pin file agree with no hand-edit drift.
    • Entry bitty-terminal.help is present with pin ae1d8a9a39862ce9a71ccd7238f5621975144a47 (== registry gitlink git ls-tree 2da1c875 plugins/help == git ls-remote bitty-terminal/help HEAD), manifest_hash sha256:8cac6d1d… (recomputed: sha256sum of bitty-plugin.toml at that pin = 8cac6d1d761547c86861e9207b3ca659d44a27a6da9c42094e8b2f09e600debc, exact match), compat_bitty >=0.0.31 (workspace is 0.0.38).
    • official_plugin_for("bitty-terminal.help") resolves: cargo test -p bitty-plugin-host help_plugin_resolves_from_the_official_catalog → ok. bitty plugin list → bitty-terminal.help registry available.
    • End-to-end, sandboxed HOME/XDG_*: bitty plugin install bitty-terminal.help --yes → exit 0, official 'bitty-terminal.help' from https://github.com/bitty-terminal/help.git at ae1d8a9a3986 (manifest sha256:8cac6d1d7615 verified) → installed 'bitty-terminal.help' (version 0.0.1, registry source, 4 capabilities granted). The previously missing install path exists.
  4. PASS — the fix commit changes nothing else. compare c56fa847...4fc555bb touches 7 files: bitty-config/{file,keymap,lib}.rs, bitty-plugin-host/{official,official_catalog}.rs, bitty-terminal/config_cli.rs, validation-pins.env. No #[allow( added, no && let let-chain added, no test deleted/renamed/#[ignore]d, no Cargo.toml/Cargo.lock, no runtime/render/terminal-behavior file. file.rs and official.rs changes are tests only; keymap.rs deletions are exactly the old parse arm (4 lines) and one ChromeAction::parse line in validate_entry.
    Scope note (non-blocking): regenerating the catalog also advances 11 unrelated plugin pins (activity, bar, composer, copy-mode, dashboard, devtools, file-manager, git-panel, history, palette, search). Each new pin equals the registry gitlink at 2da1c875 (checked against git ls-tree), and the generator renders the file as a whole, so hand-pinning only help would be drift. Correct, just wider than the finding asked for.

  5. PASS — the retirement still holds at the new head. git grep -n -E 'paint_help_panel|help_rows|help_panel_|HELP_PANEL_|ToggleHelp' over the head tree: no production reference — only the retirement fixtures/tests (keymap.rs:4998, config_cli.rs:4414, file.rs:5039, services.rs:13337) and comments. Remaining toggle_help hits are the plugin command id bitty-terminal.help:toggle_help and the new RETIRED_ACTIONS table. Mechanism intact: crates/bitty-lua/src/keymaps.rs (bitty.keymaps.list) and plugin_runtime/presentation_overlay.rs are untouched by the PR; bitty list keymaps serves 97 rows; keymaps_list_serves_the_complete_default_registry_in_table_order → ok; retired_help_chord_reaches_the_shell_instead_of_painting and retired_help_chord_is_owned_by_the_plugin_suggestion → both ok.

  6. PASS — the PR body is honest. It carries a ## Migration — configs that still name toggle_help / show_help section whose every claim I reproduced (exit 0 instead of 2, only the retired binding dropped, one diagnostic naming the action + plugin, same line at startup, nothing dispatchable). It lists the docs follow-ups under Residual follow-ups instead of claiming sync — accurate: bitty-terminal-docs/architecture/core-boundaries.md:295,298,356,380,577, specifications/input-pointer-rfc.md:321,339,348,355 and configuration/lua-and-xdg.md:1382 still describe help.rs / toggle_help. Related #2397 matches reality: the issue's acceptance criteria include "Docs no longer describe help.rs as the shipped surface" and the manual actions-catalog update, neither of which is in this PR, so Closes would be a lie and closing it now would not be defensible.

Non-blocking nits (no action required for this PR)

  • With more than 8 retired bindings, the bounded diagnostic buffer appends 2 more configuration diagnostics suppressed (run 'bitty config check' for the full list) — printed by config check (MAX_STARTUP_DIAGNOSTICS = 8, config_cli.rs:88,187-191). Verified with a 10-binding config: exit 0, 8 lines + that hint.
  • strip_retired_bindings's doc says "in config order"; the merged vector is chord-sorted, so the emitted order is f1, f10, f2, …. Cosmetic.
  • ContrastRole::HelpRing / help_ring_source survive (still consumed by the contrast report); the chrome.help-ring role label now names a surface Core no longer paints — already listed as a follow-up in the body.

Required fixes

None. Both blocking findings are closed and I found no regression in the fix commit.

VERDICT: APPROVE

@Xuepoo
Xuepoo merged commit 3101ab2 into main Nov 10, 2026
21 checks passed
@Xuepoo
Xuepoo deleted the ctx-1784/feat-retire-core-help-paint branch November 10, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Area: configuration area:runtime Area: runtime orchestration area:ui Area: UI / layout feat Feature P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant