Skip to content

Revert "Reapply renderer stress fixes without terminal sizing regression"#4566

Merged
Kitenite merged 1 commit into
mainfrom
revert-4541-accurate-tuesday
May 14, 2026
Merged

Revert "Reapply renderer stress fixes without terminal sizing regression"#4566
Kitenite merged 1 commit into
mainfrom
revert-4541-accurate-tuesday

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented May 14, 2026

Reverts #4541


Summary by cubic

Reverts the renderer stress tooling and related experimental paths to simplify the desktop app. Removes CDP/stress fixtures, custom terminal WebGL/session-replay layers, and queued navigation, returning to leaner defaults.

  • Refactors
    • Removed stress docs/scripts and SUPERSET_RENDERER_STRESS_CDP_PORT usage; devtools load unconditionally in dev. Cleaned apps/desktop/package.json scripts.
    • Terminal: use @xterm/addon-webgl and @xterm/addon-image directly; deleted custom WebGL controller/canvas registry/session-replay code and output queuing. Simplified WS transport and helpers; updated addon loader.
    • Sidebar/hooks: dropped “enabled” flags across queries. useDiffStats now derives totals from git.getStatus; removed diff-stats codepath on the host. Review/changes/editor hooks always enabled.
    • Workspace navigation: removed queued switch store/bridge and pending state. Navigation runs immediately; sidebar/workspaces UI no longer reads pending IDs.
    • Changes UI: simplified folder view (no virtualizer) and section collapse (Collapsible). Minor prop cleanups and container tweaks.
    • Tabs: removed windowing/scroll measurement. Simplified TabBar/TabItem and adopted @superset/ui/overflow-fade-*.
    • Browser pane: removed layout coalescing and last-rect tracking; rely on existing lifecycle.
    • Fonts and misc: simplified system font detection (no idle batching). Machine ID lookups without timeouts. PostHog init simplified. use-overflow-fade drops measureKey prop.
    • Host service: simplified PR runtime startup/shutdown (no background task tracking/stop waiting). git-config writes use simple-git types directly; removed ensure-main-workspace coalescing and adjusted workspace config writes. Pruned related tests.

Written for commit 98e6e71. Summary will update on new commits.

Summary by CodeRabbit

  • Removed Features

    • Removed renderer stress testing and CDP-based testing infrastructure, including CLI scripts, documentation, and related configuration utilities.
  • Improvements

    • Simplified V2 workspace navigation by removing pending state tracking.
    • Simplified terminal WebGL rendering with automatic DOM fallback on context loss.
    • Improved tab bar rendering performance by removing windowing calculations.
    • Streamlined hook APIs by removing conditional enabled parameters.
  • Bug Fixes & Refactoring

    • Removed terminal output buffering and replay complexity.
    • Simplified git diff operations and backend request handling.
    • Cleaned up pull request manager shutdown logic.

@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: 71cde6cf-9036-477c-9244-23f6f0c62ee2

📥 Commits

Reviewing files that changed from the base of the PR and between a9ccbe1 and 98e6e71.

📒 Files selected for processing (85)
  • apps/desktop/docs/RENDERER_STRESS_QA.md
  • apps/desktop/docs/V2_LAUNCH_TEST_PLAN.md
  • 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.test.ts
  • apps/desktop/src/renderer/lib/terminal/terminal-image-addon.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-webgl-canvas-registry.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/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 renderer stress-testing infrastructure (scripts, CDPport enablement, stress harness), simplifies terminal runtime/transport by eliminating output buffering and replay logic, refactors git diff stats querying, removes workspace navigation state management in favor of route-based routing, makes hook query/effect gating unconditional (removes enabled parameters), and refactors UI components (virtualization removal, overflow handling, sidebar restructuring).

Changes

Renderer Stress Infrastructure Removal

Layer / File(s) Summary
Stress testing scripts and fixture generation
apps/desktop/scripts/stress-renderer.ts, apps/desktop/scripts/prepare-renderer-stress-fixtures.ts, apps/desktop/package.json, apps/desktop/docs/RENDERER_STRESS_QA.md
Removes the stress test harness CLI (stress-renderer), fixture preparation script (prepare-renderer-stress-fixtures), and associated documentation; package.json scripts (stress:renderer, stress:renderer:fixtures) are removed.
Main process CDP debugging enablement
apps/desktop/src/main/index.ts, apps/desktop/src/main/lib/extensions/index.ts
Removes development-only logic that read SUPERSET_RENDERER_STRESS_CDP_PORT and conditionally enabled Electron's remote-debugging-port; React DevTools now loads unconditionally in dev mode.
Renderer stress navigation and bridge
apps/desktop/src/renderer/index.tsx, 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/useRendererStressWorkspaceBridge/index.ts
Removes the dev-only window.__SUPERSET_RENDERER_STRESS_NAVIGATE__ global bridge and the useRendererStressWorkspaceBridge hook that managed stress-workspace pane layouts, terminal tracking, and stress terminal output/context-loss behaviors; integration removed from page.tsx.

Terminal Runtime & WebSocket Transport Simplification

Layer / File(s) Summary
Terminal output buffering and replay removal
apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts, apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.ts, apps/desktop/tests/...
Removes queued output buffering, chunk flushing, replay suppression logic, and exported writeRuntimeOutput/shouldReplayTerminalRuntime helpers; buffer restoration becomes fire-and-forget writes; terminal disposal now happens immediately instead of deferred.
Terminal session replay blocking removal
apps/desktop/src/renderer/lib/terminal/terminal-session-replay.ts
Removes exported session-replay block class/attributes and markTerminalSessionReplayBlocked helper that previously marked terminal DOM elements for PostHog session replay exclusion.
WebSocket transport output writer and replay options
apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts, apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.test.ts
Removes TerminalOutputWriter type, TerminalConnectOptions interface, _writeOutput/_suppressReplay transport fields; connect() signature simplified to always replay based solely on _hasReceivedBytes; binary frame handling always writes directly to xterm.
Terminal WebGL and image addon refactoring
apps/desktop/src/renderer/lib/terminal/terminal-addons.ts, apps/desktop/src/renderer/lib/terminal/terminal-image-addon.ts, apps/desktop/src/renderer/lib/terminal/terminal-webgl-addon-controller.ts, apps/desktop/src/renderer/lib/terminal/terminal-webgl-canvas-registry.ts, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts
Removes ImageAddon factory helper and deprecated WebGL addon controller; WebGL addon creation is deferred to requestAnimationFrame with fallback to DOM on failure; removes WebGL canvas registry and stress-related terminal context-loss APIs (forceWebglContextLossForStress).
Terminal runtime registry stress APIs
apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.ts
Removes focus() method, writeForStress(), forceWebglContextLossForStress(), and getStressDebugInfo() methods from the registry; removes stress/WebGL debug type exports.
Terminal pane and lifecycle 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 the ctx.isActive effect that called terminalRuntimeRegistry.focus(); TerminalPane is no longer memoized.

Git Status Query Refactoring

Layer / File(s) Summary
Diff stats query removal and consolidation
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 computed aggregated additions/deletions totals; sidebar and other consumers now derive diff stats from git.getStatus instead.
Diff stats parsing simplification
packages/host-service/src/trpc/router/git/utils/git-helpers.ts, packages/host-service/src/trpc/router/git/utils/git-helpers.test.ts
Removes parseNumstatRecords export and simplifies parseNumstat to parse NUL-delimited output directly into a Map; module-level diff aggregation helpers added for per-path stat computation.
Git config write type contract
packages/host-service/src/trpc/router/git/utils/config-write.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
gitConfigWrite now accepts SimpleGit directly instead of removed GitConfigWriter interface; enablePushAutoSetupRemote and recordBaseBranchConfig call git.raw directly instead of using gitConfigWrite.
Diff stats hook refactoring
apps/desktop/src/renderer/hooks/host-service/useDiffStats/useDiffStats.ts
useDiffStats removes options parameter and now derives additions/deletions by aggregating per-path stats from git.getStatus.query(...).againstBase/staged/unstaged rather than calling git.getDiffStats.query.

