Skip to content

Revert "[codex] Fix renderer stress degradation"#4535

Merged
Kitenite merged 1 commit into
mainfrom
revert-4500-stress-test-degradation
May 14, 2026
Merged

Revert "[codex] Fix renderer stress degradation"#4535
Kitenite merged 1 commit into
mainfrom
revert-4500-stress-test-degradation

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented May 14, 2026

Reverts #4500


Summary by cubic

Reverts the renderer stress tooling and related optimizations. Removes stress scripts and experimental code paths, simplifies terminal/runtime logic, and drops the git.getDiffStats API in favor of existing status calls.

  • Refactors

    • Removed renderer stress scripts and the SUPERSET_RENDERER_STRESS_CDP_PORT dev flag from apps/desktop.
    • Deleted stress-only terminal code (WebGL/image addon controllers, session replay hooks, output backpressure, debug helpers) and use @xterm addons directly.
    • Simplified dashboard/workspace hooks: dropped conditional “enabled” flags and navigation queueing; removed pending workspace store.
    • Reduced browser/tab bar scheduling complexity; removed windowing/layout throttling and extra overflow measurement options.
    • Host service: removed git.getDiffStats and related helpers/tests; simplified PR runtime lifecycle and main workspace ensure logic; use simple-git directly for config writes.
  • Migration

    • Replace any git.getDiffStats calls with git.getStatus (the useDiffStats hook now proxies status).
    • Remove SUPERSET_RENDERER_STRESS_CDP_PORT from local envs.
    • Updated hook signatures (remove “enabled” args): useGitStatus(workspaceId), useHybridSearch(tasks), useOpenInExternalEditor(workspaceId), useChangeset({ workspaceId, ref }), useSidebarDiffRef(workspaceId), useReviewTab({ workspaceId, ... }), useChangesTab({ workspaceId, ... }).
    • Use navigateToV2Workspace(id, navigate) directly; pending navigation state is gone.

Written for commit 127fd18. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • Improvements
    • Enhanced terminal rendering and addon initialization for improved performance
    • Optimized workspace navigation and sidebar behavior
    • Improved tab bar rendering and overflow handling
    • Refined font discovery system in settings
    • Streamlined browser pane layout updates
    • Simplified Git operations and workflow

@Kitenite Kitenite merged commit fcc5676 into main May 14, 2026
10 of 11 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 076ab3fd-152b-455e-ae58-49dbd0f3060d

📥 Commits

Reviewing files that changed from the base of the PR and between 66d1581 and 127fd18.

