Repository navigation
Targeted animation repaint: invalidate only the effect's region - #1756
Merged
Merged
Conversation
repaint_lines() cleared the entire styles cache and marked every line dirty on each animation tick. A 1-character cursor blink re-rendered 40+ lines of the CursorContainer viewport. The name wave on 10 small sidebar labels flushed 10 caches 20 times per second. FramePresentation.redraw() now calls _effect_region() to get the region the running effects actually paint. _effect_region() returns None by default (full invalidation, fine for 1-2 line widgets). CursorContainer overrides it to return just the cursor's visible rows — 1-2 lines instead of the full viewport height. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-src at b32c6df blocks on 10 lines: |
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.
Summary
FramePresentation.redraw()invalidated the entire widget's styles cache on every animation tickredraw()now calls_effect_region()to get the actual painted region, invalidating only those linesCursorContaineroverrides_effect_region()to return the cursor's visible rows (1-2 lines, not the full viewport)Why it was expensive
repaint_lines()→_invalidate_lines()(no regions) →_styles_cache.clear()→ marks EVERY Y coordinate dirty → compositor re-runsrender_line()for each dirty line →paint_effects()resolves and blends colours per segment per lineTest plan
🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1