diff --git a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift index f6ac216..e5f3b16 100644 --- a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift +++ b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift @@ -651,6 +651,12 @@ struct TranscriptList: View { // so it sits over the composer instead of behind the floating bar; a tap bumps this // same request, and following resumes once the geometry reader sees the bottom. .onChange(of: scrollToBottomRequest) { scrollToEnd(proxy) } + // Warm the Markdown parse caches off the main thread whenever the row set grows — + // `initial: true` fires it for the batch that lands on open (the expensive case), and + // each later new row tops it up. Keyed on the row *count*, so streaming deltas into an + // existing row (which don't change the count) never re-arm it. `items.count` is O(1). + .onChange(of: items.count, initial: true) { _, _ in prewarmMarkdown() } + .onDisappear { prewarmTask?.cancel() } } }