📒 Files selected for processing (84)
  • apps/desktop/package.json
  • apps/desktop/scripts/prepare-renderer-stress-fixtures.ts
  • apps/desktop/scripts/stress-renderer.ts
  • apps/desktop/src/main/index.ts
  • apps/desktop/src/main/lib/extensions/index.ts
  • apps/desktop/src/renderer/hooks/host-service/useDiffStats/useDiffStats.ts
  • apps/desktop/src/renderer/hooks/host-service/useGitStatus/useGitStatus.ts
  • apps/desktop/src/renderer/index.tsx
  • apps/desktop/src/renderer/lib/posthog.test.ts
  • apps/desktop/src/renderer/lib/posthog.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-addons.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-image-addon-controller.test.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-image-addon-controller.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-parking.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.test.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-session-replay.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-webgl-addon-controller.test.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-webgl-addon-controller.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.test.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHoverCardOverlay/DashboardSidebarHoverCardOverlay.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/DashboardSidebarProjectSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarExpandedProjectContent/DashboardSidebarExpandedProjectContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/SortableWorkspaceItem/SortableWorkspaceItem.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarShortcuts/useDashboardSidebarShortcuts.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/hooks/useHybridSearch/useHybridSearch.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/hooks/useTasksData/useTasksData.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/WorkspaceSidebar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/ChangesFileList.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesSection/ChangesSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/useChangesTab.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useReviewTab/useReviewTab.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useChangeset/useChangeset.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useOpenInExternalEditor/useOpenInExternalEditor.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/usePaneRegistry.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useRendererStressWorkspaceBridge/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useRendererStressWorkspaceBridge/useRendererStressWorkspaceBridge.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useSidebarDiffRef/useSidebarDiffRef.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/FontSettingSection/hooks/useSystemFonts/useSystemFonts.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/hooks/useSplitOrientation/useSplitOrientation.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/v1-terminal-cache.ts
  • apps/desktop/src/renderer/stores/v2-workspace-navigation.ts
  • apps/desktop/src/shared/workspace-run-definition.test.ts
  • apps/desktop/src/shared/workspace-run-definition.ts
  • packages/host-service/src/app.ts
  • packages/host-service/src/runtime/pull-requests/pull-requests.test.ts
  • packages/host-service/src/runtime/pull-requests/pull-requests.ts
  • packages/host-service/src/trpc/router/git/git.ts
  • packages/host-service/src/trpc/router/git/utils/config-write.ts
  • packages/host-service/src/trpc/router/git/utils/git-helpers.test.ts
  • packages/host-service/src/trpc/router/git/utils/git-helpers.ts
  • packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts
  • packages/host-service/src/trpc/router/workspace-creation/shared/adopt-existing-worktree.ts
  • packages/host-service/src/trpc/router/workspace-creation/shared/git-config.ts
  • packages/host-service/src/trpc/router/workspaces/workspaces.ts
  • packages/host-service/test/integration/bug-hunt-3.integration.test.ts
  • packages/host-service/test/integration/git.integration.test.ts
  • packages/host-service/test/integration/workspace-cleanup.integration.test.ts
  • packages/host-service/test/integration/workspace-create-delete.integration.test.ts
  • packages/panes/src/react/components/Workspace/Workspace.tsx
  • packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx
  • packages/panes/src/react/components/Workspace/components/TabBar/components/TabItem/TabItem.tsx
  • packages/panes/src/react/components/Workspace/components/TabBar/utils/index.ts
  • packages/panes/src/react/components/Workspace/components/TabBar/utils/utils.test.ts
  • packages/panes/src/react/components/Workspace/components/TabBar/utils/utils.ts
  • packages/shared/src/host-info.ts
  • packages/ui/src/components/overflow-fade/OverflowFadeContainer/OverflowFadeContainer.tsx
  • packages/ui/src/hooks/use-overflow-fade.ts

📝 Walkthrough

Walkthrough

This PR removes the renderer stress testing infrastructure (scripts, CDP port handling, window bridges), simplifies terminal addon management by removing image/WebGL controllers, eliminates enabled flag parameters from numerous hooks to make them unconditionally observe/compute state, refactors browser and tab rendering to remove scroll throttling and virtualization in favor of immediate layout updates and overflow fading, removes the v2 workspace navigation pending-state store, eliminates the getDiffStats tRPC endpoint in favor of client-side status aggregation, and streamlines pull-request runtime shutdown by removing async stop and background task tracking.

Changes

Renderer Stress Testing Infrastructure Removal

Layer / File(s) Summary
Stress testing scripts and entry points
apps/desktop/package.json, apps/desktop/scripts/stress-renderer.ts, apps/desktop/scripts/prepare-renderer-stress-fixtures.ts
Removes stress:renderer and stress:renderer:fixtures npm scripts and deletes the corresponding stress harness and fixture-preparation scripts that provided CLI-driven stress testing for workspace switching, routing, terminal output, and WebGL context-loss scenarios.
Electron main process stress CDP configuration
apps/desktop/src/main/index.ts, apps/desktop/src/main/lib/extensions/index.ts
Removes SUPERSET_RENDERER_STRESS_CDP_PORT environment variable handling that conditionally enabled Electron's remote-debugging-port switch, and removes the early-return guard in React DevTools extension loading tied to that same variable.
Renderer-side stress bridge and window bindings
apps/desktop/src/renderer/index.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useRendererStressWorkspaceBridge/, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx
Removes the global window.__SUPERSET_RENDERER_STRESS_NAVIGATE__ development-only binding, deletes the useRendererStressWorkspaceBridge hook that exposed terminal/pane stress manipulation and debug info APIs, and removes related workspace-bridge wiring from the page layout.
Terminal stress support APIs and session replay blocking
apps/desktop/src/renderer/lib/terminal/terminal-session-replay.ts, apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.ts
Removes the terminal session-replay blocking API (TERMINAL_SESSION_REPLAY_BLOCK_CLASS, markTerminalSessionReplayBlocked), stress-related methods from the terminal runtime registry (writeForStress, forceWebglContextLossForStress, getStressDebugInfo), and supporting context-loss result types.
PostHog session recording configuration simplification
apps/desktop/src/renderer/lib/posthog.ts, apps/desktop/src/renderer/lib/posthog.test.ts
Removes the exported POSTHOG_SESSION_REPLAY_BLOCK_SELECTOR constant and the buildPostHogInitConfig() helper; PostHog initialization configuration is now inlined in initPostHog() without session-recording/scroll/canvas-related control settings.

