Skip to content

perf: narrow streaming animation redraw to timeline list only#54

Open
TigerInYourDream wants to merge 4 commits intomainfrom
perf/narrow-streaming-redraw-scope
Open

perf: narrow streaming animation redraw to timeline list only#54
TigerInYourDream wants to merge 4 commits intomainfrom
perf/narrow-streaming-redraw-scope

Conversation

@TigerInYourDream
Copy link
Copy Markdown

@TigerInYourDream TigerInYourDream commented Apr 7, 2026

Summary

  • Replace self.redraw(cx) with redraw_timeline_list() that only redraws the timeline PortalList, skipping input bar and typing notice
  • Skip redraw entirely when streaming messages are not visible in viewport
  • Apply same optimization to streaming timeout handler

Closes #53

Context

During streaming message animation (55ms tick, 2-char reveal), self.redraw(cx) was called on the entire RoomScreen subtree. This unnecessarily redraws static UI elements (input bar, typing notice) and triggers redraw even when streaming messages have scrolled off-screen.

Changes

  • New redraw_timeline_list() method that targets only timeline.list PortalList
  • New any_timeline_indices_visible() helper to check if any streaming item is in the viewport before triggering redraw
  • Both animation frame handler and timeout handler now use the narrowed scope

Test plan

  • Streaming animation still works correctly (character-by-character reveal)
  • No visual glitches when scrolling during active streaming
  • Verify reduced redraw scope via debug log (Streaming animation frame took Xms)

- Replace self.redraw(cx) with redraw_timeline_list() that only redraws
  the timeline PortalList, skipping input bar and typing notice
- Skip redraw entirely when streaming messages are not visible in viewport
- Apply same optimization to streaming timeout handler

Closes #53
@tyreseluo tyreseluo marked this pull request as draft April 7, 2026 09:53
@tyreseluo tyreseluo marked this pull request as ready for review April 7, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: narrow streaming animation redraw scope to timeline list only

2 participants