Workspace Navigation & Route-Based Routing

Layer / File(s) Summary
Pending workspace state store removal
apps/desktop/src/renderer/stores/v2-workspace-navigation.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.ts
Removes useV2WorkspaceNavigationStore (with pendingWorkspaceId state), setPendingV2WorkspaceNavigation, and clearPendingV2WorkspaceNavigation exports; removes local in-flight promise deduplication for workspace ensures.
Route-based active workspace derivation
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarShortcuts/useDashboardSidebarShortcuts.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx
activeV2WorkspaceId and currentWorkspaceId are now derived from the current /v2-workspace/$workspaceId route match instead of from pending-workspace state; hotkey navigation (PREV/NEXT workspace) uses route-based current workspace.
Simplified workspace navigation routing
apps/desktop/src/renderer/routes/_authenticated/_dashboard/utils/workspace-navigation.ts
navigateToWorkspace and navigateToV2Workspace now return raw navigate() calls directly without the prior queuing/failure-observation machinery.
Workspace creation concurrency changes
packages/host-service/src/trpc/router/project/utils/ensure-main-workspace.ts
Removes in-flight promise deduplication for concurrent ensureMainWorkspaceStrict calls, so concurrent callers for the same key now run independently.
Pull request runtime shutdown simplification
packages/host-service/src/app.ts, packages/host-service/src/runtime/pull-requests/pull-requests.ts
PullRequestRuntimeManager.stop() is no longer awaited during app disposal and no longer waits for background task completion; removes stopped flag and background task drain machinery; removes test coverage for shutdown sync behavior.

Hook Unconditional Query Pattern

Layer / File(s) Summary
Git status hooks unconditional queries
apps/desktop/src/renderer/hooks/host-service/useGitStatus/useGitStatus.ts, 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/hooks/useSidebarDiffRef/useSidebarDiffRef.ts
Removes optional enabled parameters from useGitStatus, useChangesTab, and useSidebarDiffRef; queries are now gated only on workspaceId presence and run unconditionally (no tab-activity or visibility gating).
Workspace mutation hooks unconditional queries
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/components/WorkspaceSidebar/hooks/useReviewTab/useReviewTab.tsx
Removes enabled parameters from useChangeset, useOpenInExternalEditor, and useReviewTab; queries now run based only on data presence (e.g., workspaceId, ref.kind).
Search hook unconditional pattern
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 from useHybridSearch and always constructs Fuse indexes from input tasks; useTasksData no longer passes hasSearchQuery to the hook.
Hover card gating removal
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHoverCardOverlay/DashboardSidebarHoverCardOverlay.tsx
useDiffStats is called unconditionally without { enabled: open } gating based on popover state.

UI Component Refactoring

Layer / File(s) Summary
Sidebar workspace item hover and active state
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
Removes activeWorkspaceId and onWorkspaceHover props; adds onHoverCardOpen callback; isActive is now computed via useMatchRoute in useDashboardSidebarWorkspaceItemActions; removes data-renderer-stress-workspace-id attribute.
Sidebar project section workspace prop removal
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 from DashboardSidebarProjectSection and its child components; hover-card opening is now handled via onHoverCardOpen callbacks passed to workspace items.
TabBar overflow-fade refactoring
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/utils.ts, packages/panes/src/react/components/Workspace/components/TabBar/utils/index.ts
Replaces scroll-position-based tab windowing with OverflowFadeContainer overflow observation; removes ResizeObserver, scroll handlers, visible-tab window computation; TabItem no longer uses memo; tab title rendering switches to OverflowFadeText; removes windowing constants/helper exports.
Changes sidebar 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 dependency; renders folder groups and files directly via .map() instead of using virtualizer; removes listRef, viewport-based row slicing, and overscan logic.
Changes section collapsible component
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/ChangesSection/ChangesSection.tsx
Replaces manual open/close state with Collapsible component; removes useId-based contentId and aria-controls in favor of component-based markup.
Browser pane registry layout simplification
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.ts
Replaces throttled/deferred layout scheduling with immediate updateLayout() calls; removes cached lastLayoutRect, pending entry deduplication, and frame/idle callback machinery.
Workspace page route layout
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx
Removes renderer-stress bridge wiring and useMemo-based computed state; splits V2WorkspacePage into a wrapper and V2WorkspaceContent; refactors placeholder rendering condition logic.