Terminal Addon Management Refactoring

Layer / File(s) Summary
Image and WebGL addon controller removal
apps/desktop/src/renderer/lib/terminal/terminal-image-addon-controller.ts, apps/desktop/src/renderer/lib/terminal/terminal-image-addon-controller.test.ts, apps/desktop/src/renderer/lib/terminal/terminal-webgl-addon-controller.ts, apps/desktop/src/renderer/lib/terminal/terminal-webgl-addon-controller.test.ts
Deletes the TerminalImageAddonController and TerminalWebglAddonController factory functions and their test coverage; these abstractions previously managed enable/disable lifecycle and context-loss handling for xterm's image and WebGL renderers.
Addon loading and terminal runtime integration
apps/desktop/src/renderer/lib/terminal/terminal-addons.ts, apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts, apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts
Refactors addon loading to directly construct ImageAddon immediately and defer WebglAddon creation via requestAnimationFrame with persistent fallback to DOM rendering (suggestedRendererType); removes the addon enable/disable callback pattern from TerminalRuntime, leaving only direct addon disposal; removes the TerminalOutputWriter indirection so WebSocket transport writes PTY bytes directly to the xterm instance.
Terminal runtime resize scheduling simplification
apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts
Simplifies resize handling by replacing RAF/schedule-based debouncing with a simpler ResizeObserver + setTimeout debounce model; gates resizing on a new hostIsVisible flag instead of "measured host" logic; removes queued-output buffering and related module constants.
Terminal wrapper and cache updates
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/v1-terminal-cache.ts
Updates createTerminalInWrapper to directly manage image/ligatures/WebGL addons with immediate/deferred/fallback loading instead of using controller functions; removes addon enable/disable methods from the returned wrapper object. Updates CachedTerminal interface to remove addon control methods and simplifies attach/detach logic by removing addon enable/disable calls.
Terminal parking container styling
apps/desktop/src/renderer/lib/terminal/terminal-parking.ts
Adjusts parking container to use full viewport dimensions (100vw/100vh) while positioned off-screen instead of being collapsed/hidden, removing prior strict CSS containment.

Hook Signature Simplification (Removal of enabled Parameters)

Layer / File(s) Summary
Git status and diff stats hooks
apps/desktop/src/renderer/hooks/host-service/useDiffStats/useDiffStats.ts, apps/desktop/src/renderer/hooks/host-service/useGitStatus/useGitStatus.ts
Removes enabled parameter from both hooks; useDiffStats now always queries git.getStatus and computes diff totals internally via useMemo; useGitStatus enables queries solely based on Boolean(workspaceId) and unconditionally registers workspace change-event invalidation.
Changes and review tab configuration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/useChangesTab.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useReviewTab/useReviewTab.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/WorkspaceSidebar.tsx
Removes enabled parameter from useChangesTab and useReviewTab; queries now run unconditionally; sidebar invokes useGitStatus once unconditionally and passes result to useChangesTab rather than conditional branch-based gating.
Changeset, diff-ref, and external editor hooks
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useChangeset/useChangeset.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useSidebarDiffRef/useSidebarDiffRef.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useOpenInExternalEditor/useOpenInExternalEditor.ts
Removes enabled parameters from all three hooks; query enabling now depends solely on derived state (needsStatus, ref.kind, workspaceId) rather than caller-controlled flags.
Task search hook
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/hooks/useHybridSearch/useHybridSearch.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/hooks/useTasksData/useTasksData.tsx
Removes enabled parameter; Fuse indexes are now always constructed via useMemo with dependency on tasks only; search caller no longer gates index creation based on query presence.

