Repository navigation
Description
Priority: P2 | Area: architecture/ui | Labels: chore,area:architecture,area:ui,P2 | Milestone: v0.1.0 | RFC: ADR-0014 | Task: CTX-1431
Why
crates/bitty-runtime/src/runtime/help.rs paints a product surface in Core: a
titled floating panel ("Keyboard shortcuts"), one row per bound action from
help_rows_from_keymaps, a footer, its own palette tokens
(help_panel_border_in / help_panel_bg_in / help_panel_fg_in), and a
toggle_help chrome action. That is presentation. Core's accepted role is the
mechanism: the keymap/command registry, overlay geometry and stacking, and
click/key routing; the decision what a help/which-key surface shows belongs to
a plugin.
This predates 0.0.25 (only re-themed there), so it is not a release
regression. It is the largest remaining Core-drawn product surface after the
workspace bar/tab/statusline retirements.
Blocker
No plugin can replace it today: there is no bounded read-only keymap/action
registry API exposed to Lua (rg -n 'keymap' crates/bitty-lua/src/lib.rs crates/bitty-runtime/src/plugin_runtime/services.rs finds none). Moving the
panel without that API would either keep a private first-party channel or ship
a help plugin with no data.
Scope
- Add a bounded, read-only keymap/action registry read API (own issue if it
needs its own contract; OQ-056-style spelling discipline). - Add a first-party help/which-key presentation plugin over that API plus the
generic overlay mechanism; keep behavior parity for:- regeneration from the live registry on every show;
Escdismissal that does not consume the press unless a real
confirmation gate (paste, workspace close, view close) also coincides;- the
toggle_helpbinding and aliases; - bounded rows and clipping.
- Remove the Core paint path (
paint_help_panel,help_rows,help_panel_*
tokens) once the plugin covers it; keep the overlay mechanism and the
keymap registry. - Update
bitty-terminal-docs/specifications/input-pointer-rfc.md
(implementation-evidence section) and the manual actions catalog.
Acceptance criteria
- Zero-plugin baseline and
bitty --safedraw no help panel;toggle_help
remains a plugin command, not a Core action. - No private API: the help plugin uses the same capability-gated surface as a
third party. - Existing help-popup and Esc-routing tests pass against the plugin path or
become plugin tests; no coverage deleted. - Docs no longer describe
help.rsas the shipped surface.
Out of scope
- The
Esc/confirmation-gate precedence (Core safety, unchanged). - The which-key Leader candidate (still unimplemented).
Activity
Xuepoo commentedon Oct 21, 2026
Design recorded (docs-only, no Core product code changed): the help/which-key panel is plugin presentation over Core mechanisms.
bitty.keymaps.list({ offset, limit })gated by the closedruntime.keymaps.readcapability (candidate spelling under OQ-056), returning canonical{ chord, action, source, context, title?, command? }rows. Caps: 256 rows/call, 1024 total, 64 KiB response, per-field bounds, deterministic tail truncation. No string input exists, so the call cannot become a path/exec/network primitive; no config path, argv, env, URL, terminal content, or diagnostics are returned. Safe mode has no caller and a VM under safe policy denies.bitty.ui.overlay.show/hidesession over the existingoverlayslot (NonModalonPopup, no capture, nomodal_active), withEscdismissal that routes the press onward and emits a queuedoverlay.dismissedobservation. Confirmation gates keep the consume.bitty-terminal.help, commandtoggle_help, grants onlyruntime.keymaps.read,ui.rich, andui.overlay; four historical chords; regeneration on every show; bounded rows/clipping; no private API.paint_help_panel,help_rows,help_panel_*,ChromeAction::ToggleHelp, the four default chords,show_help, the render/theme helpers, tests, and the docs/reference updates.match_plugin_bindingalways returnsNone;bitty.keymaps.suggestcaptures suggestions but they are never published, so the default chords need the reservedDispatchPriority::Pluginlayer.Follow-ups (all
0.0.26):runtime.keymaps.read,bitty.keymaps.list).bitty.ui.overlay.show/hide).DispatchPriority::Plugin.This issue stays open: the acceptance criteria require shipped code, zero-plugin and
bitty --safedrawing no help panel, and no coverage loss.Xuepoo commentedon Nov 1, 2026
Blocker cleared, split recorded.
The "no bounded read-only keymap/action registry API" blocker no longer holds:
bitty.keymaps.list()landed with bitty#2405 (canonical rows, 256-row pages,truncated),bitty.ui.overlay.*is available for the non-modal surface (CTX-0941,ui.rich+ui.overlay), and plugin-suggested bindings are captured with a bounded admission set (CTX-0707).The presentation half is planned as an upstream extension instead of Core work: bitty-terminal/bitty-plugins#122 (first-party
helpplugin, identitybitty-terminal.help, exactly the three grantsruntime.keymaps.read,ui.rich,ui.overlay). This issue keeps only the Core half: removepaint_help_panel/help_rows/help_panel_*and thetoggle_helpchrome action once the plugin reproduces the parity matrix, and keep the keymap registry plus the overlay mechanism.Xuepoo commentedon Nov 1, 2026
Concrete Core mechanism gap split out as bitty#2849: the only overlay a plugin can mount today (
overlayslot +bitty.ui.overlay.acquire) is exclusive, focusable and input-capturing, which a non-modal help/which-key surface must not be. bitty#2849 defines a presentation-only overlay session (draw above the focused view, no capture, no focus change, dismiss-edge observation without consumingEsc, focus-follow, unload/revoke teardown, bounded budgets, and a capability spelling separate fromui.overlay).Ordering: bitty#2849 unblocks bitty-terminal/bitty-plugins#122; the Core paint removal in this issue follows the plugin parity run.
Xuepoo commentedon Nov 5, 2026
Audit:
bittyorigin/main@1008890a786e1d6840a0118d753471a74bdbc720(2026-11-06)Headline: the blocker named in the body ("no bounded read-only keymap/action registry API") is gone, and the whole
help.rsproduct surface is now expressible over the public Plugin API v1. What is not shipped is the removal half of this issue:help.rs,ChromeAction::ToggleHelp, the four default chords,help_panel_*, and the Core tests are all still present at HEAD, andinput-pointer-rfc.mdstill callshelp.rsthe shipped surface. So this issue is no longer blocked, but it is not done.1. Blocker status — cleared
1008890actx-2405/feat-keymaps-read) —bitty.keymaps.list({offset, limit})crates/bitty-lua/src/host.rs:4853(bridge registration),:4872(state.services.keymaps_list),:4878(64 KiB refusal); implementationcrates/bitty-lua/src/keymaps.rs:1-40runtime.keymaps.read, deny-by-default, safe-mode firstcrates/bitty-runtime/src/plugin_runtime/services.rs:6213-6230(`safe_modecrates/bitty-lua/src/keymaps.rs:44,47,52,55,58,61,64,67; page assembly:303-345entries[{chord, action, source, context, title?, command?}],total,offset,truncatedcrates/bitty-lua/src/keymaps.rs:148-165(row),:282-296(page),:359-372(to_lua)overlayslot only painted under capture)ctx-1673/feat-presentation-overlay) —bitty.ui.present.show/hide(+bitty.ui.overlay.show/hidealias)crates/bitty-runtime/src/plugin_runtime/presentation_overlay.rs:1-35,42-43(NonModal/Popup),crates/bitty-lua/README.md:43-70; testscrates/bitty-runtime/tests/presentation_overlay_api.rs:173,227,292,364,430,472,519,588match_plugin_binding→None)ctx-1431/feat-plugin-keybinding-dispatch)crates/bitty-terminal/src/chrome_keys.rs:874(priority doc),:1047(DispatchPriority::Plugin),:3212(dispatch arm)2. Can a plugin reproduce
help.rs's product surface on accepted v1 only?help.rselementchrome_border_in→palette.border_idle)crates/bitty-render/src/grid.rs:459-470("One shared resolver for normal chrome surfaces (help/which-key, palette, presentation/plugin overlays)");crates/bitty-runtime/src/runtime/present.rs:5900-5913(paint_presentation_overlay→paint_overlay_surface,ChromeState::Normal)"Keyboard shortcuts", footer"Esc closes | repeat toggle closes"Textscene nodes (plugin-owned content)help.rs:19,22; accepted restriction toText|Row|Column|Listatbitty-plugins-docs/sdk/plugin-api-v1-lua-surface-rfc.md:354help_rows_from_keymaps(live registry, every show)bitty.keymaps.listper open (page whiletruncated),command:rows joined withbitty.commands.listfor titles (ungated:services.rs:5839-5857)help.rs:127;crates/bitty-lua/src/host.rs:2268; no row cache by contract (keymaps.rs:1-30)help_panel_fg_in/_bg_in/_border_inforeground/selectionscene tokens + the Core card bordergrid.rs:454-489(fg =palette.foreground, bg =palette.selection, border =border_idle); closed token tablecrates/bitty-runtime/src/runtime/band_host.rs:768-785(foreground,background,cursor,selection,accent)+N moreclipping, Esc-not-consuming, focus-follow, teardownoverlay.dismissed{owner,handle,reason}for"escape"/"view-closed"presentation_overlay.rs:1-35;present.rs:5889-5913;EventKindcrates/bitty-plugin-host/src/event.rs:237toggle_help+ four chords (alt+`,alt+?,alt+shift+?,alt+shift+/)bitty.keymaps.suggestpublished atDispatchPriority::Plugin; user binding winskeymap.rs:1786-1789(current);chrome_keys.rs:1047,3212No element is excluded by an accepted document. Two exact deltas remain, neither of which is a missing mechanism:
ui.present.bitty.ui.present.showfails closed without it (services.rs:2758; catalogcapability.rs:160,498"Draw a non-focusable presentation panel above the focused view (no input capture)"; manifest spellingmanifest.rs:358;bitty.ui.overlay.showis gated by the same head,crates/bitty-lua/README.md:60). [0.0.26] First-party help/which-key plugin over the keymap read API and presentation overlay #2408's "exactly the three named grants" is therefore unsatisfiable as written and needs amending.+N morecount has no plugin-reachable input. Today the tail count is derived from the view height (help.rs:82-95,body = view_h - 4); v1 exposes no viewport/frame geometry to plugins (the only size-bearing read isbitty.terminal.snapshot, which needsterminal.semantic-readand reports the terminal grid, not the view frame). Core instead truncates a presented overlay at a fixed 64 rows / 16 KiB (present.rs:154,163,172) and accounts the dropped tail host-side. A plugin must pick its own fixed row cap, so the literal+N morenumber is approximate, not identical.3. Acceptance criteria
bitty --safedraw no help panel;toggle_helpis a plugin command, not a Core actionhelp.rsexists in full (:19,22,30,180), painted atpresent.rs:5433;ChromeAction::ToggleHelpatkeymap.rs:696with parse arms:962-964, canonical:1123, hint:1257, four default chords:1786-1789; app armchrome_keys.rs:2402; Esc branchselection.rs:2674. Safe mode has no bearing on it — it is Core paint.runtime.keymaps.readgateservices.rs:6213-6230;ui.rich+ui.overlayat mountservices.rs:4775;ui.presentservices.rs:2758. No first-party channel exists in the tree.crates/bitty-runtime/tests/help_popup.rs(8 tests incl.:41,63,126,148,271) andcrates/bitty-runtime/tests/esc_routing.rs:78. Nothing moved.help.rsas the shipped surfacebitty-terminal-docs/specifications/input-pointer-rfc.md:346-357— "Help overlay ownership transition (decided direction, not implemented)…help.rsremains the shipped surface and this evidence section stays".Remaining slice
bitty-terminal/bitty-plugins#122is open, noplugins/helpsubmodule and noregistry/official/help.tomlinbitty-plugins(tracked by [0.0.26] First-party help/which-key plugin over the keymap read API and presentation overlay #2408).crates/bitty-runtime/src/runtime/help.rs, theRuntimehelp state/methods, the paint call atpresent.rs:5433, and the dismissal branch atselection.rs:2674.ChromeAction::ToggleHelp, thetoggle_help/show_helpparse arms,KNOWN_ACTIONS_HINTentry, the four default chords, and thechrome_keys.rs:2402arm (fail closed with a migration pointer tocommand:bitty-terminal.help:toggle_help).help_panel_bg_in/help_panel_border_in/help_panel_fg_in(grid.rs:454-489) and their tests (grid/tests.rs:2295-2309).input-pointer-rfc.md:346-357+ implementation-evidence table, the design doc's current-state table, configuration action catalog, shipped-defaults reference, release notes.help_popup.rs/esc_routing.rshelp cases into plugin tests or presentation-overlay mechanism tests; the CoreEsc/confirm matrix stays.runtime.keymaps.read,ui.rich,ui.overlay,ui.present).CLOSE-ELIGIBLE: NO (blocked on stage 4 first-party plugin + Core removal stages 5-8; the original API blocker is cleared)
[CTX-1784] refactor(runtime,config,render): retire the Core-drawn hel…
Xuepoo commentedon Nov 10, 2026
Guard tick 2026-11-10 — Core half landed
#3105merged as3101ab26([CTX-1784], task CTX-1784 completed). Parity was proven before any deletion: every painted element ofcrates/bitty-runtime/src/runtime/help.rs(title, registry-derived rows and ordering, footer,+N moretail, empty state, the four chords, Esc dismissal) is reproduced by the shippedbitty-terminal.helpplugin (lua/help/init.lua+tests/spec/help_spec.lua).Removed from Core:
help.rs(paint + rows + toggle + layout),help_panel_*/HELP_PANEL_*render tokens,ChromeAction::ToggleHelpwith the four default chords, theA::ToggleHelpdispatch arm and the Esc help-dismiss branch. Kept: the keymap/command registry, overlay geometry/stacking andbitty.keymaps.list.Two blocking review findings were fixed before merge: retired
toggle_help/show_helpbindings are now dropped per-binding with a diagnostic namingbitty-terminal.help(previously the wholekeymapstable was salvaged away, losing every sibling binding), and the official catalog was regenerated (SOURCE_REVISION2da1c875) sobitty plugin install bitty-terminal.helpresolves to pin ae1d8a9.Remaining acceptance gap (issue stays open): docs sync —
bitty-terminal-docs(input-pointer-rfc.mdand friends) andbitty-docsstill describehelp.rsas the shipped surface. Second independent review:VERDICT: APPROVEon head4fc555bb.