Uh oh!
There was an error while loading. Please reload this page.
perf(frontend): bound logs DOM, kill editor re-render storms, lazy-load heavy deps - #5212
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Logs / Workflow editor — New Realtime —
Reviewed by Cursor Bugbot for commit 4c50a3f. Configure here. |
Uh oh!
There was an error while loading. Please reload this page.
Greptile SummaryFive independent frontend performance optimisations — virtualizing the logs table, narrowing per-block store subscriptions, moving high-frequency presence data out of the socket context, lazy-loading
Confidence Score: 5/5All five changes are backwards-compatible, opt-in or transparently substituted, with no behavioural regressions. Each change is tightly scoped: the virtualizer is gated by an explicit opt-in prop so all six existing ResourceTable consumers are unaffected; the presence store is a direct extraction that preserves the same data contract and lifetime; the per-block subscription is strictly narrower than the original with intentional stubs documented in JSDoc; the NoteBlock lazy load preserves a stable nodeTypes reference; and the Prism lazy load uses a module-level singleton so second mounts do not flash. React 19 is confirmed, making the ref-as-prop pattern in DataRow valid. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "perf(emcn): defer prismjs in Code so it'..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
125d118 to
963e8e2Compare963e8e2 to
79f7995Compare…edit re-render storm
… cursor-frame re-renders
waleedlatif1
commented
Jun 25, 2026
@greptile review |
79f7995 to
4c50a3fComparewaleedlatif1
commented
Jun 25, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4c50a3f. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Five targeted, independently-verified frontend performance fixes — each addresses a measured, user-felt problem in a hot path. No behavior change; all are backwards-compatible.
perf(logs)— virtualize the resource list. The logs page accumulateduseInfiniteQuerypages into an unbounded, unvirtualized DOM (50 → thousands of rows = compounding scroll jank + unbounded memory). Now windowed with@tanstack/react-virtual(table→CSS-grid, exact<colgroup>ratios preserved). Keyboard-nav scroll routes through the virtualizer (scrollToIndex) via an optionalapiRef, so it works even when a row is windowed out. All 6ResourceTableconsumers preserved.perf(editor)— narrow the per-block store subscription. Every mountedWorkflowBlocksubscribed to the wholeblocksmap, so any structural edit (rename, lock/enable, dimension settle, paste) re-rendered every block. NewuseBlockCurrentWorkflowsubscribes tostate.blocks[blockId]only — block B no longer re-renders on a block-A edit (immutable per-block updates keep B's reference stable).perf(realtime)— move presence out of the socket context.presenceUserslived in the memoized socket context value, so every remote cursor frame (many/sec) produced a new context reference and re-rendered the 4k-lineWorkflowContent. Presence moved to a dedicated Zustand store; only<Cursors>/<Avatars>subscribe. Writer-for-writer identical; cleared on unmount to match the prior lifetime.perf(editor)— lazy-loadNoteBlock. Streamdown + remark-breaks shipped to 100% of editor loads via a staticnodeType, even for workflows with no note blocks. Nownext/dynamic(stablenodeTypesmap preserved).perf(emcn)— defer prismjs inCode. prism + 3 side-effectful grammars sat in the@/components/emcnbarrel (379 importers). Split the side-effectful imports intocode/prism.ts, lazy-loaded on first highlight; the two synchronoushighlight/languagesconsumers stay eager via the split module.Type of Change
Testing
Each change was reviewed by a dedicated adversarial auditor (line-by-line vs
origin/staging), then re-reviewed after a keyboard-nav fix the audit caught. Plus/simplify+/cleanup(reuse/simplification/efficiency/altitude + React anti-patterns) over all touched files and surrounding modules.check:zustand-v5/check:client-boundary/check:react-querypass · targeted tests green · fullnext buildgreen.Checklist