Workspace Navigation Store and Router Integration

Layer / File(s) Summary
V2 workspace navigation store removal
apps/desktop/src/renderer/stores/v2-workspace-navigation.ts
Deletes the entire Zustand-based useV2WorkspaceNavigationStore and helper functions (setPendingV2WorkspaceNavigation, clearPendingV2WorkspaceNavigation) that tracked pending workspace navigation state.
Workspace navigation routing simplification
apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.test.ts
Removes in-flight navigation queuing/coalescing machinery; navigateToV2Workspace now directly calls navigate(...) to /v2-workspace/$workspaceId instead of managing pending state, queue, or cancellation; removes resetV2WorkspaceNavigationStateForTesting export and integration test coverage.
Dashboard sidebar workspace selection
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/SortableWorkspaceItem/SortableWorkspaceItem.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/DashboardSidebarProjectSection.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarExpandedProjectContent/DashboardSidebarExpandedProjectContent.tsx
Removes activeWorkspaceId prop threading throughout the sidebar component hierarchy; active workspace is now derived solely from route matching instead of combining route and pending-store state; workspace hover interactions now trigger onHoverCardOpen callbacks instead of passing workspace id through parent props.
Workspace item actions and selection
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts
Removes isActive and onWorkspaceHover props from DashboardSidebarWorkspaceItem; useDashboardSidebarWorkspaceItemActions now derives isActive from route matching and wires click navigation using useNavigate; workspace items are exported as plain functions instead of memo-wrapped.
Workspace list and shortcuts
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarShortcuts/useDashboardSidebarShortcuts.ts
Removes useV2WorkspaceNavigationStore usage; selected workspace and prev/next navigation now depend solely on route matching (useMatchRoute) instead of pending store state; navigation calls are simplified to direct navigateToV2Workspace(...) without void discard.
V2 workspace layout and page
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx
Tightens the "not-found" early-return condition to require both isReady and workspaces; removes WorkspaceProvider key to change remount behavior across workspace transitions; removes browser-runtime detach cleanup and renderer-stress bridge hook integration from the page.

Browser Pane and Tab Bar UI Optimization

Layer / File(s) Summary
Browser pane layout registry modernization
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.ts
Removes layout throttling/coalescing machinery and pending-layout tracking; updateLayout now applies webview position/size styles immediately from placeholder.getBoundingClientRect() in both the resize handler and attach() path; eliminates the lastLayoutRect per-entry state used for change detection.
Terminal pane and pane registry cleanup
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/usePaneRegistry.tsx
Removes memo wrapper from TerminalPane export; deletes the effect that focused the terminal when active; removes browserRuntimeRegistry.destroy call from onAfterClose, delegating destruction to useGlobalBrowserLifecycle.
Tab bar virtualization removal and overflow fade adoption
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx, packages/panes/src/react/components/Workspace/components/TabBar/utils/utils.ts, packages/panes/src/react/components/Workspace/components/TabBar/utils/utils.test.ts
Removes scroll-metrics-based tab windowing (getVisibleTabWindow, TAB_WINDOWING_THRESHOLD, TAB_WINDOW_OVERSCAN); replaces with OverflowFadeContainer that measures horizontal overflow via callback and renders all tabs inline; keeps TAB_WIDTH and computeInsertIndex for drag insertion; removes scroll-syncing and visibility-window computation logic.
Tab item and overflow rendering
packages/panes/src/react/components/Workspace/components/TabBar/components/TabItem/TabItem.tsx
Removes memo wrapper; switches tab title rendering from plain truncated <span> to OverflowFadeText for fade effect; exports as a plain function component.

Changes Sidebar Virtualization and Collapsible Refactoring

