Repository navigation
[CTX-0108] docs(sdk): author reference for the bitty.ui.panel presentation surface - #202
Merged
Merged
Conversation
…ation surface Add sdk/reference/ui-panel.md, a companion reference page for the plugin-facing panel-content presentation surface landed under bitty#2388 (residue item 4, author-guide half): present/update/release with the closed spec table, poll with the bounded Core-owned input queue, the panel.content.* events, the close-path restore of the displaced PTY (bitty#3269), the app producer wire and cold-tick pump (bitty#3299), and the mode-move matrix with the fullscreen/scratchpad typed refusals at the single gate (bitty#3302). Every behavior claim is pinned to bitty@944a4b1f with file:line evidence; the queue's byte budget is tied to RC-5 of runtime/isolation-resource-rfc.md, and the contract source stays labeled a draft candidate, never accepted. Index: extend the bitty.ui row's covering tests and add the companion-page paragraph in sdk/reference/README.md; prettier realigned the namespace table, so the diff re-pads rows this change did not edit. Related bitty-terminal/bitty#2388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Docs-only PR for bitty#2388 residue item 4 (the author-guide half): a new
companion reference page
sdk/reference/ui-panel.mddocumenting theplugin-facing panel-content presentation surface, plus the two index edits
in
sdk/reference/README.md(covering-test row extension and thecompanion-page paragraph; prettier realigned the namespace table, so the
index diff re-pads rows this change did not edit — required by the gate, not
a rewrite).
The gap was real: before this change the corpus had zero coverage of
bitty.ui.panel.*/panel.content.*(rg 'bitty\.ui\.panel|panel\.content'over all
*.mdin this repo returned no hits), while the surface is fullylanded in bitty main.
Documented surface (all verified against bitty main @ 944a4b1f, 2026-11-22)
bitty.ui.panel.present/update/release/poll(bitty#3267,CTX-1909): two-value refusal returns (
handle, err), host-derived handle,the closed two-field
spectable (placementhint-only,restore = "previous"only, unknown keys refused typed), closed release reasons(
released/cancelled). Evidence:crates/bitty-lua/src/ui_panel.rs:35/38/41/50/53/60/75/109/115/127/134,crates/bitty-lua/src/host.rs:7430/7472/7524/7577/7579.ui.panel(incrates/bitty-package/src/manifest.rs:375CLOSED_CAPABILITY_HEADSso amanifest naming it validates);
present/updatecheckui.richthenui.paneleach by name, then safe mode, then backend presence;release/pollneedui.panelonly; backend shared only with grantedgenerations. Evidence:
crates/bitty-runtime/src/plugin_runtime/services.rs:8136(ui_panel_present),:8155(safe mode),:8290(panel_set_presentationfails closedE_NOT_IMPLEMENTED);crates/bitty-runtime/src/plugin_runtime/mod.rs:3371,:3631.E_UI_PANEL_BUSY(host.rs:1001),E_UI_PANEL_NESTED(:1010),E_UI_PANEL_UNAVAILABLE(:1019),E_UI_UNAVAILABLE,E_UI_NOT_OWNER(owner+generation fence),E_UI_COMPONENT_INVALID; one layer per panel, one per generation.poll(bitty#3268, CTX-1911) — 256 eventsper layer AND 256 KiB held text, per-event 4096-byte truncation cap, drop
oldest + counted + sticky
overflowed; the byte budget is charged againstRC-5 (PerPlugin 1024 events / 256 KiB aggregate) of
runtime/isolation-resource-rfc.mdin THIS corpus — the owning RFC iscited, no free-floating constant. Poll result
{ status, seq, events, dropped, overflowed, reason }(crates/bitty-lua/src/host.rs:1172PanelPoll,:3501panel_poll_value).panel.content.released{ owner, handle, reason }andpanel.content.input-available{ owner, handle, queued }(
crates/bitty-plugin-host/src/event.rs:265/266), observation-only,bounded 64-deep buffer with counted drops
(
crates/bitty-runtime/src/runtime/ui_panel.rs:116).close_viewreleases first and does not close (refused release blocksthe close); plugin panel close releases by panel identity; workspace close
sweeps before teardown (
crates/bitty-terminal/src/chrome_keys.rs:1604,crates/bitty-runtime/src/runtime/workspaces.rs:2782,runtime/panel_content.rs:403).RuntimePanelContentBackendinstalled at the composition root beforeactivation (
crates/bitty-terminal/src/plugin_runtime.rs:2155) and pumpedon the app cold tick right after the plugin-timer pump
(
crates/bitty-terminal/src/terminal_app.rs:2620,:3254).floating are the answerable modes; the layer's identity, attachment,
token, content, and the displaced terminal's winsize survive the move; no
SIGWINCH;
fullscreenandscratchpadparse but are refused typed at thesingle gate (
PanelError::ContentPresentationUnsupported,crates/bitty-runtime/src/runtime/panel_content.rs:1022) before any statemoves. The user drivers (
bitty ctl panel mode p:N tiled|floating [TOKEN],crates/bitty-terminal/src/ctl/request.rs:544;ctrl+alt+atoggle_panel_mode,crates/bitty-config/src/keymap.rs:1048) routethrough the same gate and changed no plugin surface.
Accuracy notes
specifications/panel-gui-content-presentation-candidate.md— a draftcandidate. The page labels it as such everywhere and never describes it
as accepted; the accepted Plugin API v1 Lua Surface RFC does not name
ui.paneland is not amended by this PR (same rule as theui.presentsection of
sdk/reference/ui.md).(RC-5 in
runtime/isolation-resource-rfc.md); scene budgets arecross-linked to the existing reference pages instead of restated.
crates/bitty-runtime/tests/ui_panel_api.rs(15 contractrows),
panel_content_presentation.rs(close-path restore),panel_content_presentation_modes.rs(8 mode rows) — added to thebitty.uirow of the reference index, pinned tobitty@944a4b1f.Gates
just checkgreen from the worktree (prettier 3.9.6 fmt-check, markdownlint0.23.1 — 0 issues in 114 files, links, metadata, language, agents, hygiene,
svg, actionlint), plus
act -n --action-offline-mode -W .github/workflows/ci.ymldry-run success. The firstbunon the defaultPATH segfaults in this environment; the real bun at
~/.local/share/bun/binran every pinned tool unchanged.Related bitty-terminal/bitty#2388