Skip to content

fix: stop the preview scanning every line each frame - #165

Merged
brtkwr merged 1 commit into
mainfrom
fix/preview-frame-cost
Oct 28, 2026
Merged

brtkwr merged 1 commit into
mainfrom
fix/preview-frame-cost

Conversation

@brtkwr

@brtkwr brtkwr commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

ccs lagged while PRs were loading, most visibly with the ^O popup open: each PR result that landed redrew the screen, and every redraw cost about 55ms on a long session.

  • Cause: drawing the preview ran a regex over every line of the selected conversation to find search hits, even with nothing searched. Now it only looks while searching, and only at the start of each line. A redraw of a 3000-message session went from 55ms to 0.13ms in a benchmark.
  • ^O popup: each PR's status is now read every time the popup redraws, rather than copied when it opens, so lookups that land while it's open replace "checking…".

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun

Every frame ran a regex over every line of the selected conversation
looking for search hits, even with no search typed: about 55ms a frame
on a long session, so the screen lagged keys and PR lookups landing
(most visible with the ^O popup open). Hits are now looked for only
while searching, and only at each line's start. The ^O popup also draws
each PR's status as it is now, so lookups that land while it's open
show instead of staying "checking…".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun
@brtkwr
brtkwr enabled auto-merge October 28, 2026 19:26
@brtkwr
brtkwr merged commit 1bf6aaf into main Oct 28, 2026
1 check passed
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.

1 participant