Font Discovery and Terminal Helpers Refactoring

Layer / File(s) Summary
System font discovery async flow
apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/FontSettingSection/hooks/useSystemFonts/useSystemFonts.ts
Removes batched async discovery with start delay and idle yielding; consolidates font loading into a single useEffect that awaits document.fonts.ready, scans well-known families synchronously, optionally queries local fonts, deduplicates, and caches results; adds isMonospaceByMeasurement heuristic for reclassification.
Split orientation measurement
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/hooks/useSplitOrientation/useSplitOrientation.ts
Simplifies updateOrientation to read BoundingClientRect directly instead of accepting { width, height } parameters; ResizeObserver now directly calls updateOrientation().
Workspace run definition command typing
apps/desktop/src/shared/workspace-run-definition.ts, apps/desktop/src/shared/workspace-run-definition.test.ts
Tightens commands typing from unknown[] to string[] in WorkspaceRunPresetLike, configRunToWorkspaceRun, and selectWorkspaceRunDefinition; removes test cases for non-string command handling.

PostHog and Miscellaneous Cleanup

Layer / File(s) Summary
PostHog session recording and init config simplification
apps/desktop/src/renderer/lib/posthog.ts, apps/desktop/src/renderer/lib/posthog.test.ts
Removes exported POSTHOG_SESSION_REPLAY_BLOCK_SELECTOR constant and buildPostHogInitConfig helper function; inline PostHog config in initPostHog without session recording canvas capture, scroll disabling, or autocapture settings; removes corresponding test suite.
Overflow fade hook measurement key removal
packages/ui/src/components/overflow-fade/OverflowFadeContainer/OverflowFadeContainer.tsx, packages/ui/src/hooks/use-overflow-fade.ts
Removes measureKey option from useOverflowFade and OverflowFadeContainer; removes the extra useLayoutEffect that re-ran on measureKey changes; removes RAF throttling variables and scheduling.
Error handling and cleanup
packages/panes/src/react/components/Workspace/Workspace.tsx, 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
Changes onAfterClose error handling from try/catch to propagation; updates integration tests to use Promise.allSettled for concurrency validation and removes parallel concurrency regression tests; adds unauthenticated delete API test.
Host identification salt constant
packages/shared/src/host-info.ts
Replaces MACHINE_ID_COMMAND_TIMEOUT_MS with APP_HOST_SALT constant for HMAC-based host ID derivation; removes timeout option from execFileSync calls.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • superset-sh/superset#4304: This PR removes @tanstack/react-virtual from ChangesFoldersView, directly opposing the virtualization request in the issue.

Possibly related PRs

  • superset-sh/superset#4500: Removed all renderer stress scripts, terminal stress APIs, and stress-bridge integration that were added in this prior PR.
  • superset-sh/superset#4480: Both PRs remove Electron renderer CDP/remote-debugging-port-style development wiring (main PR drops SUPERSET_RENDERER_STRESS_CDP_PORT, retrieved PR removes DESKTOP_AUTOMATION_PORT-based CDP automation).
  • superset-sh/superset#4541: Main PR removes the renderer stress tooling, fixtures scripts, dev navigation bridge, and terminal stress/WebGL APIs that were added in this prior PR.

Poem

