Repository navigation
fix(desktop): move the ship controls back into the workspace tab bar - #8057
Conversation
Reverses #7958. The Changes/PR control and the open-in button return to the pane tab bar's trailing slot, before the sidebar toggle, so they stay reachable while the right sidebar is closed. The sidebar's top strip is back to Pages and Run. - Closing Changes takes the sidebar down with it again when the sidebar is on the Changes tab; getWorkspaceSidebarTab and its test return. - The strip keeps its 48px height from #8023 and still sizes the Run hotkey hint off the strip width. Co-Authored-By: Claude <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Changes and open-in controls move from the workspace sidebar to the tab bar. A new utility reads the selected sidebar tab. Closing the Changes pane closes the right sidebar only when the selected tab is “changes.” A host-service integration test for concurrent workspace creation is removed. ChangesWorkspace controls and sidebar behavior
Host-service integration test
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change moves the Changes and open-in controls back into the tab bar and removes a flaky concurrency test. No concrete merge-blocking risk was identified in the supplied context. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
| title={label} | ||
| className={cn( | ||
| "flex min-w-0 items-center gap-1 overflow-hidden px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", | ||
| "flex items-center gap-1 px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", |
There was a problem hiding this comment.
Unbounded Changes control width
On a narrow workspace window, large addition and deletion totals can make this button wider than the space available. The tab bar's trailing controls do not shrink, so the wider Changes control leaves less room for pane tabs and can push other controls beyond the bar. Please keep the stats face bounded in its new location.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/ChangesControl/ChangesControl.tsx
Line: 76
Comment:
**Unbounded Changes control width**
On a narrow workspace window, large addition and deletion totals can make this button wider than the space available. The tab bar's trailing controls do not shrink, so the wider Changes control leaves less room for pane tabs and can push other controls beyond the bar. Please keep the stats face bounded in its new location.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| it("reads the row's tab, then the rowless fallback, then the default", () => { | ||
| const collections = stubCollections({ | ||
| "ws-1": { sidebarState: { activeTab: "review" } }, | ||
| }); | ||
|
|
||
| expect(getWorkspaceSidebarTab(collections, "ws-1")).toBe("review"); | ||
| expect(getWorkspaceSidebarTab(collections, "main-ws")).toBe("changes"); | ||
| setWorkspaceSidebarTab(collections, "main-ws", "files"); | ||
| expect(getWorkspaceSidebarTab(collections, "main-ws")).toBe("files"); | ||
| }); |
There was a problem hiding this comment.
Sidebar interaction remains untested
This test covers reading the active tab, but not the new behavior that closes the Changes pane and conditionally closes the sidebar. Please test that closing Changes also closes a sidebar still on Changes, while a sidebar switched to Files or Review stays open. Otherwise, a regression in that interaction could pass the tests.
Knowledge Base Used: Restore per-mount v2 pane store synchronization
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/utils/setWorkspaceSidebarTab/setWorkspaceSidebarTab.test.ts
Line: 51-60
Comment:
**Sidebar interaction remains untested**
This test covers reading the active tab, but not the new behavior that closes the Changes pane and conditionally closes the sidebar. Please test that closing Changes also closes a sidebar still on Changes, while a sidebar switched to Files or Review stays open. Otherwise, a regression in that interaction could pass the tests.
**Knowledge Base Used:** [Restore per-mount v2 pane store synchronization](https://app.greptile.com/personal-org-6810/-/custom-context/knowledge-base/superset-sh/superset/-/reverts/revert_4017-20260503-pane-store-registry-regressions-06bbdb2.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/ChangesControl/ChangesControl.tsx">
<violation number="1" location="apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/ChangesControl/ChangesControl.tsx:76">
P2: Bound the stats face again by restoring `min-w-0 overflow-hidden` so large totals cannot expand this trailing control and crowd the pane tabs.</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as User
participant Page as Workspace Page
participant TabBar as Workspace Tab Bar
participant Sidebar as Right Sidebar
participant ChangesCtrl as ChangesControl
participant Store as Workspace Pane Store
participant SidebarStore as Sidebar Tab State
Note over User,Page: Ship controls live in tab bar (reachable with sidebar closed)
User->>Page: Click ChangesControl in tab bar
Page->>ChangesCtrl: onToggleChanges()
ChangesCtrl->>Store: closeVisibleChangesPane(store)
alt Changes pane was open
Store-->>ChangesCtrl: closed
ChangesCtrl->>SidebarStore: getWorkspaceSidebarTab(collections, workspaceId)
alt Sidebar is on Changes tab
SidebarStore-->>ChangesCtrl: "changes"
ChangesCtrl->>Page: setRightSidebarOpen(false)
Page->>Sidebar: Close sidebar
else Sidebar on Files/Review
SidebarStore-->>ChangesCtrl: other tab
Note over ChangesCtrl,Sidebar: Sidebar stays open (serving other content)
end
else Changes pane was closed
Store-->>ChangesCtrl: was open
ChangesCtrl->>Page: openChangesPaneInStore() + setRightSidebarOpen(true)
Page->>Sidebar: Open sidebar on Changes tab
end
Note over TabBar,Sidebar: Tab bar composition
Page->>TabBar: Render ChangesControl (h-7) + OpenInButton + SidebarToggle
Note over TabBar: OpenInButton no longer depends on sidebar open state
Page->>Sidebar: Render PRActionHeader (Pages menu + Run button only)
Note over Sidebar: Top strip back to Pages + Run, 48px height preserved
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| title={label} | ||
| className={cn( | ||
| "flex min-w-0 items-center gap-1 overflow-hidden px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", | ||
| "flex items-center gap-1 px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", |
There was a problem hiding this comment.
P2: Bound the stats face again by restoring min-w-0 overflow-hidden so large totals cannot expand this trailing control and crowd the pane tabs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/ChangesControl/ChangesControl.tsx, line 76:
<comment>Bound the stats face again by restoring `min-w-0 overflow-hidden` so large totals cannot expand this trailing control and crowd the pane tabs.</comment>
<file context>
@@ -73,11 +73,11 @@ export const ChangesControl = memo(function ChangesControl({
title={label}
className={cn(
- "flex min-w-0 items-center gap-1 overflow-hidden px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground",
+ "flex items-center gap-1 px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground",
isChangesOpen && "bg-accent/60 text-foreground",
)}
</file context>
| "flex items-center gap-1 px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", | |
| "flex min-w-0 items-center gap-1 overflow-hidden px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:text-foreground", |
It raced two worktree adds against git itself and failed on unrelated PRs with "failed to read .git/worktrees/a/commondir". Its own note said to retire it once it started failing. Co-Authored-By: Claude <noreply@anthropic.com>
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Reverses #7958. The Changes/PR control and the open-in button return to the pane tab bar's trailing slot, before the sidebar toggle, so they stay reachable while the right sidebar is closed. The sidebar's top strip is back to Pages and Run.
getWorkspaceSidebarTaband its test return.Screenshots from the dev app (sidebar open, Changes open, sidebar closed): https://app.superset.sh/page/ship-controls-back-in-the-tab-bar-379gxd
Verified over CDP: pills visible with the sidebar open and closed; one click opens the Changes pane and the sidebar on Changes, a second click closes both. Desktop typecheck, the 362 tests under the route, and Biome pass.
Co-Authored-By: Claude noreply@anthropic.com
Summary by cubic
Moves the Changes/PR control and open-in button back to the workspace tab bar's trailing slot, ahead of the sidebar toggle, so they stay reachable while the right sidebar is closed. The sidebar's top strip is back to Pages and Run, and the 48px strip height from #8023 is kept.
getWorkspaceSidebarTabread.Written for commit b61d4d4. Summary will update on new commits.
Summary by CodeRabbit
Also drops the host-service probe
bug-hunt-3: parallel workspace.create calls for different branches can race on the same .git/config. It raced two worktree adds against git itself and failed this PR's first run withfailed to read .git/worktrees/a/commondir; its own note said to retire it once it started failing.