perf(cmux-next): gate find highlight repaints by transcript changes

Merged
TE
19d ago
+25-7

Problem

VirtualTranscript repainted every mounted text node for Find in Chat on every commit, including scroll and layout commits that did not change query, transcript rows, or mounted DOM.

Change

  • derive a primitive mounted-range signature from the virtualization windows
  • rerun highlighting when the query/active target, immutable row snapshot, or mounted range changes
  • preserve streaming/reveal updates and clear behavior when Find closes

This avoids redundant DOM tree walks while keeping highlights correct as rows stream or virtualized rows enter the viewport.

Validation

  • git diff --check
  • Fleet CI: web checks, React Doctor, compiler/typecheck, focused chat-find tests, and gallery/render guards

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Gates Find in Chat highlight repaints on transcript changes so scrolling and layout commits no longer walk every mounted text node.

Highlighting reruns only when the query, active target, immutable row snapshot, or mounted range changes. Streamed text, fold reveals, and clear-on-close behavior are preserved; the effect keeps revealed as a dependency so opening a fold repaints the match. Effect dependencies use primitive signatures (row id, occurrence, mounted-range key) so spurious state changes don't invalidate the highlight pass.

Validation:

  • git diff --check
  • Fleet CI: web checks, React Doctor, compiler/typecheck, focused chat-find tests, and gallery/render guards, including the apps empty-state selector carried through this change.