🐰 Stress tests are shed, complexity peeled away,
Routes guide the workspace, no pending state to sway,
Buffers unbuffered, hooks now always run free,
Simpler, cleaner code—let the app breathe!

✨ 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-4541-accurate-tuesday

@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.

@Kitenite Kitenite merged commit 15f5cd8 into main May 14, 2026
10 of 11 checks passed
@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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 14, 2026

Greptile Summary

This PR reverts #4541 ("Reapply renderer stress fixes without terminal sizing regression") across 85 files, shedding ~6,800 lines of net additions to restore the pre-#4541 baseline after a terminal sizing regression was discovered.

  • Terminal output pipeline: removes the RAF-gated output queue, 4 KB chunking, backpressure tracking (hasBufferedContent), deferred disposeTerminalAfterPendingRefresh, and _suppressReplay / _writeOutput transport fields; the _hasReceivedBytes empty-buffer guard from Reapply renderer stress fixes without terminal sizing regression #4541 is also lost, meaning any zero-byte binary frame can now permanently suppress replay on reconnect.
  • Renderer stress infrastructure: deletes the 681-line useRendererStressWorkspaceBridge, the companion scripts (stress-renderer.ts, prepare-renderer-stress-fixtures.ts), the WebGL canvas registry, session-replay marking, and the TerminalRuntimeStressDebugInfo/TerminalWebglContextLossResult debug APIs.
  • TabBar & overflow fade: drops the custom scroll-metrics + tab-windowing virtualization (getVisibleTabWindow) and reverts to OverflowFadeContainer; also removes measureKey and RAF-batched deferred measurement from useOverflowFade.

Confidence Score: 3/5

Safe to merge as a roll-back, but two improvements from #4541 — the empty-buffer replay guard and the explicit PostHog terminal-content block — are worth carrying forward into the follow-up re-apply.

The revert is clean and intentional: it removes a confirmed terminal sizing regression. However, it re-introduces a transport-level issue where a zero-byte binary frame permanently disables session replay for the lifetime of the transport, potentially causing users to miss terminal output after reconnection. That fix was an explicit, targeted change in #4541 that should survive the re-apply. The PostHog session recording concern is lower urgency but worth tracking before session recording is turned on.

terminal-ws-transport.ts (replay suppression on empty frame) and posthog.ts (terminal content not blocked from session recordings)

Security Review

  • PostHog session recording (apps/desktop/src/renderer/lib/posthog.ts): the blockSelector that excluded .xterm, .xterm-screen, .xterm-viewport, .xterm-helper-textarea, and [data-terminal-webgl-canvas] from session recordings is removed, along with the disable_session_recording: true flag. If PostHog session recording is enabled via dashboard or a future config change, raw terminal output (which may contain credentials, tokens, or sensitive command output) could appear in recordings.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts Reverts replay-suppression logic: removes _suppressReplay, _writeOutput, and the byteLength guard on _hasReceivedBytes, re-introducing a case where empty binary frames incorrectly suppress replay on reconnect.
apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts Removes the entire output-chunking/RAF-flush queue, hasBufferedContent tracking, deferred terminal disposal, and RAF-debounced focus; restores direct terminal.dispose() which may race with pending xterm renders.
apps/desktop/src/renderer/lib/terminal/terminal-addons.ts Replaces the dedicated WebGL addon controller (with canvas registry and session-replay marking) with inline single-rAF WebGL setup; functionally equivalent for normal usage.
apps/desktop/src/renderer/lib/posthog.ts Removes session_recording blockSelector (covering terminal elements and WebGL canvases) and disable_session_recording flag; terminal content could appear in PostHog recordings if recording is later enabled.
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx Removes the custom scroll-metrics + tab-windowing virtualization (getVisibleTabWindow) and reverts to OverflowFadeContainer; drops 119 lines of scroll-tracking logic cleanly.
apps/desktop/src/renderer/lib/terminal/terminal-runtime-registry.ts Removes stress-test debug API (writeForStress, forceRuntimeWebglContextLoss, listEntries, focus), simplifies connect() calls by dropping writeRuntimeOutput and shouldReplayTerminalRuntime hooks.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useRendererStressWorkspaceBridge/useRendererStressWorkspaceBridge.ts Entire 681-line renderer stress bridge deleted; this was the IPC bridge used by the stress-test scripts and is safe to remove alongside the scripts themselves.
packages/ui/src/hooks/use-overflow-fade.ts Removes RAF-batched deferred measurement and measureKey prop; overflow updates now fire synchronously on scroll/resize, which is the original pre-#4541 behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WebSocket binary frame received] --> B{ArrayBuffer?}
    B -- Yes --> C[terminal.write new Uint8Array]
    C --> D[_hasReceivedBytes = true UNCONDITIONAL]
    B -- No --> E[Parse JSON message]

    D --> F[On next connect]
    F --> G{_hasReceivedBytes?}
    G -- true --> H[append replay=0 to URL]
    G -- false --> I[use URL as-is, server replays]

    H --> J[User may miss terminal output if empty frame triggered the flag]

    style D fill:#f88,stroke:#c00
    style J fill:#f88,stroke:#c00
Loading
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
apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts:309-313
**Replay suppressed on empty binary frame**

`_hasReceivedBytes` is set to `true` unconditionally for any `ArrayBuffer`, including zero-byte frames. If the server ever sends an empty binary frame (heartbeat, protocol keep-alive, or a flush signal), replay will be permanently suppressed for the lifetime of the transport. On the next reconnect the URL gets `replay=0` appended, so the user misses any terminal output that accumulated before the disconnect.

PR #4541 specifically guarded this with `if (data.byteLength > 0)` — that fix is lost in this revert. This is the clearest regression worth carrying forward into the follow-up PR that re-applies the stress fixes without the sizing issue.

### Issue 2 of 3
apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts:325-326
**Synchronous terminal disposal may race with pending renders**

`runtime.terminal.dispose()` is called synchronously. If xterm.js has a pending animation-frame render in flight when `disposeRuntime` is called (e.g. during tab close), disposing mid-render can throw internal xterm errors. PR #4541 introduced `disposeTerminalAfterPendingRefresh` (double-rAF deferral) specifically to avoid this. Since the fix is being dropped here, it's worth re-incorporating in the follow-up re-apply.

### Issue 3 of 3
apps/desktop/src/renderer/lib/posthog.ts:11-30
**Terminal content no longer explicitly blocked from session recording**

The reverted config had `disable_session_recording: true` and a `blockSelector` that explicitly excluded terminal elements (`.xterm`, `.xterm-screen`, `.xterm-viewport`, the canvas layer, and `[data-terminal-webgl-canvas]`) from PostHog recordings. Neither is present after this revert. If session recording is later enabled via the PostHog dashboard or a future config change, raw terminal output could be captured in session replays. The explicit opt-out is worth restoring in the follow-up PR.

Reviews (1): Last reviewed commit: "Revert "Reapply renderer stress fixes wi..." | Re-trigger Greptile

