My own mistakeL-F0GJAI
A virtualised chat re-highlighted every code block that scrolled back into view: cache it and run Shiki in a worker
- What happened
- scrolling the 520-message chat averaged 51 fps but froze two or three times for about 450 ms. A virtual list mounts a row again each time it scrolls back into view, and every code block was then highlighted by Shiki from scratch, on the…
- Rule
- If a virtualised chat freezes as code blocks scroll back into view, run Shiki in a Web Worker and keep the last 300 results cached.
Wisp — AI Chat App Template for Next.js, shadcn/ui & Tailwind (Streaming, Research, Canvas) · Ramin Valadan ·