Skip to content

[CTX-1335] fix(ui): evict only bounds-only tweens and carry painted bounds on re-arm - #2232

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1335/fix-animation-budget-eviction
Oct 18, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1335/fix-animation-budget-eviction

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #2231 for the two CodeRabbit inline findings that were not part of
the squashed merge (3ec20bed, main 8da9df0d). This is a fix-only branch; it
does not re-introduce the panel-geometry feature.

Findings addressed

  1. Carry painted bounds forward when a gesture re-arms the ring. PanelAnimator::trigger previously dropped an in-flight bounds tween for Move/Resize/Drag and created a ring entry with bounds: None, so the next present started from the last committed target instead of the painted frame. Continuous Alt+drag could snap on every update. The replacement entry now carries the current interpolated frame plus the previous destination; the next present retargets from the painted bounds. Close behavior is unchanged.
  2. Evict only bounds-only tweens at the shared budget. drop_one_bounds selected any entry with bounds, including a reused Move ring or the Alt-drag Drag entry, deleting an accepted ring fade. It now evicts only bounds.is_some() && !ring entries; when none exists the trigger is refused, preserving the documented ring priority.

Scope

  • crates/bitty-runtime/src/runtime/animations.rs — the two fixes and two animator regressions.
  • crates/bitty-runtime/tests/panel_animations.rs — consecutive Alt-drag continuity regression.

Diff vs origin/main: 2 files, +159/−7. No other product code.

Verification

  • cargo fmt --all -- --check — pass
  • RUSTFLAGS="-D warnings" cargo clippy -p bitty-runtime -p bitty-ui --all-targets --locked — pass
  • cargo nextest run -p bitty-runtime --locked — 2519 passed, 1 skipped
  • cargo test -p bitty-runtime --lib runtime::animations:: --locked (debug, overflow checks) — 22 passed
  • cargo check --target x86_64-pc-windows-gnu --workspace --all-targets --locked — pass

Regression proof: removing the carried bounds makes consecutive_alt_drag_updates_carry_painted_bounds_forward snap to the previous target; restoring the old eviction predicate makes overflow_preserves_a_ring_entry_that_hosts_bounds delete the drag ring. Both fail without the fixes.

Priority: P2 | Area: area:ui | Labels: fix,P2,area:ui | Milestone: v0.1.0 | RFC: RFC-0002 panel animation contract | Task: CTX-1335

Summary by CodeRabbit

  • Bug Fixes
    • Prevented panels from visually jumping when movement, resizing, or dragging animations are retargeted mid-transition.
    • Preserved ring animations when clearing older bounds-only animations.

CodeRabbit PR #2231 findings 1 and 2:

- Carry the painted frame forward when a gesture (Move/Resize/Drag)
  re-arms its ring, so the next present retargets from the currently
  painted bounds instead of snapping back to the last committed target.
  Close keeps its existing bounds-drop behavior.
- Evict only bounds-only entries in `drop_one_bounds`; a ring entry that
  hosts bounds (a reused Move slot or the Alt-drag Drag entry) keeps its
  accepted fade. With no bounds-only entry the trigger is refused, which
  matches the documented ring priority.

Adds a consecutive Alt-drag continuity regression and a full-budget
ring-priority test.
@Xuepoo Xuepoo added this to the v0.1.0 milestone Oct 18, 2026
@Xuepoo Xuepoo added fix Bug fix area:ui Area: UI / layout P2 Priority: medium labels Oct 18, 2026
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d1b701d-42e1-4c78-8dc1-4fe87e0b1193
📥 Commits

Reviewing files that changed from the base of the PR and between 8da9df0 and a9a0251.

📒 Files selected for processing: 2
  • crates/bitty-runtime/src/runtime/animations.rs
  • crates/bitty-runtime/tests/panel_animations.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Panel animation restarts now carry forward interpolated bounds for Move, Resize, and Drag transitions. Bounds eviction now preserves ring animations that host bounds. Tests cover retarget continuity and eviction behavior.

Changes: Panel bounds animations

Layer / File(s) Summary
Carry bounds across gesture restarts
crates/bitty-runtime/src/runtime/animations.rs, crates/bitty-runtime/tests/panel_animations.rs
Move, Resize, and Drag restarts carry forward the current interpolated bounds and previous destination. New ring animations retain carried bounds. A regression test checks continuity during consecutive Alt-drag updates.
Preserve ring animations during bounds eviction
crates/bitty-runtime/src/runtime/animations.rs
Bounds eviction selects unfinished entries without a ring. A test checks that eviction removes a separate bounds-only tween while preserving a drag ring that hosts bounds.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a9a02

This change keeps panel animations continuous when a gesture restarts and stops budget eviction from removing ring animations. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies both main changes: bounds-only tween eviction and carrying painted bounds when re-arming animations.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Xuepoo
Xuepoo merged commit 7daed33 into main Oct 18, 2026
17 checks passed
@Xuepoo
Xuepoo deleted the ctx-1335/fix-animation-budget-eviction branch October 18, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Area: UI / layout fix Bug fix P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant