Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds detachable "pane" windows end-to-end: new TRPC endpoints and UI action to open panes, a pane window factory with reuse/caching, hash-aware window creation and routing, history/persistence guards for pane popouts, and centralized IPC handler wiring. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User / UI
participant TabPane as TabPane
participant TRPC as electronTrpc.window
participant Factory as openPaneWindow
participant WinLoader as createWindow / Window Loader
participant Renderer as Renderer Route
participant IPC as IPC Handler
User->>TabPane: Click "Open in window"
TabPane->>TRPC: openPane({ paneId, paneName, workspaceName })
TRPC->>Factory: openPaneWindow({ paneId, paneName, workspaceName })
alt reuse existing window
Factory->>IPC: attachWindowToIpcHandler(existingWindow)
Factory->>Factory: restore / show / focus existingWindow
Factory-->>TRPC: { reused: true }
else create new window
Factory->>WinLoader: createWindow({ id, hash: '/pane/{paneId}', ... })
WinLoader->>Renderer: load URL with hash "#/pane/{paneId}"
Renderer->>Renderer: render /pane/$paneId page (Terminal or message)
Factory->>IPC: attachWindowToIpcHandler(newWindow)
Factory-->>TRPC: { reused: false }
end
TRPC-->>TabPane: { success: true, reused }
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/main/windows/pane.ts">
<violation number="1" location="apps/desktop/src/main/windows/pane.ts:54">
P2: Missing `did-fail-load` handler: if the pane renderer fails to load, the window remains invisible forever (created with `show: false`). The main window handles this case by showing itself on load failure. Consider adding a parallel handler here so the user can at least see and close a failed pane window.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx`:
- Around line 125-132: The icon-only button that calls handleOpenPaneWindow (and
uses openPaneWindowMutation and the TbExternalLink icon) lacks an accessible
name; add an explicit accessible label such as aria-label="Open pane in new
window" (or a localized string) to the button and/or include a visually-hidden
text node for screen-readers; do not rely solely on the icon or title attribute
so assistive tech can identify the action reliably.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
apps/desktop/src/lib/electron-app/factories/windows/create.tsapps/desktop/src/lib/trpc/routers/window.tsapps/desktop/src/lib/window-loader.tsapps/desktop/src/main/windows/pane.tsapps/desktop/src/renderer/lib/persistent-hash-history/persistent-hash-history.test.tsapps/desktop/src/renderer/lib/persistent-hash-history/persistent-hash-history.tsapps/desktop/src/renderer/routes/pane/$paneId/page.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsxapps/desktop/src/shared/types/electron.ts
|
Addressed both review findings in bf188b8:
Also verified:
|
|
Addressed both review findings in commit
Validation:
|
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/main/windows/pane.ts">
<violation number="1" location="apps/desktop/src/main/windows/pane.ts:52">
P1: Missing `detachWindowFromIpcHandler` call on window close. The main window (`main.ts:282`) detaches from the IPC handler when closed, but pane windows don't. This leaves a stale reference in the IPC handler after the pane window is destroyed, which may cause errors when the handler tries to communicate with it.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }, | ||
| hash: `/pane/${encodeURIComponent(paneId)}`, | ||
| }); | ||
| attachWindowToIpcHandler(window); |
There was a problem hiding this comment.
P1: Missing detachWindowFromIpcHandler call on window close. The main window (main.ts:282) detaches from the IPC handler when closed, but pane windows don't. This leaves a stale reference in the IPC handler after the pane window is destroyed, which may cause errors when the handler tries to communicate with it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/main/windows/pane.ts, line 52:
<comment>Missing `detachWindowFromIpcHandler` call on window close. The main window (`main.ts:282`) detaches from the IPC handler when closed, but pane windows don't. This leaves a stale reference in the IPC handler after the pane window is destroyed, which may cause errors when the handler tries to communicate with it.</comment>
<file context>
@@ -48,6 +49,7 @@ export function openPaneWindow({
},
hash: `/pane/${encodeURIComponent(paneId)}`,
});
+ attachWindowToIpcHandler(window);
paneWindows.set(paneId, window);
</file context>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/src/main/windows/pane.ts`:
- Around line 52-64: The window is attached to IPC via
attachWindowToIpcHandler(window) but never detached, causing stale IPC
registrations; add cleanup in the window "closed" handler to remove IPC handlers
for this pane—either call a corresponding detach function (e.g.
detachWindowFromIpcHandler(window) or implement one alongside
attachWindowToIpcHandler) before deleting the pane from paneWindows, and also
remove any remaining listeners on window.webContents (like the "did-finish-load"
listener) to fully release resources for paneId/window.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/desktop/src/main/lib/ipc-handler/index.tsapps/desktop/src/main/windows/main.tsapps/desktop/src/main/windows/pane.tsapps/desktop/src/renderer/lib/trpc-storage.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.ts`:
- Around line 682-693: The async detach can race with a remount and detach a
newly mounted session; to fix, capture the timeout handle (detachTimeout) and
after awaiting shouldKeepAttachedForSingleClient(paneId) verify that
pendingDetaches.get(paneId) === detachTimeout before calling detachRef.current({
paneId }); also only delete pendingDetaches and coldRestoreState for this pane
when that same handle matches, ensuring stale async work cannot affect a
remounted pane; adjust the closure in useTerminalLifecycle where detachTimeout,
pendingDetaches, coldRestoreState, shouldKeepAttachedForSingleClient, and
detachRef.current are used to perform this guard.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.ts
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.ts">
<violation number="1" location="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.ts:683">
P1: Race condition: the async IIFE inside `setTimeout` is not cancellable on remount. If the 50ms timer fires before a quick remount occurs, `clearTimeout` is a no-op and the in-flight async query will eventually detach (and delete `coldRestoreState`) even though the terminal has already re-attached. Guard the async body by checking that `pendingDetaches.get(paneId) === detachTimeout` before proceeding.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx (1)
128-135:⚠️ Potential issue | 🟠 MajorAdd an accessible name to the icon-only “open in window” button.
On Line 128, the icon-only
<button>has no programmatic label, so assistive tech cannot reliably announce its action.Suggested fix
<button type="button" + aria-label="Open in window" + title="Open in window" onClick={handleOpenPaneWindow} disabled={openPaneWindowMutation.isPending} className="rounded p-0.5 text-muted-foreground/60 transition-colors hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-40" >🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx` around lines 128 - 135, The icon-only button that triggers handleOpenPaneWindow (using openPaneWindowMutation and rendering TbExternalLink) lacks a programmatic label; add an accessible name by supplying an appropriate aria-label (e.g., aria-label="Open pane in new window") or include visually-hidden text inside the button to describe its action so screen readers can announce it, and ensure the label updates if behavior or state changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx`:
- Around line 128-135: The icon-only button that triggers handleOpenPaneWindow
(using openPaneWindowMutation and rendering TbExternalLink) lacks a programmatic
label; add an accessible name by supplying an appropriate aria-label (e.g.,
aria-label="Open pane in new window") or include visually-hidden text inside the
button to describe its action so screen readers can announce it, and ensure the
label updates if behavior or state changes.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/desktop/src/lib/trpc/routers/window.tsapps/desktop/src/main/windows/pane.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/desktop/src/lib/trpc/routers/window.ts
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx">
<violation number="1" location="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx:131">
P2: The `title` attribute will produce a native browser tooltip on top of the existing Radix `<TooltipContent>` tooltip, causing a double-tooltip UX glitch. No other `TooltipTrigger` in the codebase uses `title`. Remove it — the `aria-label` already provides the accessible name, and `<TooltipContent>` handles the visual tooltip.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| <button | ||
| type="button" | ||
| aria-label="Open pane in new window" | ||
| title="Open in window" |
There was a problem hiding this comment.
P2: The title attribute will produce a native browser tooltip on top of the existing Radix <TooltipContent> tooltip, causing a double-tooltip UX glitch. No other TooltipTrigger in the codebase uses title. Remove it — the aria-label already provides the accessible name, and <TooltipContent> handles the visual tooltip.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/TabPane.tsx, line 131:
<comment>The `title` attribute will produce a native browser tooltip on top of the existing Radix `<TooltipContent>` tooltip, causing a double-tooltip UX glitch. No other `TooltipTrigger` in the codebase uses `title`. Remove it — the `aria-label` already provides the accessible name, and `<TooltipContent>` handles the visual tooltip.</comment>
<file context>
@@ -127,6 +127,8 @@ export function TabPane({
<button
type="button"
+ aria-label="Open pane in new window"
+ title="Open in window"
onClick={handleOpenPaneWindow}
disabled={openPaneWindowMutation.isPending}
</file context>
…window-type-o # Conflicts: # apps/desktop/src/main/windows/main.ts
…-new-window-type-o
|
Closing as stale: created in Jan-Mar with no recent activity. If still relevant, re-open or re-create from a fresh branch. Bulk audit 2026-05-06. |
Summary
panewindow type and open/focus flow viawindow.openPane#/pane/$paneIdthat renders only the pane content (terminal), not the workspace shellhash/queryinto route registration so pane windows boot to the stripped route reliablyWhy
Pane popout windows were opening into the full app shell due to shared history + dropped route hash. This change makes pane popouts minimal and route-stable.
Validation
bun run --cwd apps/desktop typecheckbun test apps/desktop/src/renderer/lib/persistent-hash-history/persistent-hash-history.test.tsbunx biome checkon touched filesSummary by cubic
Adds a minimal pop-out window for terminal panes with its own route and isolated (non-persistent) history. Reuses/focuses existing pane windows, prevents full app state writes, and keeps terminals attached when another pane window or pane client is active.
New Features
Bug Fixes
Written for commit b40c6e8. Summary will update on new commits.
Summary by CodeRabbit
New Features
Behavior Changes
Tests