Repository navigation
A fade frame repaints an entry's lines; it no longer renders the entry again - #1558
Merged
Merged
Conversation
…y again ConversationEntry.repaint called widget.refresh() on itself and every descendant each animation frame, and refresh() re-renders content: a fading entry rebuilt every Markdown block and row, with a new rich Style per segment, for text that never changed. The live profile had rich Style construction at 19% of the main thread; a probe over one arrival fade measured 9 content renders in 21 frames. With OpenHCSDev/textual#246's refresh_lines, an effect that paints over the lines repaints them: AnimationEffects.repaint and the entry's walk use it, and on_hide/on_show call repaint, so each kind keeps its own. EffectInContent is the kind whose content reads the frame (FutureText, SplashText, the tab Underline, MessageDivider, Throbber): it renders again. SwitchToast reads its frame in render_line, so it repaints lines. After: 1 render in 27 frames, the initial one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 65edf97 passes. |
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.
1 commit, 9 files. Lands after OpenHCSDev/textual#246 (merged).
The bug
ConversationEntry.repaint(block_navigation.py) calledwidget.refresh()on itself and every descendant on each animation frame. A fullrefresh()re-renders content, so a fading entry rebuilt every Markdown block and row, with a new richStyleper segment, for text that never changed. In the live profile, richStyleconstruction was 19% of the main thread.The change
AnimationEffects.repaintandConversationEntry.repaintuse textual#246'srefresh_lines(). The effect paints over the lines (paint_effectsinrender_line), and the content is kept.EffectInContent, a mixin, is the other kind: widgets whose content reads the frame inrenderor their strips (FutureText,SplashText, the tabUnderline,MessageDivider,Throbber). Each declares it in its base list and renders again.on_hide/on_showcallself.repaint()instead ofrefresh(), so each kind keeps its own repaint.SwitchToastreads its frame inrender_line, so it repaints lines.Proof
tests/textual/test_fade_frames_keep_content.pypins that an arrival fade renders its entry once.test_hidden_fades_tick_once_per_loop_turnfails identically on clean main.🤖 Generated with Claude Code