Repository navigation
fix(web): stop highlighter freezes and worker spin by using the Oniguruma WASM engine - #8360
UI Consistency: All clear
All clear
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.
Verified at head 6384d96: every @pierre/diffs highlighter creation site in apps/web/src now passes PREFERRED_HIGHLIGHTER — syntaxHighlighting.ts (shared highlighter), DiffWorkerPoolProvider.tsx, DiffPanel.tsx, PullRequestCodeTab.tsx, FilePreviewPanel.tsx (both surfaces), MessagesTimeline.tsx, and SettingsFontPreviews.tsx (the SSR preloadPatchFile path previously flagged, fixed in this revision). Remaining web consumers (HighlightedSearchLine.tsx, ChatMarkdown.tsx) route through getSyntaxHighlighterPromise, and AnnotatableCodeView/StyledDiffCodeView forward options from the updated call sites, so no site can win the first-caller-wins race with the JS regex engine. No styling, primitive, theme-variant, scroll/mask, or environment-routing behavior is changed by the patch.
🔍 Agent activity — 8 tool calls
💭 Good, it looks like that issue was already fixed in the current diff with SettingsFontPreviews.tsx now passing preferredHighlighter. I want to verify the current head state and search the repo for other call sites using preferredHighlighter or createHighlighter.
1. git_tools — preferredHighlighter
2. browse_code — apps/web/src/lib/syntaxHighlighting.ts
💭 With that resolved, I should check for other creation sites not yet covered—other places calling getSharedHighlighter, or DiffFile and other renderers that might create their own highlighter instance. I'll search for other options-passing locations like preloadPatchFile, DiffHunksRenderer, and createHighlighter/shiki calls.
3. git_tools — getSharedHighlighter|createHighlighter|preloadPatchFile|shiki
💭 Since only the web app is in scope and creation sites now pass the preferred highlighter, I want to check other places in apps/web using highlighterOptions or rendering diff components without that setting, like Pierre diff panels elsewhere in the app.
4. git_tools — @pierre/diffs
5. git_tools — c626afc..6384d96
💭 I should also check other components rendering Pierre diff surfaces, like AnnotatableCodeView and StyledDiffCodeView, to see how they handle options objects and highlighter creation.
6. git_tools — highlighter|options=|CodeViewOptions|FileOptions
💭 I'm tracing where preferredHighlighter options flow through—DiffPanel and PullRequestCodeTab already pass it, HighlightedSearchLine and ChatMarkdown use getSyntaxHighlighterPromise correctly. I still need to check other worker pool usages in apps/web, especially whether the Editor component from @pierre/diffs accepts a highlighter option.
7. git_tools — resolveDiffThemeName(
💭 I'm checking where diffThemeName is referenced in ChatMarkdown around line 2092, likely tied to a diff render options object that specifies the theme.
8. git_tools — diffThemeName
💭 I'm noting that SuspenseShikiCodeBlock already relies on the correct highlighter promise, so that part checks out. Beyond that, I'm weighing whether switching from shiki-js to shiki-wasm across the worker pool raises consistency issues, particularly whether the diff worker actually supports loading the wasm engine, though that seems like a separate concern. I don't think the tests need extra verification, and since I can't confirm the shiki-wasm type value against the actual package, I'll trust the author's claim that typechecking passes. With the earlier issue resolved and nothing new surfacing, I'll produce a minimal response indicating everything looks clean, and I won't take any extra action like resolving the prior thread since that wasn't requested.
Agent Credits: 59 credits
Token usage: 14 uncached input · 251,465 cache-read input · 55,891 cache-write input · 3,123 output
Agent Credits may also include non-token charges from external tools such as web research.