Skip to content

CodeBlock: Virtualize syntax highlighting for long code submissions#200

Merged
msaroufim merged 2 commits intomainfrom
virtual-side
Feb 25, 2026
Merged

CodeBlock: Virtualize syntax highlighting for long code submissions#200
msaroufim merged 2 commits intomainfrom
virtual-side

Conversation

@Jack-Khuu
Copy link
Collaborator

Long code submissions (>200 lines) in the sidebar now use virtualized rendering via react-window
(i.e. Prism Syntax only renders on code/nodes as they scroll on screen)

  • Short code are unchanged

src/components/codeblock/CodeBlock.tsx — Added a dual-path renderer: code >200 lines uses SyntaxHighlighter's renderer prop to feed tokenized rows into a FixedSizeList; shorter code renders as before.

Screen.Recording.2026-02-24.at.6.26.53.PM.mov

@msaroufim msaroufim temporarily deployed to kernelboard-virtual-sid-782bos February 25, 2026 02:37 Inactive
@msaroufim msaroufim merged commit 22ed83e into main Feb 25, 2026
1 check passed
@msaroufim msaroufim temporarily deployed to kernelboard-virtual-sid-5oanv3 February 25, 2026 21:19 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants