Repository navigation
[CTX-1630] feat(rich): paint panel scenes from the present loop - #2784
Merged
Merged
Conversation
|
Warning Review limit reachedYou'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 58 minutes. View limit details
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. Comment |
Xuepoo
force-pushed
the
ctx-1630/feat-scene-present-loop
branch
from
October 28, 2026 15:20
3621935 to
8fe511a
Compare
Wire PanelRuntime::scene_paint_for into the shipped Runtime present path. Each visible panel leaf resolves its compositor-owned content rect and live cell metrics, composes fills, overlay-seam glyphs, and image placement references into the frame, and feeds bounded damage through SnapshotDamage::with_extra_regions. A typed refusal paints nothing and keeps the previously presented primitives for an unchanged surface. The same paint list's lines are pushed through UiSnapshotHost::push_scene_text so the a11y tree matches the frame. Sync bitty-terminal-docs to the recorded implementation status.
…ilds Every scene-path integration note now says the same thing: the present composition is wired and unit-tested, but no shipped build installs a scene host or binds panels until bitty#2785 (host install + ui.rich attach), so no shipped frame paints a Scene yet. Drop the remaining claims that implied a shipped consumer (bitty-render lib/README/scene, cw_present, cw_live module and integration notes, scene_present).
Xuepoo
force-pushed
the
ctx-1630/feat-scene-present-loop
branch
from
October 28, 2026 16:26
67aa7d4 to
00e5045
Compare
This was referenced Oct 28, 2026
Merged
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.
Priority: P1 | Area: rich | Labels: feat,P1,area:rich | Milestone: v0.2.0 | RFC: OQ-051 | Task: CTX-1630
Part of #2760 (present-loop half; do not close the issue until the reviewer agrees the integration is complete).
Summary
bitty-runtimecomposes the OQ-051 scene paint path into the present loop and unit-tests it end to end. It is not reachable from a shipped frame yet: no shipped build installs a scene host or binds panels until #2785 (host install +ui.richattach), so no shipped frame paints aScene.runtime/present.rsresolves each visible panel leaf's compositor-owned content rect and live cell metrics, derives the bounded paint list, and composes it into the frame. Scene fills join the leaf fill layer, text goes through the existing overlay text seam (ScenePaint::append_into→GridRenderer::overlay_text_glyphs), image nodes stay placement references (counted, never decoded here), and the layout-derived damage is clipped to the leaf content rect.SnapshotDamage::with_extra_regions(newwith_extentkeeps window-space scene rects clipped to the surface). The combined present remains a full frame; the descriptor stays complete for partial planning.ScenePaintErrorpaints nothing, keeps the previously presented scene primitives when the surface/clip/fade/occluder set/atlas epoch are unchanged, and advancesRuntime::scene_paint_refusals/last_scene_paint_refusal. Nothing is clamped.UiSnapshotHost::push_scene_textat paint time (kindSceneKind::Column, identity = panel id) into a per-frame scratch host, so the recorded parity evidence is exactly the painted bytes under the existing bounds. An over-bound projection refuses the whole contribution.Runtime::install_scene_host/scene_host_mut/take_scene_hostinstall the one OQ-051PanelRuntime; no second scene store.Runtime::scene_frame()reports per-frame views/ops/images/damage/a11y, andpresented_allocations()exposes the geometry the loop painted.PanelRuntimescene host with placement binds —Runtime::install_scene_hosthas test callers only (crates/bitty-runtime/tests/scene_paint_path.rs), and the app keeps a barePanelRegistryforpanel.createwith no placements, soplacement_panel_ofcannot resolve a leaf andRuntime::scene_host()staysNone; (b)bitty.ui.mountstill validates through the v1 reader, so noui.richmount attaches aSceneto its panel.bitty-renderdocs, thebitty-runtimescene-path notes, and the workspace decision record now say exactly that, and nothing describes plugin rich content as shipping.Tests
Extended
crates/bitty-runtime/tests/scene_paint_path.rs(no duplicate module):present_loop_paints_panel_scene_inside_its_leaf_and_projects_its_text: headlessRuntimepresent with an installed host, a mounted rich panel, and an attached scene. Asserts painted glyphs, frame pixels changed only inside the leaf content rect (baseline runtime comparison), bounded damage, and a11y lines equal to an independently re-derivedpaint_scenelist on the same surface.refused_scene_keeps_the_previous_frame_and_attributes_the_refusal: an admitted scene whose border exceeds the paint bound is refused; the frame RGBA and a11y projection stay identical to the accepted frame, the retained primitives still paint, and the refusal is attributed with the typed error.Gates
At head
00e50451(worktree,CARGO_TARGET_DIR=$BITTY_WORKSPACE/.targets/ctx-1630); the only change after the previous gate run is documentation/comments inbitty-render/bitty-runtime, so no test behavior changed:cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnucargo check --workspace --all-targets --locked --target aarch64-apple-darwincargo test -p bitty-runtime -p bitty-render -p bitty-ui -p bitty-terminal --lockedRUSTDOCFLAGS="-D warnings" cargo doc -p bitty-runtime -p bitty-render -p bitty-ui --no-deps --lockedjust status-driftjust scratch-pathsCross-target clippy (not run by CI, which uses
cargo checkthere) still reports pre-existing host-conditional lints inbitty-rendertests andexecution_jobs.rs; unrelated to this diff.Docs:
bitty-terminal-docsPR #345 records the implementation status and PR #346 restores the shipped-build caveat; thedocspin is842e7d73(reachable from docsorigin/main).What remains of #2760
Both preconditions are #2785: give the app a shared
PanelRuntimecomposition root with real placement binds and install it throughRuntime::install_scene_host, and routeui.richmounts throughread_rich_component→scene_bridge::mount_rich_node→PanelRuntime::attach_panel_scene. Until both land, a production build cannot paint a scene (no host, no attached scene), and the issue stays open.