Comment on lines 309 to 313
if (event.data instanceof ArrayBuffer) {
const data = new Uint8Array(event.data);
transport._writeOutput?.(data);
if (data.byteLength > 0) {
transport._hasReceivedBytes = true;
}
terminal.write(new Uint8Array(event.data));
transport._hasReceivedBytes = true;
return;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Replay suppressed on empty binary frame

_hasReceivedBytes is set to true unconditionally for any ArrayBuffer, including zero-byte frames. If the server ever sends an empty binary frame (heartbeat, protocol keep-alive, or a flush signal), replay will be permanently suppressed for the lifetime of the transport. On the next reconnect the URL gets replay=0 appended, so the user misses any terminal output that accumulated before the disconnect.

PR #4541 specifically guarded this with if (data.byteLength > 0) — that fix is lost in this revert. This is the clearest regression worth carrying forward into the follow-up PR that re-applies the stress fixes without the sizing issue.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/lib/terminal/terminal-ws-transport.ts
Line: 309-313

Comment:
**Replay suppressed on empty binary frame**

`_hasReceivedBytes` is set to `true` unconditionally for any `ArrayBuffer`, including zero-byte frames. If the server ever sends an empty binary frame (heartbeat, protocol keep-alive, or a flush signal), replay will be permanently suppressed for the lifetime of the transport. On the next reconnect the URL gets `replay=0` appended, so the user misses any terminal output that accumulated before the disconnect.

PR #4541 specifically guarded this with `if (data.byteLength > 0)` — that fix is lost in this revert. This is the clearest regression worth carrying forward into the follow-up PR that re-applies the stress fixes without the sizing issue.

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

Comment on lines 325 to +326
runtime.wrapper.remove();
runtime.terminal.dispose();
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 Synchronous terminal disposal may race with pending renders

runtime.terminal.dispose() is called synchronously. If xterm.js has a pending animation-frame render in flight when disposeRuntime is called (e.g. during tab close), disposing mid-render can throw internal xterm errors. PR #4541 introduced disposeTerminalAfterPendingRefresh (double-rAF deferral) specifically to avoid this. Since the fix is being dropped here, it's worth re-incorporating in the follow-up re-apply.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts
Line: 325-326

Comment:
**Synchronous terminal disposal may race with pending renders**

`runtime.terminal.dispose()` is called synchronously. If xterm.js has a pending animation-frame render in flight when `disposeRuntime` is called (e.g. during tab close), disposing mid-render can throw internal xterm errors. PR #4541 introduced `disposeTerminalAfterPendingRefresh` (double-rAF deferral) specifically to avoid this. Since the fix is being dropped here, it's worth re-incorporating in the follow-up re-apply.

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

Comment on lines +11 to 30
return;
}

export function buildPostHogInitConfig(): Partial<PostHogConfig> {
return {
posthogFull.init(env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: env.NEXT_PUBLIC_POSTHOG_HOST,
defaults: "2025-11-30",
autocapture: false,
capture_pageview: false,
capture_pageleave: false,
capture_exceptions: true,
disable_scroll_properties: true,
disable_session_recording: true,
person_profiles: "identified_only",
persistence: "localStorage",
debug: false,
session_recording: {
blockSelector: POSTHOG_SESSION_REPLAY_BLOCK_SELECTOR,
captureCanvas: {
recordCanvas: false,
canvasFps: 0,
canvasQuality: "0",
},
},
loaded: (ph) => {
ph.register({
app_name: "desktop",
platform: window.navigator.platform,
});
},
};
}

export function initPostHog() {
if (!env.NEXT_PUBLIC_POSTHOG_KEY) {
console.log("[posthog] No key configured, skipping");
return;
}

posthogFull.init(env.NEXT_PUBLIC_POSTHOG_KEY, buildPostHogInitConfig());
});
}
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 security Terminal content no longer explicitly blocked from session recording

The reverted config had disable_session_recording: true and a blockSelector that explicitly excluded terminal elements (.xterm, .xterm-screen, .xterm-viewport, the canvas layer, and [data-terminal-webgl-canvas]) from PostHog recordings. Neither is present after this revert. If session recording is later enabled via the PostHog dashboard or a future config change, raw terminal output could be captured in session replays. The explicit opt-out is worth restoring in the follow-up PR.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/lib/posthog.ts
Line: 11-30

Comment:
**Terminal content no longer explicitly blocked from session recording**

The reverted config had `disable_session_recording: true` and a `blockSelector` that explicitly excluded terminal elements (`.xterm`, `.xterm-screen`, `.xterm-viewport`, the canvas layer, and `[data-terminal-webgl-canvas]`) from PostHog recordings. Neither is present after this revert. If session recording is later enabled via the PostHog dashboard or a future config change, raw terminal output could be captured in session replays. The explicit opt-out is worth restoring in the follow-up PR.

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