Layer / File(s) Summary
Changes folder view virtualization removal
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesFoldersView/ChangesFoldersView.tsx
Removes TanStack react-virtual usage; eliminates virtualized row construction and the useVirtualizer hook; replaces with direct iteration of groups, rendering each folder's header and conditionally rendering its file children inline when expanded.
Changes section collapsible component refactoring
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesSection/ChangesSection.tsx
Replaces manual <section> + <button> collapsible pattern with @superset/ui/collapsible components (<Collapsible>, <CollapsibleTrigger>, <CollapsibleContent>); removes useId-based content linking.
Changes file list and hover card interactions
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/ChangesFileList.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHoverCardOverlay/DashboardSidebarHoverCardOverlay.tsx
Removes data-changes-file-list-scroll="true" attribute; removes enabled option from useDiffStats call in hover-card overlay so diff stats are always computed when overlay renders.

Pull Request Runtime and Git Query Simplification

Layer / File(s) Summary
Pull request runtime lifecycle
packages/host-service/src/runtime/pull-requests/pull-requests.ts, packages/host-service/src/runtime/pull-requests/pull-requests.test.ts, packages/host-service/src/app.ts
Changes PullRequestRuntimeManager.stop() from async to synchronous; removes background-task tracking machinery and in-flight work draining; updates start() to directly call workspace sync/refresh methods via void instead of runBackgroundTask; removes stopped-check guards from sync/refresh methods; updates dispose to not await pullRequestRuntime.stop() and removes filesystem.close() call.
Git diff stats endpoint removal
packages/host-service/src/trpc/router/git/git.ts, packages/host-service/test/integration/git.integration.test.ts
Removes the getDiffStats tRPC query endpoint that previously computed per-path additions/deletions from git diff --numstat output; removes supporting diff-stats aggregation helpers.
Git numstat parsing refactoring
packages/host-service/src/trpc/router/git/utils/git-helpers.ts, packages/host-service/src/trpc/router/git/utils/git-helpers.test.ts
Refactors parseNumstat to parse NUL-delimited git diff --numstat -z output directly instead of using a separate parseNumstatRecords function; keeps rename/copy record handling with dual path-mapping.
Git config write simplification
packages/host-service/src/trpc/router/git/utils/config-write.ts, packages/host-service/src/trpc/router/workspace-creation/shared/git-config.ts, packages/host-service/src/trpc/router/workspaces/workspaces.ts, packages/host-service/src/trpc/router/workspace-creation/shared/adopt-existing-worktree.ts
Removes the local GitConfigWriter interface; updates gitConfigWrite to accept SimpleGit directly; replaces some gitConfigWrite call sites in workspace creation with direct git.raw(...) invocations for setting config values.

Workspace Run Definition Type Tightening

Layer / File(s) Summary
Workspace run preset and command typing
apps/desktop/src/shared/workspace-run-definition.ts, apps/desktop/src/shared/workspace-run-definition.test.ts
Changes WorkspaceRunPresetLike.commands type from unknown[] to string[]; removes runtime type guards in nonEmptyCommands since commands are now typed as strings; tightens function parameter types for configRunToWorkspaceRun and selectWorkspaceRunDefinition; removes test cases validating non-string command filtering.

Miscellaneous Optimizations and Cleanups

