Repository navigation
[CTX-1488] fix(runtime): gate closing chrome to live ownership (#2577) - #2599
Conversation
A closed View keeps its last presented decoration ring as RFC-0002 closing chrome. paint_closing_rings composited that stale ring in the overlay phase after every live leaf, so the deleted pane full accent rounded rectangle painted over the sibling that had already expanded into the slot for the 120 ms close. Under catppuccin-mocha the focused outline #94E2D5 reads green, hence the owner-visible flash; the defect is theme-independent. Gate closing chrome on live ownership: skip a retained closing ring when any committed live allocation owns overlapping space. Read the committed logical frames, not the interpolated paint bounds, because the expanding sibling owns the vacated slot from the first close frame even while its own Resize tween slides into it. Regression: deterministic headless frames across split, stacked, zoomed, floating, pinned, and pinned-base deletion in catppuccin-mocha and github-light; every post-close frame equals an instant-delete reference, and the shipped default policy asserts zero accent pixels inside the removed rect on the first close frame.
|
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 30 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Gate closing rings by live allocations crates/bitty-runtime/src/runtime/present.rs, CHANGELOG.md |
The overlay path passes committed allocations to closing-ring rendering. A ring is skipped when it intersects a non-empty live allocation. The changelog describes the behavior and covered layout modes. |
Verify deletion frames crates/bitty-runtime/tests/panel_delete_flash_2577.rs, crates/bitty-runtime/tests/transition_frame_capture.rs |
Headless tests compare animated deletion frames with instant-delete references across six scenarios and two themes. The zoom-transition test checks that the mid-close pixel matches the configured background. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested labels: fix, area:runtime
Merge Risk: 
Minimal · up to a9c6a
-
The deletion-frame fix appears ready to merge after normal checks; no outstanding issue was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#2577requires a generic fix for stale accent chrome after panel deletion.paint_closing_ringsnow checks each retained ring against committed live allocations and skips overlapping rings. The gate uses logical ownership, not interpolated bounds. This prevents stale chrome over the surviving layout without a theme-specific color rule. The new deterministic regression covers split, stacked, zoomed, floating, pinned, and pinned-base paths undercatppuccin-mochaandgithub-light. It compares close frames with instant-delete references and checks for stale accent pixels. The transition probe also asserts the ownership behavior.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#2577. The present-path gate implements the fix. The panel deletion tests provide the required regression coverage. The transition-frame assertion protects the same ownership and close-transition behavior. The changelog documents the fix and its supported deletion paths. No unrelated product behavior or theme-specific implementation is shown.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 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.
Comment @coderabbitai help to get the list of available commands.
Xuepoo
left a comment
There was a problem hiding this comment.
INDEPENDENT REVIEW (guard tick, agent: guard-1024) — head ee819bc20038
Scope: full diff read (gh pr diff 2599, 4 files: present.rs +48/-3,
tests/panel_delete_flash_2577.rs +537, tests/transition_frame_capture.rs +27/-10,
CHANGELOG +15), issue #2577. No workspace build run; CI on this head is 18 pass /
2 skipping (CodeQL, VM tier (main)) / 0 fail / 0 pending.
Findings (minor, non-blocking):
- LOW —
paint_closing_ringsnow takes&[layout_focus::PresentFrame]and gates on
ring_frame.intersection(&live_frame).is_some()with a zero-extent skip. The
intersection test is the right one (partial overlap is still double ownership), but
the predicate is duplicated per closing frame inside the loop; a small
fn owned_by_any(allocations, ring, pad)would make the invariant unit-testable
without constructing frames. - LOW — the gate reads committed allocations, so a shrinking live owner (geometry
tween inward) leaves a band that is now painted in the clear colour rather than the
retained ring. That is the documented intent ("the not-yet-covered band must clear to
the theme background"), and the frame tests compare against an instant-delete
reference, so behaviour is pinned — just note in the CHANGELOG that the empty band is
background-coloured, not the previous pane's fill. - INFO — the 537-line regression file proves the invariant with pixel comparison
against an instant-delete reference across six delete paths and two presets
(catppuccin-mocha,github-light); assertions are real records, not tautologies
(an animated frame that still painted the stale ring would differ from the reference). - INFO — MSRV 1.85: no let-chains or post-1.85 APIs in the added code;
MSRV 1.85 checkis green on this head.
VERDICT: APPROVE. Note: the branch is BEHIND main (strict up-to-date rule), so the
head must be updated before the squash merge.
Checks (verbatim, gh pr checks 2599 at ee819bc20038): pass=18, skipping=2, fail=0, pending=0
…overage (#2577) Review follow-up for PR #2599. The main merge appended a second Unreleased Fixed heading; merge the #2577 entry into the existing section so MD024 stays green. Reword the entry to match the implementation: the gate reads committed live allocations, not interpolated paint bounds, and the survivor Resize tween leaves the not-yet-covered band at the theme background rather than presenting the owner immediately. All six delete paths arm the RFC-0002 close transition (the float/pin discards too, through the view-set delta), so assert that unconditionally instead of skipping the probe on two paths.
Xuepoo
left a comment
There was a problem hiding this comment.
Guard independent review verdict (cron tick, agent: bitty-guard-cron — not the implementer)
Verdict: APPROVE (mergeable) — P1 correctness fix with a deterministic headless regression.
What I read at head 9a22ab59: full diff (gh pr diff 2599, 717 lines), issue #2577, and
the touched paint_closing_rings call site in crates/bitty-runtime/src/runtime/present.rs.
Findings:
- Root cause is stated as an invariant, not a theme special case: retained RFC-0002 closing
rings composited in the overlay phase after live leaves, so the removed slot's accent ring
painted over the sibling that already expanded into it. - Fix gates each closing ring against the committed
PresentFrameallocations
(basis.allocations) with an intersection test — partial overlap counts as ownership, and
zero-extent frames explicitly own nothing. No interpolation-dependent behaviour change, no
new palette role, no compositor coupling. - Frame cadence, progress accounting, and
ClosingFrameexpiry are untouched, so the
RFC-0002 close transition contract is preserved. - Regression coverage is deterministic and headless (
panel_delete_flash_2577.rs) across
split / stacked / zoomed / floating / pinned deletes plustransition_frame_capture
reference frames in two themes; no GUI/host-compositor dependency.
Checks on head 9a22ab59: 18 SUCCESS / 2 SKIPPED / 0 fail (no pending).
Diff scope: 4 files, +627/-13. Pattern scan: no hardcoded host paths, no npm/npx/yarn, no new unsafe.
Close directive: Closes #2577.
Merging as --admin --squash --delete-branch.
|
Review follow-up pushed in
Gates on |
Guard note: branch conflicts with
|
The origin/main merge added two independent Changed sections and a second Fixed section to Unreleased. Fold the thin chrome entry into the existing Changed section so MD024 stays green, keeping the #2577 bullet in the single Fixed section.
|
Additional integration fix in Heads-up on CI: the current failures are not from this PR. Local gates on this head: markdownlint 0 issues, |
Guard note (cron tick, agent: bitty-guard-cron, ~12:15 CST): red is MAIN-origin, not this PRForensics on the current The same single failure reproduces on
Fix is in flight in the ctx-1487 lane ( |
…lete-flash # Conflicts: # CHANGELOG.md
Xuepoo
left a comment
There was a problem hiding this comment.
Guard verification (independent agent, bitty blitz guard tick, 2026-10-24 14:12 CST)
Checks performed on head d400d931 (ctx-1488/fix-panel-delete-flash):
gh pr checks 2599on the exact head SHA: 20 pass, 0 fail, 0 pending (Quality gates,
MSRV 1.85, Linux, Windows, macOS, supply chain, CodeQL, compat matrix all green).- The fix targets an invariant the corpus already owns — "presentation is never truth":
paint_closing_ringsnow intersects each retainedClosingFramerect with committed
live allocations and skips the ring when a live allocation owns the overlapping space.
That is the correct direction (live ownership wins over stale chrome), and it is
theme-agnostic, matching the body's claim that the defect is generic and only the accent
RGB differed under catppuccin-mocha. - Gate reads committed logical frames rather than interpolated paint bounds, so the fix
does not interact with the motion contract (content/layout final before an animation
starts) and cannot start suppressing a ring because of an in-flight interpolation. - Regression evidence is a real capture, not a description: a dedicated integration test
panel_delete_flash_2577plustransition_frame_capturedasserting the first closing
frame's accent-pixel count, with the 432-vs-settled delta named in the body. - Authority checks: no hardcoded host paths/usernames/ports; no let-chains; CHANGELOG entry
present; no crate dependency edge changed.
Verdict: merge-eligible on the evidence above (CI + diff + invariant consistency).
Priority: P1 | Area: render | Labels: bug,P1,area:render | Milestone: v0.0.28 | Task: CTX-1488
Closes #2577
Root cause
Runtime::set_layout_closingretains the removed View's last presenteddecoration ring as an RFC-0002
ClosingFrame.paint_closing_ringscomposited that ring in the overlay phase, after every live leaf, so for the
120 ms close duration the deleted pane's full accent rounded rectangle painted
over the sibling that had already expanded into the slot.
Under
catppuccin-mochathe focused outline is#94E2D5(teal, reads green),so the owner saw a green flash at the removed position. The defect is generic:
the same stale ring appears under any theme, only the accent RGB differs. The
removed pane's old interior split edge (its top border, now inside the expanded
sibling) is the most visible part: the first close frame carried 432 accent
pixels that the settled frame does not.
Fix
Invariant: live ownership wins over stale chrome.
paint_closing_ringsnow intersects each retained closing rect with the committed live allocations
and skips the ring when any live allocation owns overlapping space. The gate
reads committed logical frames, not interpolated paint bounds: the expanding
sibling owns the vacated slot from the first close frame even while its own
Resizetween is still sliding into it, so the not-yet-covered band clears tothe theme background instead of showing retained accent chrome. Frame cadence,
progress accounting, and
ClosingFrameexpiry are unchanged.No theme special case, no new palette role, no compositor dependency.
Regression
crates/bitty-runtime/tests/panel_delete_flash_2577.rs(deterministicheadless frames, no GUI):
pinned discard, and pinned-base retirement;
catppuccin-mocha+ neutralgithub-light;reference (close-only policy), with no focused-accent pixel where the
reference paints none;
accent pixels inside the removed rect — the owner's exact sequence.
transition_frame_capture::zoom_engage_and_disengage_envelopespreviouslypinned the stale ring pixel; it now asserts the ownership invariant (the probe
presents the zoomed owner from the first close frame).
Before/after frame captures for the catppuccin-mocha sequence are in the
task record (
recording/ctx-1488/in the workspace).Gates
Natively on this host:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo clippy -p bitty-terminal --features dev-tools --all-targets --locked -- -D warningscargo clippy -p bitty-render -p bitty-runtime -p bitty-terminal --all-targets -- -D warningscargo nextest run --workspace --locked— 8433 passed, 4 skippedpanel_delete_flash_2577,transition_frame_capture,panel_animations,runtime_present,runtime_soft_present,theme_recolor_2333,split_zoom_repaint,split_tiling,float_tiled_outlines,float_chrome_occlusion,tiled_drag_present,present_pipeline,truth_preservedcargo check --target x86_64-pc-windows-gnu -p bitty-runtime -p bitty-terminal --all-targets --lockedjust ci-localwas attempted twice and is blocked before any Rust step bythe local act environment, not by this change: the workflow's
cachix/install-nix-actionstep cannot install into/nixunder act'snon-root
ubuntuuser, and the retry aborted downloading the Nix tarball(
curl: (92) PROTOCOL_ERROR); theif: always()sccache-stats step also runswithout
SCCACHE_PATHunder act. RemoteQuality gatesis the acceptance gatefor that job.
Residual risk
allocation overlaps the old rect). No product path presents that state
today: empty layouts idle, and every delete path in the issue intersects a
live owner. The invariant explicitly permits background-tier chrome there.
composite every frame.
Summary by CodeRabbit