Skip to content

[CTX-0736] feat(ui): consume Rich Scene in render path via PanelRuntime - #1329

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-0736/feat-scene-consume-render
Sep 23, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-0736/feat-scene-consume-render

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: OQ-051 | Task: CTX-0736

Implements bitty#985 (consume Rich Scene in render path) + bitty#990 (non-terminal panel content beyond char grid) against the placed Scene contract: OQ-051 Accepted (owner ruling 2026-09-23 adopting packet #2, bitty-docs #370) — Scene-consumption contract owned by the Panel Runtime, Scene path consumed by the render pipeline (option A).

Scope:

  • CW-06: Consume Rich Scene in the render path #985: PanelRuntime-owned per-panel Scene slots (attach/panel_scene/detach/len, dispose clears so a scene never outlives its leaf, stale-handle fail-closed) + scene_present_for paint-budget derivation (missing scene yields the empty budget, never a crash) + Runtime::cw_present_plan_for_host render-path derivation resolving the leaf scene through the host.
  • CW-11: Non-terminal panel content beyond character grid #990: PanelRuntime::nonterminal_for_leaf maps Panel/Browser/Rich leaves to the beyond-grid payload (zero overlay slots, saturation flagged); Terminal/Empty keep the grid path (None).

Changes:

  • crates/bitty-runtime/src/registry/host.rs: scenes store on PanelRuntime, attach_panel_scene/panel_scene/detach_panel_scene/panel_scene_len/scene_present_for/nonterminal_for_leaf, dispose symmetry; +8 unit tests.
  • crates/bitty-runtime/src/runtime/cw_live.rs: Runtime::cw_present_plan_for_host (host-resolved scene, empty-scene fail-closed for non-Scene leaves).
  • crates/bitty-runtime/tests/cw_integrate.rs: +4 live-owner render-path tests (attached scene budgeted, missing scene fail-closed, terminal grid path, browser beyond-grid payload).

Fail-closed: non-Scene panels keep the grid path; missing Scene budgets empty, never crashes. Zero unwrap/expect/panic in non-test code; Windows-safe (no OS APIs); English only; MSRV 1.85 clean.

Gates (CARGO_TARGET_DIR=.targets/ctx-0736-scene):

  • cargo fmt --all -- --check: pass
  • RUSTFLAGS=-D warnings cargo clippy --workspace --all-targets --locked: pass
  • cargo test --workspace --all-targets --locked: pass (228 suites, 0 failures)
  • cargo +1.85 check --workspace --all-targets --locked: pass
  • post-rebase: cargo test -p bitty-runtime --all-targets --locked: 1462 passed, 0 failed

Closes #985
Closes #990
Task: CTX-0736

@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 23, 2026
@Xuepoo Xuepoo added feat Feature P1 Priority: high area:ui Area: UI / layout labels Sep 23, 2026
@Xuepoo
Xuepoo merged commit aeac4f6 into main Sep 23, 2026
15 checks passed
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-11: Non-terminal panel content beyond character grid CW-06: Consume Rich Scene in the render path

1 participant