Layer / File(s) Summary
Overflow fade container and hook
packages/ui/src/components/overflow-fade/OverflowFadeContainer/OverflowFadeContainer.tsx, packages/ui/src/hooks/use-overflow-fade.ts
Removes measureKey prop/option from both the component and hook; simplifies overflow measurement by removing RAF throttling and associated frameIdRef tracking; updates effect dependencies and cleanup.
System font discovery
apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/FontSettingSection/hooks/useSystemFonts/useSystemFonts.ts
Removes incremental/batched font discovery with idle/yielding; replaces with synchronous single-pass loader that awaits document.fonts.ready, adds registered/well-known fonts, optionally calls window.queryLocalFonts(), and reclassifies fonts via isMonospaceByMeasurement check.
Split orientation hook
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/hooks/useSplitOrientation/useSplitOrientation.ts
Simplifies ResizeObserver callback to directly read container.getBoundingClientRect() and update orientation instead of deriving from entry contentRect.
Pane workspace cleanup
packages/panes/src/react/components/Workspace/Workspace.tsx
Removes try/catch wrapper around onAfterClose callback invocation so exceptions are no longer handled locally.
Host machine ID timeout removal
packages/shared/src/host-info.ts
Removes MACHINE_ID_COMMAND_TIMEOUT_MS constant and stops passing timeout option to execFileSync for macOS (ioreg) and Windows (reg) machine-ID commands.
Integration test cleanup
packages/host-service/test/integration/bug-hunt-3.integration.test.ts, packages/host-service/test/integration/workspace-cleanup.integration.test.ts, packages/host-service/test/integration/workspace-create-delete.integration.test.ts
Updates concurrency regression test to use Promise.allSettled instead of console.warn interception; removes concurrent workspace destruction test; removes concurrent create/destroy churn test.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • superset-sh/superset#4500: Adds the renderer stress harness, bridge hook, and terminal stress APIs that this PR removes; both are directly inverse operations on the same stress-testing infrastructure.
  • superset-sh/superset#3320: Integrates useGitStatus for v2 file-tree decorations; this PR's refactoring of useGitStatus to remove enabled parameters and always subscribe affects how that integration operates.
  • superset-sh/superset#4442: Builds on the Changes sidebar's folder rendering refactoring (removing virtualization) to add a new Tree view mode; this PR's removal of react-virtual from ChangesFoldersView is a prerequisite change.

Poem

A rabbit hops through code so neat,
Old stress tests fade, now life's complete,
Virtual scrolls are gone today,
Simpler flows light up the way,
No pending states, no queues to keep,
Just direct paths through the deep! 🐰✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-4500-stress-test-degradation

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 14, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 14, 2026

Greptile Summary

This PR reverts #4500 ("[codex] Fix renderer stress degradation"), removing approximately 6,700 lines of changes across 84 files and restoring the pre-#4500 baseline.

  • Removes all renderer stress-test tooling (prepare-renderer-stress-fixtures.ts, stress-renderer.ts, useRendererStressWorkspaceBridge.ts) and the corresponding main-process IPC bridge.
  • Reverts terminal optimizations: output chunking/queuing, WebGL context-loss recovery, RAF-coordinated focus, and session-replay blocking; also removes tab-bar virtual windowing and active-tab auto-scroll logic.
  • Reverts backend improvements: gitConfigWrite retry helper, parseNumstatRecords single-path rename fix, and ensureMainWorkspaceStrict in-flight deduplication.

Confidence Score: 4/5

Safe to merge as an intentional rollback; all behavioural changes are deliberate restorations of pre-#4500 code

The revert is clean and mechanically correct. Three behaviours that #4500 specifically addressed are now absent again: the active tab will not scroll into view when the tab bar overflows; concurrent project-creation requests can race on ensureMainWorkspaceStrict and surface a constraint-rejection error; and in-flight pull-request sync tasks are not drained before the SQLite handle is closed. None of these were new breakage introduced accidentally — they are the known pre-#4500 state — but they are worth tracking as follow-on work.

TabBar.tsx (missing active-tab scroll-into-view), ensure-main-workspace.ts (concurrent call race), app.ts (fire-and-forget stop on shutdown)

Important Files Changed

