diff --git a/docs/reference/react-performance-audit.md b/docs/reference/react-performance-audit.md index f6c26dde9..3fb1324c4 100644 --- a/docs/reference/react-performance-audit.md +++ b/docs/reference/react-performance-audit.md @@ -47,14 +47,14 @@ Initial inventory: ## Coverage Ledger -Current count after low-risk PRs #3038, #3041, #3042, #3044, #3051, #3052, #3053, #3054, #3055, #3056, #3058, #3059, #3060, #3062, #3063, #3064, #3065, #3066, #3067, #3068, #3069, #3083, #3087, #3091, #3100, #3104, #3122, #3160, #3164, #3166, #3223, and #3244: 920 Effect hook call sites. +Current count after low-risk PRs #3038, #3041, #3042, #3044, #3051, #3052, #3053, #3054, #3055, #3056, #3058, #3059, #3060, #3062, #3063, #3064, #3065, #3066, #3067, #3068, #3069, #3083, #3087, #3091, #3100, #3104, #3122, #3160, #3164, #3166, #3223, #3244, and #3271: 916 Effect hook call sites. -Open medium-risk PRs #3070, #3073, #3077, #3089, #3093, #3102, #3108, #3110, #3112, #3118, #3124, #3126, #3128, #3130, #3132, #3134, #3142, #3144, #3146, #3148, #3150, #3152, #3154, #3170, #3176, #3184, #3186, #3188, #3192, #3195, #3198, #3200, #3202, #3206, #3218, #3220, #3226, #3228, #3234, #3240, #3242, #3247, #3257, and #3269 each project to 919 Effect hook call sites on the current merged baseline; open medium-risk PRs #3097, #3106, #3116, #3120, #3136, #3138, #3180, #3210, #3214, #3238, #3255, and #3261 each project to 918; open medium-risk PRs #3114, #3168, and #3259 each project to 917; open medium-risk PRs #3095, #3140, and #3230 each project to 916; open medium-risk PR #3079 projects to 910; open high-risk PRs #3157, #3212, and #3253 each project to 919; open high-risk PR #3267 projects to 918; open high-risk PR #3075 projects to 916; open high-risk PR #3250 projects to 915; and open high-risk PR #3081 projects to 912. These are not counted in the merged baseline until reviewed and merged. +Open medium-risk PRs #3070, #3073, #3077, #3089, #3093, #3102, #3108, #3110, #3112, #3118, #3124, #3126, #3128, #3130, #3132, #3134, #3142, #3144, #3146, #3148, #3150, #3152, #3154, #3170, #3176, #3184, #3186, #3188, #3192, #3195, #3198, #3200, #3202, #3206, #3218, #3220, #3226, #3228, #3234, #3240, #3242, #3247, #3257, and #3269 each project to 915 Effect hook call sites on the current merged baseline; open medium-risk PRs #3097, #3106, #3116, #3120, #3136, #3138, #3180, #3210, #3214, #3238, #3255, and #3261 each project to 914; open medium-risk PRs #3114, #3168, and #3259 each project to 913; open medium-risk PRs #3095, #3140, and #3230 each project to 912; open medium-risk PR #3079 projects to 906; open high-risk PRs #3157, #3212, and #3253 each project to 915; open high-risk PR #3267 projects to 914; open high-risk PR #3075 projects to 912; open high-risk PR #3250 projects to 911; and open high-risk PR #3081 projects to 908. These are not counted in the merged baseline until reviewed and merged. | Area | Files / signal | Scan status | Notes | | ------------------------------ | -------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | Renderer app shell | `src/renderer/src/App.tsx`, root components | Inventory complete, manual review in progress | Confirmation dialog active request mirror covered by #3091; onboarding settings detour reset covered by #3122; quick workspace agent selection repair covered by #3148; Cmd+J selection repair covered by #3164; smart workspace command highlight covered by #3192; App lazy-modal mount bookkeeping covered by #3220. Continue checking global listeners, beforeunload, media-query, and active-tab repair. | -| Terminal / PTY | `components/Terminal.tsx`, `components/terminal-pane/**`, `components/terminal/**` | Inventory complete, manual review pending | Mobile driver overlay collapse repair covered by #3170; floating workspace first-open bounds normalization covered by #3269. High-risk area: xterm lifecycle, scrollback, remote/mobile parity, focus, WebGL, resize. | +| Terminal / PTY | `components/Terminal.tsx`, `components/terminal-pane/**`, `components/terminal/**` | Inventory complete, manual review pending | Mobile driver overlay collapse repair covered by #3170; floating workspace first-open bounds normalization covered by #3269; unused legacy terminal shell/shortcut/hook files deleted by #3271. High-risk area: xterm lifecycle, scrollback, remote/mobile parity, focus, WebGL, resize. | | Renderer mobile page | `components/mobile/**` | Inventory complete, manual review in progress | Mobile pairing page stage repair covered by #3180. Continue checking QR generation, mobile-page IPC, and paired-device polling. | | Browser pane | `components/browser-pane/**` | Inventory complete, manual review in progress | Highest Effect density: 62 sites in `BrowserPane.tsx`. Browser ref mirrors covered by #3081; continue with driver sync, address bar derived state, find state, webview lifetime. | | Editor / markdown / Monaco | `components/editor/**` | Inventory complete, manual review in progress | Untitled rename reset covered by #3083; copy feedback timers covered by #3097; combined diff local state repairs covered by #3120; combined diff note-copy timer covered by #3218; DiffViewer first-diff auto-scroll reset covered by #3257. Check editor model cleanup, preview scroll restore, search debounce, generated decorations. | @@ -80,7 +80,7 @@ These are candidate batches, not final conclusions. Each item needs code inspect | PR A | Small controlled-input resets | Extra render pass from Effects that mirror one prop into local draft state. | `BrowserAddressBar.tsx` covered by #3038; continue with `BrowserFind.tsx`, `PdfFind.tsx`, selected settings draft fields | Low to medium | | PR B | Settings draft hydration | Multiple independent Effects mirror persisted settings into draft state. | `components/settings/**` | Medium | | PR C | Browser pane Effect cluster | Large Effect cluster may mix external webview sync, derived UI state, and event-specific state repair. | `BrowserPane.tsx`, `useGrabMode.ts`, browser tabs | High | -| PR D | Terminal tab repair and lifecycle | Effects repair active terminal/browser tab state after render; could cause extra render and focus churn. | `Terminal.tsx`, `useTerminalTabs.ts`, `TerminalPane.tsx` | High | +| PR D | Terminal tab repair and lifecycle | Effects repair active terminal/browser tab state after render; could cause extra render and focus churn. | `Terminal.tsx`, `TerminalPane.tsx` | High | | PR E | Right-sidebar polling and source-control state repair | PR checks, branch snapshots, file explorer watch/reveal may repeat work after unrelated state changes. | `ChecksPanel.tsx`, `SourceControl.tsx`, `useGitStatusPolling.ts`, file explorer hooks | High | | PR F | Mobile route monoliths | Mobile task/session routes have many chained Effects and timer/refetch patterns. | `mobile/app/h/[hostId]/tasks.tsx`, `mobile/app/h/[hostId]/session/[worktreeId].tsx` | High | | PR G | Mobile shared components | Visible/open Effects reset modal/drawer state and browser address state. | `mobile/src/components/**`, `mobile/src/browser/MobileBrowserPane.tsx` | Medium | @@ -187,6 +187,7 @@ These are candidate batches, not final conclusions. Each item needs code inspect | PR DD | Mobile Tasks workspace agent selection | The workspace-create drawer repaired automatic and unavailable agent choices in passive Effects after settings or SSH/local detection changed. | `mobile/app/h/[hostId]/tasks.tsx`, `workspace-agent-selection.ts` covered by #3261 | Medium | | PR DE | Sidebar SSH reconnect prompts | Active sidebar worktree and nested lineage-child reconnect prompts opened from passive Effects after disconnected SSH state rendered. | `WorktreeCard.tsx`, `WorktreeList.tsx` covered by #3267 | High | | PR DF | Floating workspace first-open bounds | Floating workspace panel normalized first-open bounds in a passive Effect after the initial hidden/open commit. | `FloatingTerminalPanel.tsx` covered by #3269 | Medium | +| PR DG | Unused terminal shell hooks | Four React Effect call sites lived only in unused terminal shell/shortcut/hook files. | `TerminalShell.tsx`, `useTerminalShortcuts.ts`, `useTerminalTabs.ts` covered by #3271 | Low | ## Merge Risk Scale @@ -302,6 +303,7 @@ These are candidate batches, not final conclusions. Each item needs code inspect | #3261 | `nwparker/react-perf-mobile-task-agent-selection` | Mobile Tasks workspace-create agent selection resolves before commit | Medium | Open | `pnpm exec oxlint mobile/app/h/[hostId]/tasks.tsx mobile/src/tasks/workspace-agent-selection.ts mobile/src/tasks/workspace-agent-selection.test.ts`; `pnpm run typecheck:web`; `git diff --check origin/main...HEAD`; `git diff --check`; direct `pnpm exec tsx -e` assertions for workspace-agent selection; AST Effect count 920 -> 918. Mobile Vitest blocked by missing `expo/tsconfig.base` in this checkout. | | #3267 | `nwparker/react-perf-sidebar-ssh-reconnect-prompt` | Sidebar SSH reconnect prompts resolve before commit | High | Open | `pnpm exec oxlint src/renderer/src/components/sidebar/WorktreeCard.tsx src/renderer/src/components/sidebar/WorktreeList.tsx`; `pnpm run typecheck:web`; `git diff --check origin/main...HEAD`; `git diff --check`; AST Effect count 920 -> 918. | | #3269 | `nwparker/react-perf-floating-terminal-bounds` | Floating workspace first-open bounds normalize before commit | Medium | Open | `pnpm exec oxlint src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsx`; `pnpm run typecheck:web`; `git diff --check origin/main...HEAD`; `git diff --check`; AST Effect count 920 -> 919. | +| #3271 | `nwparker/react-perf-dead-terminal-shell` | Unused terminal shell/shortcut/hook modules removed | Low | Merged | `pnpm exec oxlint src/renderer/src/components/terminal`; `pnpm run typecheck:web`; `git diff --check`; AST Effect count 920 -> 916. | ## Reproduction Commands