{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/2026-11-26-virtualize-long-chat-transcript-react/","result":{"data":{"site":{"siteMetadata":{"title":"M. Hassan Ahmed","author":"Hassan11196"}},"markdownRemark":{"id":"a3a77170-e11e-5b72-b896-2a60d7f5b856","excerpt":"The re-render fixes carry you a long way, and then one day they stop. A user who has kept the same assistant session open for a week scrolls up, and the…","html":"<p>The re-render fixes carry you a long way, and then one day they stop. A user who has kept the same assistant session open for a week scrolls up, and the scrollbar is a sliver, and every drag of it chugs. Typing in the composer lags again. You open the profiler expecting a wide flame graph and find almost nothing: React is barely rendering. The jank is real, but it is not coming from where you tuned last time.</p>\n<p>This post is the sequel to <a href=\"/blog/2026-09-18-fix-react-rerenders-streaming-chat/\">fixing unnecessary re-renders in a chat UI</a>. That post was about not <em>calling component functions</em> you do not need to call. This one is about a different cost that memoization cannot touch: the DOM nodes themselves. When a transcript grows past a few hundred messages, the browser is laying out, painting, and holding in memory every bubble you ever rendered, whether it is on screen or not. The fix is virtualization, also called windowing, and it is the lever I left for last in the previous post. It is more invasive than a <code class=\"language-text\">React.memo</code>, and it quietly breaks a few things you were relying on, so it is worth understanding before you reach for it.</p>\n<p>I ran into this on the operator chat in <a href=\"/project/archi/\">Archi</a>, the retrieval copilot for CMS operations, where a long shift leaves a conversation hundreds of turns deep, and again on <a href=\"/project/cloud-canvas-ai/\">CloudCanvasAI</a>, where a document edit session accumulates a wall of back-and-forth. Both were already memoized. Both still got heavy. The number that mattered was not renders per second; it was nodes in the tree.</p>\n<h2>Why memoization runs out</h2>\n<p><code class=\"language-text\">React.memo</code> decides whether to re-run a component function. It does nothing about whether that component’s output stays mounted. A finished message that is memoized still has a <code class=\"language-text\">&lt;div&gt;</code>, still has its parsed Markdown, still has its highlighted code block, and the browser still accounts for all of it on every layout pass. A single message bubble with a code block can be dozens of DOM nodes. Two thousand of them is tens of thousands of nodes sitting in the document, most of them scrolled far out of view where nobody will ever look.</p>\n<p>That has three costs the re-render work never addressed. Layout and paint scale with how much is in the tree, so anything that triggers a reflow, including the growing bubble while a reply streams, gets slower as the history grows. Memory scales the same way, and on a long-lived tab it climbs until the page feels sluggish or the tab is killed. And the initial mount of a restored session has to build every node up front, which is the lag you feel when you reopen a long conversation.</p>\n<p>Virtualization attacks all three at once by refusing to mount what you cannot see.</p>\n<h2>What windowing actually does</h2>\n<p>The idea is older than React. A scroll container only shows a slice of its contents at a time, so render only that slice. Keep a tall empty spacer so the scrollbar still reflects the full height, and as the user scrolls, swap which messages occupy the visible window. The DOM holds maybe a dozen message nodes instead of two thousand, plus a small <em>overscan</em> buffer above and below so a fast scroll does not flash blank rows before the next batch mounts.</p>\n<p><img src=\"/df1c0446782a345941c71f894c0b4b19/dom-window.svg\" alt=\"Two scroll containers side by side showing the same long chat. On the left, labelled every message mounted, all of a thousand message bubbles exist in the DOM at once, the vast majority scrolled out of view above and below the viewport, with a note that the browser lays out and paints all thousand. On the right, labelled windowed, a tall empty spacer preserves the full scroll height but only the roughly twelve messages inside the viewport plus a small overscan buffer above and below are actually mounted; a positioned offset holds them at the right scroll position, and a note reads the DOM holds about twelve nodes, not a thousand, so layout cost stays flat as the history grows.\"></p>\n<p>For rows of a known, fixed height this is almost trivial, and you should not write it yourself. <a href=\"https://github.com/bvaughn/react-window\"><code class=\"language-text\">react-window</code></a> gives you a <code class=\"language-text\">FixedSizeList</code> where the position of item <code class=\"language-text\">n</code> is just <code class=\"language-text\">n * rowHeight</code>, so the library can place the window with pure arithmetic and never has to measure anything. The whole thing is a multiply and a <code class=\"language-text\">transform</code>. If your rows were all the same height, this post would end here.</p>\n<h2>The part that makes chat hard: variable heights</h2>\n<p>Chat messages are not a fixed height. A one-line “yes” and a forty-line code block are the same list, and you do not know how tall any given message is until it has been rendered and the browser has laid it out. That breaks the arithmetic. The library cannot compute the offset of message 900 without knowing the height of the 899 above it, and it cannot know those heights without mounting them, which is exactly what virtualization exists to avoid.</p>\n<p>The way every mature library resolves this is estimate, then measure, then correct. You supply a rough height estimate so the virtualizer can place a first guess. As each row actually mounts, you measure its real height with a <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver\"><code class=\"language-text\">ResizeObserver</code></a> or <code class=\"language-text\">getBoundingClientRect</code>, cache it against that message’s id, and the virtualizer reconciles the guess with the truth. <a href=\"https://tanstack.com/virtual/latest/docs/framework/react/examples/dynamic\">TanStack Virtual</a> does this through a <code class=\"language-text\">measureElement</code> ref you attach to each row:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsx\"><pre class=\"language-jsx\"><code class=\"language-jsx\"><span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> useVirtualizer <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">\"@tanstack/react-virtual\"</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">function</span> <span class=\"token function\">Transcript</span><span class=\"token punctuation\">(</span><span class=\"token parameter\"><span class=\"token punctuation\">{</span> messages <span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token keyword\">const</span> scrollRef <span class=\"token operator\">=</span> <span class=\"token function\">useRef</span><span class=\"token punctuation\">(</span><span class=\"token keyword\">null</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n  <span class=\"token keyword\">const</span> virtualizer <span class=\"token operator\">=</span> <span class=\"token function\">useVirtualizer</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n    count<span class=\"token operator\">:</span> messages<span class=\"token punctuation\">.</span>length<span class=\"token punctuation\">,</span>\n    <span class=\"token function-variable function\">getScrollElement</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> scrollRef<span class=\"token punctuation\">.</span>current<span class=\"token punctuation\">,</span>\n    <span class=\"token function-variable function\">estimateSize</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token number\">80</span><span class=\"token punctuation\">,</span>     <span class=\"token comment\">// a guess, corrected on mount</span>\n    overscan<span class=\"token operator\">:</span> <span class=\"token number\">6</span><span class=\"token punctuation\">,</span>\n    <span class=\"token function-variable function\">getItemKey</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">(</span><span class=\"token parameter\">i</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> messages<span class=\"token punctuation\">[</span>i<span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span>id<span class=\"token punctuation\">,</span>   <span class=\"token comment\">// stable id, never the index</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n  <span class=\"token keyword\">return</span> <span class=\"token punctuation\">(</span>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>div</span> <span class=\"token attr-name\">ref</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span>scrollRef<span class=\"token punctuation\">}</span></span> <span class=\"token attr-name\">style</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> overflow<span class=\"token operator\">:</span> <span class=\"token string\">\"auto\"</span><span class=\"token punctuation\">,</span> height<span class=\"token operator\">:</span> <span class=\"token string\">\"100%\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">></span></span><span class=\"token plain-text\">\n      </span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>div</span> <span class=\"token attr-name\">style</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> height<span class=\"token operator\">:</span> virtualizer<span class=\"token punctuation\">.</span><span class=\"token function\">getTotalSize</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span> position<span class=\"token operator\">:</span> <span class=\"token string\">\"relative\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">></span></span><span class=\"token plain-text\">\n        </span><span class=\"token punctuation\">{</span>virtualizer<span class=\"token punctuation\">.</span><span class=\"token function\">getVirtualItems</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">.</span><span class=\"token function\">map</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">row</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span>\n          <span class=\"token operator\">&lt;</span>div\n            key<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span>row<span class=\"token punctuation\">.</span>key<span class=\"token punctuation\">}</span>\n            data<span class=\"token operator\">-</span>index<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span>row<span class=\"token punctuation\">.</span>index<span class=\"token punctuation\">}</span>\n            ref<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span>virtualizer<span class=\"token punctuation\">.</span>measureElement<span class=\"token punctuation\">}</span>   <span class=\"token comment\">// reports real height back</span>\n            style<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span>\n              position<span class=\"token operator\">:</span> <span class=\"token string\">\"absolute\"</span><span class=\"token punctuation\">,</span>\n              top<span class=\"token operator\">:</span> <span class=\"token number\">0</span><span class=\"token punctuation\">,</span>\n              transform<span class=\"token operator\">:</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\">translateY(</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>row<span class=\"token punctuation\">.</span>start<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">px)</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n              width<span class=\"token operator\">:</span> <span class=\"token string\">\"100%\"</span><span class=\"token punctuation\">,</span>\n            <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n          <span class=\"token operator\">></span>\n            <span class=\"token operator\">&lt;</span>Message <span class=\"token punctuation\">{</span><span class=\"token operator\">...</span>messages<span class=\"token punctuation\">[</span>row<span class=\"token punctuation\">.</span>index<span class=\"token punctuation\">]</span><span class=\"token punctuation\">}</span> <span class=\"token operator\">/</span><span class=\"token operator\">></span>\n          <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>div</span><span class=\"token punctuation\">></span></span><span class=\"token plain-text\">\n        ))}\n      </span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>div</span><span class=\"token punctuation\">></span></span>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>div</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Two details in there are load-bearing and easy to miss. The <code class=\"language-text\">getItemKey</code> has to be a stable id you assigned when the message was created, never the array index, for the same reason it mattered for <code class=\"language-text\">memo</code>: index keys make React and the measurement cache line up the wrong row against the wrong height. And you must not put a fixed <code class=\"language-text\">height</code> on a row you are measuring, because a hard-coded height is the thing measurement is supposed to replace; set it and the virtualizer trusts your lie instead of the real layout.</p>\n<h2>Scroll jump, the failure that will actually page you</h2>\n<p>Here is the subtle one, and it is the reason naive hand-rolled virtualization feels broken. When a row <em>above</em> the current viewport turns out to be taller than its estimate, every row below it, including the one the user is looking at, needs to shift down to make room. If you do nothing, the content under the user’s eyes lurches. They were reading a paragraph; now they are reading a different one, because 400 pixels appeared above the fold.</p>\n<p>The fix is scroll anchoring: when you correct the height of something above the viewport, adjust <code class=\"language-text\">scrollTop</code> by the same delta in the same frame, so the visible content stays put while the offsets underneath it change. Browsers do a version of this natively through <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor\"><code class=\"language-text\">overflow-anchor</code></a>, but inside a transformed virtual window you are often fighting it rather than using it, and the good libraries implement their own anchoring. This is the single strongest argument for not writing your own virtualizer for a chat log. The windowing is a weekend; the anchoring is the part that eats a month.</p>\n<p><img src=\"/2363018554c02272dc742b97d9793d26/measure-anchor.svg\" alt=\"A vertical scroll container during a height correction. A message above the viewport was first placed at its estimated height of eighty pixels, drawn as a short dashed box, then measured at its real height of three hundred and twenty pixels, drawn as a taller solid box, adding two hundred and forty pixels. On the left, labelled no anchoring, the arrow shows every row below shoved downward so the paragraph the user was reading jumps out of the viewport. On the right, labelled anchored, scrollTop is increased by the same two hundred and forty pixels in the same frame, so the offsets change underneath but the viewport contents stay exactly where the eye left them. A caption reads: correct the height above the fold and move the scroll by the same delta, or the page lurches.\"></p>\n<h2>Sticking to the bottom while a reply streams</h2>\n<p>Chat has one more twist that ordinary lists do not: the newest content is at the bottom, and it grows. A reply streams in token by token, the last message gets taller every frame, and the view is supposed to follow it down, the way a terminal does. Layer that on top of a virtual window whose last row is being re-measured on every frame, and you have two systems both trying to own <code class=\"language-text\">scrollTop</code> at once.</p>\n<p>The rule that keeps it sane is the same one from the re-render post: only follow the bottom when the user is already at the bottom. If they have scrolled up to re-read something, let them stay there and show a “jump to latest” affordance instead of yanking them down mid-sentence. <a href=\"https://github.com/petyosi/react-virtuoso\">react-virtuoso</a> wraps this in a <code class=\"language-text\">followOutput</code> prop, and the shape of its API is a lesson in itself: you pass a callback that receives <code class=\"language-text\">isAtBottom</code> and returns how to scroll, so the decision is explicit rather than automatic.</p>\n<div class=\"gatsby-highlight\" data-language=\"jsx\"><pre class=\"language-jsx\"><code class=\"language-jsx\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span><span class=\"token class-name\">Virtuoso</span></span>\n  <span class=\"token attr-name\">data</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span>messages<span class=\"token punctuation\">}</span></span>\n  <span class=\"token attr-name\">followOutput</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">isAtBottom</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">(</span>isAtBottom <span class=\"token operator\">?</span> <span class=\"token string\">\"smooth\"</span> <span class=\"token operator\">:</span> <span class=\"token boolean\">false</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">}</span></span>\n  <span class=\"token attr-name\">itemContent</span><span class=\"token script language-javascript\"><span class=\"token script-punctuation punctuation\">=</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">index<span class=\"token punctuation\">,</span> message</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span><span class=\"token class-name\">Message</span></span> <span class=\"token spread\"><span class=\"token punctuation\">{</span><span class=\"token punctuation\">...</span><span class=\"token attr-value\">message</span><span class=\"token punctuation\">}</span></span> <span class=\"token punctuation\">/></span></span><span class=\"token punctuation\">}</span></span>\n<span class=\"token punctuation\">/></span></span></code></pre></div>\n<p>Even this has a sharp edge worth knowing before it bites: when several messages or a burst of tokens land in the same tick, a plain <code class=\"language-text\">followOutput={true}</code> can decide the list is no longer at the bottom and stop following, and the user has to scroll down by hand to re-arm it. The callback form above is the usual workaround. If you would rather not take on a virtualizer’s opinion about scrolling at all, <a href=\"https://www.npmjs.com/package/use-stick-to-bottom\"><code class=\"language-text\">use-stick-to-bottom</code></a> isolates just the stick-to-bottom behaviour as a hook built for streaming AI chat, and you can pair it with whichever windowing library you picked. TanStack Virtual’s own chat example solves it a third way, anchoring the list to the end and adjusting by the size delta.</p>\n<h2>The tradeoff nobody mentions: you broke find-in-page</h2>\n<p>Virtualization has a real cost that has nothing to do with performance, and I wish someone had told me before I shipped it. Off-screen messages are not in the DOM, so anything that walks the DOM looking at the whole conversation no longer works. Browser find (<code class=\"language-text\">Ctrl+F</code>) only matches the dozen messages currently mounted. “Select all and copy the transcript” copies the window, not the chat. A screen reader cannot move through history that is not rendered. For an internal ops tool where people genuinely search their own long sessions, that regression was more annoying than the jank I set out to fix.</p>\n<p>There is a lighter option that keeps the DOM intact, and for a lot of chat UIs it is the right first move. The CSS <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility\"><code class=\"language-text\">content-visibility: auto</code></a> property tells the browser to skip rendering work, layout and paint, for an element that is off screen, while leaving it in the document. Pair it with <code class=\"language-text\">contain-intrinsic-size</code> so the skipped element still reserves roughly the right height and the scrollbar does not twitch:</p>\n<div class=\"gatsby-highlight\" data-language=\"css\"><pre class=\"language-css\"><code class=\"language-css\"><span class=\"token selector\">.message</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token property\">content-visibility</span><span class=\"token punctuation\">:</span> auto<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">contain-intrinsic-size</span><span class=\"token punctuation\">:</span> auto 80px<span class=\"token punctuation\">;</span>   <span class=\"token comment\">/* reserved size when skipped */</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>This cuts the layout and paint cost, which is usually the thing you actually feel, without removing anything from the DOM. <code class=\"language-text\">Ctrl+F</code> still works, copy still works, screen readers still work. What it does not fix is memory: every node is still allocated, so on a truly enormous, long-lived session true windowing still wins. But it is one CSS rule with no measurement, no anchoring, and no scroll wars, and I now reach for it first and only escalate to full virtualization when the node count, not the paint cost, is the proven problem.</p>\n<h2>What I would do differently</h2>\n<p>I virtualized Archi’s chat before I had measured that the DOM was the bottleneck, and I paid for it with a week of scroll-anchoring bugs and a find-in-page regression that a user reported before I noticed. The honest order of operations is: get the state placement and memo boundaries right first, because that is most sessions; then, if long sessions still drag, confirm with the Performance panel that layout and paint, not scripting, are the cost; then try <code class=\"language-text\">content-visibility</code> because it is nearly free and keeps the page honest about accessibility; and only reach for a real virtualizer when the node count itself, memory and mount time, is what is hurting. When you do, use <a href=\"https://github.com/bvaughn/react-window\"><code class=\"language-text\">react-window</code></a>, TanStack Virtual, or react-virtuoso rather than hand-rolling, because the hard parts are measurement and anchoring, not the windowing idea.</p>\n<p>This is the third piece of the same streaming-chat frontend, after <a href=\"/blog/2026-07-13-streaming-markdown-react-llm/\">not re-parsing Markdown you already parsed</a> and <a href=\"/blog/2026-09-18-fix-react-rerenders-streaming-chat/\">not re-rendering components that did not change</a>. The through-line across all three is that a chat UI gets slow in a different way at each scale: first the parser, then the reconciler, then the DOM itself. You fix the one you can measure, in that order, and resist fixing the next one until it actually shows up. A two-thousand-message session can stay as smooth as the three-message demo, but only if you are honest about which cost you are paying before you pay down the wrong one.</p>\n<hr>\n<p><em>Diagrams by M. Hassan Ahmed, released under CC0. No external image was used for this post; the figures are original work by the author.</em></p>","frontmatter":{"title":"Virtualize a Long Chat Transcript in React","date":"2026-11-26T00:00:00.000Z","description":"You memoized every message and the chat still stutters at a thousand entries. Virtualization renders only the rows on screen. How to do it, and what breaks.","thumbnail":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsSAAALEgHS3X78AAAB0UlEQVQoz42Sa2/aMBSG+QHT1IVcfMNOINCGUBJyIQRKaWgg9ALZ1K6jUmk3OqSt3falkzZp0rSfPpsKrV8qTXpk+fK+xz7HpyCD1v9Q1NynyEBQEGd88RwbJ6UhNtqIdjHrYdrTcKSiQJgl4G6pjgRbnFfA5WMRexLyxGRtVqCHcACIr2Bf0yOtFMrIFeai6lB3uNM9pbuJ3smqvRPaTGg4YvHE6Ey4lAs0HBCzX7Ezao9KzbFCAllrCfOLrfrxbLn48P3s4u7u25+rm4c0W6TZ1Ul+u/r8a3A45wIFtgCL9drEsI4qs3d4NiV5Dq2k8LLY4Orb1c+Ly6/Z0fVy9WPx/uF8/uXT/W++oyL/MWdo7FXt3HRya3pdPn6LhhPinPJnu9Qa1Lu5Fc2IlTbC1zuNw6qV2M64XOtLisMT5pUDrINIn03flO9v9OUl/TgH9X6BRzW2E9NOTXtUs8fl7aFRS5i5D0goA2/zVa7Cq4UC4A/QKIPDFKZjrRKLams4hKTN1bDUJnqMaAfRCLP48c1rPFiKEIsBboOS+CR+pCBfmDHr6tUDZh5AEklq80kn/GsSUXB9H7Ee0jl7HAX6m5tpzGOL9J5tMncd1xGoAr75Fy5xbbAGlUQzAAAAAElFTkSuQmCC","aspectRatio":1.899441340782123,"src":"/static/26bd6171b14d1e2b518b7d7ec6e59ff9/40a76/hero.png","srcSet":"/static/26bd6171b14d1e2b518b7d7ec6e59ff9/c972b/hero.png 340w,\n/static/26bd6171b14d1e2b518b7d7ec6e59ff9/27625/hero.png 680w,\n/static/26bd6171b14d1e2b518b7d7ec6e59ff9/40a76/hero.png 1360w,\n/static/26bd6171b14d1e2b518b7d7ec6e59ff9/ed396/hero.png 2000w","sizes":"(max-width: 1360px) 100vw, 1360px"}}}}}},"pageContext":{"slug":"/2026-11-26-virtualize-long-chat-transcript-react/","previous":"blog/2026-11-27-constrained-decoding-structured-outputs/","next":null}},"staticQueryHashes":["32046230"]}