Filename Overview
apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts Removes output-queuing, WebGL/image addon lifecycle management, and RAF-deferred terminal disposal; restores direct terminal.dispose() and simpler resize scheduler
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx Removes virtual tab windowing and active-tab auto-scroll; replaces scroll-metrics tracking with OverflowFadeContainer — active tab no longer scrolls into view when tab bar overflows
packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts Removes in-flight request deduplication map for concurrent ensureMainWorkspaceStrict calls; a DB unique index on (projectId, hostId) still prevents actual duplicates
packages/host-service/src/app.ts Removes await from pullRequestRuntime.stop() and removes filesystem.close() call during shutdown; background tasks are no longer drained before process exit
packages/host-service/src/runtime/pull-requests/pull-requests.ts Reverts stop() to synchronous, removing backgroundTasks tracking and drainInFlightWork; in-flight sync tasks are no longer awaited on shutdown

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["PR #4500 Changes Being Reverted"] --> B["Stress Testing Tooling"]
    A --> C["Terminal Optimizations"]
    A --> D["Tab Bar"]
    A --> E["Backend Infrastructure"]
    B --> B1["stress-renderer.ts removed"]
    B --> B2["useRendererStressWorkspaceBridge.ts removed"]
    C --> C1["Output queuing removed"]
    C --> C2["WebGL context-loss recovery removed"]
    D --> D1["Virtual tab windowing removed"]
    D --> D2["Active tab auto-scroll removed"]
    E --> E1["gitConfigWrite retry removed"]
    E --> E2["ensureMainWorkspace dedup removed"]
    E --> E3["PullRequestRuntime drain removed"]
Loading

Comments Outside Diff (1)

  1. packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts, line 57-80 (link)

    P2 Concurrent calls to ensureMainWorkspaceStrict can now race

    The mainWorkspaceEnsuresInFlight deduplication map from [codex] Fix renderer stress degradation #4500 is removed. If two requests for the same (projectId, repoPath) reach ensureMainWorkspaceStrict concurrently (e.g. the startup sweep and a user-triggered project-creation handler both firing), both will pass the "does a main workspace exist?" check before either commits, and both will call ctx.api.v2Workspace.create.mutate. The DB unique index on (projectId, hostId) WHERE type='main' will reject the second insert, surfacing an unhandled error from ensureMainWorkspaceStrict (the strict variant does not swallow errors). The non-strict wrapper ensureMainWorkspace will catch it and log a warning, but any caller that relied on ensureMainWorkspaceStrict succeeding (e.g. the project-creation saga in handlers.ts) will receive an unexpected rejection.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts
    Line: 57-80
    
    Comment:
    **Concurrent calls to `ensureMainWorkspaceStrict` can now race**
    
    The `mainWorkspaceEnsuresInFlight` deduplication map from #4500 is removed. If two requests for the same `(projectId, repoPath)` reach `ensureMainWorkspaceStrict` concurrently (e.g. the startup sweep and a user-triggered project-creation handler both firing), both will pass the "does a main workspace exist?" check before either commits, and both will call `ctx.api.v2Workspace.create.mutate`. The DB unique index on `(projectId, hostId) WHERE type='main'` will reject the second insert, surfacing an unhandled error from `ensureMainWorkspaceStrict` (the strict variant does not swallow errors). The non-strict wrapper `ensureMainWorkspace` will catch it and log a warning, but any caller that relied on `ensureMainWorkspaceStrict` succeeding (e.g. the project-creation saga in `handlers.ts`) will receive an unexpected rejection.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx:189-230
**Active tab no longer scrolls into view on overflow**

The revert removes the `useLayoutEffect` that computed `nextScrollLeft` and imperatively set `scrollContainerRef.current.scrollLeft` whenever `activeTabIndex` changed. With `OverflowFadeContainer`, the tab list is a regular flex row with native `overflow-x: auto`, so the active tab stays at whatever scroll position it already occupies. If a user has 12+ tabs and switches to one that is off-screen (e.g. via keyboard shortcut or programmatic tab selection), the newly active tab will not scroll into view — users will see an empty-looking area with no visible selection indicator until they scroll manually.

### Issue 2 of 3
packages/host-service/src/app.ts:215-220
**`pullRequestRuntime.stop()` is now fire-and-forget on shutdown**

Before #4500, `stop()` was synchronous (no background tasks to drain). The reverted `PullRequestRuntimeManager.stop()` still clears timers and the git-watcher subscription synchronously, so new events stop arriving — but any `syncWorkspaceBranches` or `refreshEligibleProjects` coroutines already in flight (`void`-dispatched) will continue running against the database after the shutdown sequence moves on to the next cleanup step. If those tasks write rows while `ownsDb` teardown is in progress there is a window for a write-after-close error on the SQLite handle.

### Issue 3 of 3
packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts:57-80
**Concurrent calls to `ensureMainWorkspaceStrict` can now race**

