ATProto-based AI Assistant Chat interface.

A long code block streams with about half the CPU it took. Each of its lines is a block of its own, so a character arriving lays out and paints its line alone, rather than the browser laying out and repainting the whole block, and its lines render in memoized groups of 32, so React rerenders only the last group rather than visiting every line. Each line still ends in its newline, so text selected and copied from a block keeps its blank lines. Streaming a 2,000-line block in a production build, the main thread went from 67% to 26% busy, with layout from 10 s to 1 s and paint from 15.6 s to 3.7 s.


Author
Date Commit Parent ceed41b6
+55 -9
3 changed files
+55 -9
3 changed files