Repository navigation
Open
Description
An automated audit read all 384 frontend .tsx and .css files in apps/app, apps/web, packages/shared-ui, and the other UI packages. It looked only for performance problems that hurt Safari on iOS. Tests, stories, and Ladle fixtures were excluded.
This issue tracks all 20 grouped findings. Finding 2 has its own issue: #1615.
Read this first. The audit is automated. Each finding went to a second agent that reopened the file and tried to refute it, but the line numbers and the severity are still a judgement, not a measurement. Spot-check a finding before you start work on it.
The three largest cost patterns
- Unbounded lists. Components map full arrays into scroll surfaces with no virtualization.
- Layout-property animation. Files transition
height,max-height,grid-template-rows,width, orflex-basisinstead oftransform. - Raw modal primitives in compact flows. These violate the drawer rule in
AGENTS.md. WebKit can recalculate styles for the full app tree during a small drawer action.
High severity
- 1. Project selector uses a modal menu instead of the persistent drawer.
apps/app/src/components/pickers/ProjectSelector.tsx:84.DropdownMenureceives the caller value formodal. Callers can omit the value, so Radix uses its modal default. Note: this entry rests on a prop that callers can omit, not on an observed stall. Confirm the caller list before you rank it.
Medium severity
- 2. Large lists create every row inside a small scroll box. 11 files. Tracked separately in Unbounded list rendering in 3 components: CSV preview mounts all 50k cells, WorkspaceChangesList renders every changed file while collapsed, RemotePathBrowser renders every readdir entry #1615.
- 3. Compact action surfaces still use raw modal primitives.
PluginNavSidebarItems.tsx:561, 631-650,project/ProjectActionsMenu.tsx:181, 219,thread/timeline/TimelineSelectionMenu.tsx:9, 202-214. Some paths already use the safe drawer for one branch, but the raw primitive stays mounted. - 4. Layout properties animate during common panel and card changes.
promptbox/FollowUpPromptBox.tsx:766,promptbox/PromptBoxInternal.tsx:2064-2066,promptbox/banner/ThreadGoalCard.tsx:138,promptbox/banner/ThreadTodoCard.tsx:110-113,promptbox/banner/ThreadWorkflowCard.tsx:157-160,ui/disclosure.tsx:175, 302,ui/height-transition.tsx:377,ui/sidebar.tsx:771, 787-788,views/thread-detail/SplitWorkspaceSecondaryPanelHost.tsx:272, 319. - 5. Resize work runs without one frame budget.
promptbox/banner/QueuedMessagesList.tsx:1136-1149. SixResizeObservertargets and a window resize listener all call the same layout measurement. - 6. The terminal keeps 10,000 scrollback rows.
thread/terminal/ThreadTerminalView.tsx:663. Use a smaller mobile limit. - 7. Scroll events write DOM state without frame throttling.
ui/bottom-anchored-scroll-body.tsx:750-771. Use the listener as a sampler and do the work once per animation frame. - 8. Images lack decode and source-size hints.
ui/markdown-preview.tsx:989-996, and lower-risk:git-diff/GitDiffCardBody.tsx:550,secondary-panel/FilePreview.tsx:1011,ui/image-lightbox.tsx:164. Adddecoding="async"and a loading policy. - 9. Quick-create context values change after unrelated renders.
hooks/useQuickCreateProject.tsx:90, 104, 118.useLocalPathPickerreturns a new controller object on each render. - 10. Mobile recents sort every thread before it keeps three.
views/RootComposeMobileRecents.tsx:70-86. Sort in the query layer or use a bounded scan.
Low severity
- 11. Smaller lists create all rows or retain all loaded rows. 8 files, including
onboarding/OnboardingFlow.tsx:447, 481-515,sidebar/SidebarThreadSearchPanel.tsx:151,thread/timeline/ThreadTimelineRows.tsx:1892,ui/truncated-list.tsx:31-41. - 12. Small controls animate layout or paint properties. 18 files, including
ui/theme.css:908, 950, 978, 987,app.css:238, 709-712, 731-747,apps/web/src/landing/landing.css:152-155, 446-449, 1099, 1318, 2217-2248,shared-ui/src/components/ui/tabs.tsx:31. - 13. Synchronous geometry reads run during user actions or layout setup.
git-diff/PierreLineSelectionActions.tsx:144-151,sidebar/SidebarWindowedItems.tsx:194-198,thread/terminal/ThreadTerminalView.tsx:119-130. - 14. Decorative work continues when the user cannot see it.
promptbox/WaveformVisualizer.tsx:134-153,apps/web/src/routes/index.tsx:810, 1278. Add Page Visibility andIntersectionObserverchecks. - 15. Touch and wheel handlers can block native scroll.
secondary-panel/SecondaryPanelTabStrip.tsx:321-323,ui/markdown-mermaid-diagram.tsx:802. Non-passive listeners callpreventDefault. - 16. Diff cards create one observer per card.
secondary-panel/git-diff/DiffFileCard.tsx:346. Share one observer at the panel level. - 17. Message masks can add WebKit surfaces in the timeline.
thread/timeline/ConversationMessageContent.tsx:123-126, 332-334. Collapsed long user messages use a WebKit mask gradient. - 18. Several compact dialogs bypass the persistent drawer or drop content.
settings/InstallCliSkillsDialog.tsx:151,thread/timeline/MessageActionBar.tsx:108, 127, 469-474,apps/web/src/routes/dashboard.tsx:226-234, 865-892,shared-ui/src/components/ui/alert-dialog.tsx:2, 8,shared-ui/src/components/ui/drawer.tsx:3, 16-19,shared-ui/src/components/ui/sheet.tsx:2, 64. - 19. Full-screen surfaces use
100vhor100vw.ui/image-lightbox.tsx:155,apps/web/src/blog/blog.css:270. Use100dvhor100svh. - 20. Carousel context creates a new value on each render.
shared-ui/src/components/ui/carousel.tsx:123. The app has no direct consumer today, so the present impact is low.
Paths above are relative to apps/app/src/ unless the entry gives a different root.
Suggested order
- Add virtualization or a bounded window to the medium-severity lists (Unbounded list rendering in 3 components: CSV preview mounts all 50k cells, WorkspaceChangesList renders every changed file while collapsed, RemotePathBrowser renders every readdir entry #1615).
- Remove layout-property transitions from the prompt, timeline, disclosure, sidebar, and split-panel paths.
- Throttle scroll and resize work with one
requestAnimationFramecallback. - Add async image decode, loading policy, dimensions, and responsive sources.
- Replace raw compact modal paths with the persistent responsive drawer.
- Stabilize the quick-create context and bound the mobile recent-thread sort.
- Lower terminal scrollback on mobile Safari.
- Pause canvas and decorative timers outside the viewport.
- Remove non-passive input handlers where native gestures can work.
- Replace WebKit masks, stale viewport units, and per-card observers after the main fixes.
Related issues
- Unbounded list rendering in 3 components: CSV preview mounts all 50k cells, WorkspaceChangesList renders every changed file while collapsed, RemotePathBrowser renders every readdir entry #1615 covers finding 2.
- Thread timeline never unmounts history: 22k DOM nodes and 250-600ms long tasks after scrolling a large thread #1301 covers thread timeline DOM growth, which overlaps findings 2 and 11.
AGENT GENERATED: by Claude Opus 5
Activity