The `mainWorkspaceEnsuresInFlight` deduplication map from #4500 is removed. If two requests for the same `(projectId, repoPath)` reach `ensureMainWorkspaceStrict` concurrently (e.g. the startup sweep and a user-triggered project-creation handler both firing), both will pass the "does a main workspace exist?" check before either commits, and both will call `ctx.api.v2Workspace.create.mutate`. The DB unique index on `(projectId, hostId) WHERE type='main'` will reject the second insert, surfacing an unhandled error from `ensureMainWorkspaceStrict` (the strict variant does not swallow errors). The non-strict wrapper `ensureMainWorkspace` will catch it and log a warning, but any caller that relied on `ensureMainWorkspaceStrict` succeeding (e.g. the project-creation saga in `handlers.ts`) will receive an unexpected rejection.

Reviews (1): Last reviewed commit: "Revert "[codex] Fix renderer stress degr..." | Re-trigger Greptile

Comment on lines 189 to 230
@@ -363,15 +224,12 @@ export function TabBar<TData>({
/>
)}
{!hasHorizontalOverflow && (
<div
className="absolute top-0 flex h-full w-10 items-center justify-center"
style={{ left: totalTabsWidth }}
>
<div className="flex h-full w-10 shrink-0 items-center justify-center">
<AddTabButton renderAddTabMenu={renderAddTabMenu} />
</div>
)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Active tab no longer scrolls into view on overflow

The revert removes the useLayoutEffect that computed nextScrollLeft and imperatively set scrollContainerRef.current.scrollLeft whenever activeTabIndex changed. With OverflowFadeContainer, the tab list is a regular flex row with native overflow-x: auto, so the active tab stays at whatever scroll position it already occupies. If a user has 12+ tabs and switches to one that is off-screen (e.g. via keyboard shortcut or programmatic tab selection), the newly active tab will not scroll into view — users will see an empty-looking area with no visible selection indicator until they scroll manually.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx
Line: 189-230

Comment:
**Active tab no longer scrolls into view on overflow**

The revert removes the `useLayoutEffect` that computed `nextScrollLeft` and imperatively set `scrollContainerRef.current.scrollLeft` whenever `activeTabIndex` changed. With `OverflowFadeContainer`, the tab list is a regular flex row with native `overflow-x: auto`, so the active tab stays at whatever scroll position it already occupies. If a user has 12+ tabs and switches to one that is off-screen (e.g. via keyboard shortcut or programmatic tab selection), the newly active tab will not scroll into view — users will see an empty-looking area with no visible selection indicator until they scroll manually.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 215 to 220
console.warn("[host-service] revokeAllSessions failed:", err);
}
try {
await pullRequestRuntime.stop();
pullRequestRuntime.stop();
} catch (err) {
console.warn("[host-service] pullRequestRuntime.stop failed:", err);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 pullRequestRuntime.stop() is now fire-and-forget on shutdown

Before #4500, stop() was synchronous (no background tasks to drain). The reverted PullRequestRuntimeManager.stop() still clears timers and the git-watcher subscription synchronously, so new events stop arriving — but any syncWorkspaceBranches or refreshEligibleProjects coroutines already in flight (void-dispatched) will continue running against the database after the shutdown sequence moves on to the next cleanup step. If those tasks write rows while ownsDb teardown is in progress there is a window for a write-after-close error on the SQLite handle.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/host-service/src/app.ts
Line: 215-220

Comment:
**`pullRequestRuntime.stop()` is now fire-and-forget on shutdown**

Before #4500, `stop()` was synchronous (no background tasks to drain). The reverted `PullRequestRuntimeManager.stop()` still clears timers and the git-watcher subscription synchronously, so new events stop arriving — but any `syncWorkspaceBranches` or `refreshEligibleProjects` coroutines already in flight (`void`-dispatched) will continue running against the database after the shutdown sequence moves on to the next cleanup step. If those tasks write rows while `ownsDb` teardown is in progress there is a window for a write-after-close error on the SQLite handle.

How can I resolve this? If you propose a fix, please make it concise.

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.

1 participant