Repository navigation
fix(desktop): move the ship controls back into the workspace tab bar #8057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ interface ChangesControlProps { | |||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Sidebar-strip Changes control: one bordered button with a single face covering | ||||||
| * Tab-bar Changes control: one bordered button with a single face covering | ||||||
| * the branch's whole lifecycle. Before a PR exists the face is the diff | ||||||
| * stats with the ship actions (commit → push → create PR) in the chevron — | ||||||
| * or the ship action itself once the tree is clean; once a PR exists the | ||||||
|
|
@@ -64,7 +64,7 @@ export const ChangesControl = memo(function ChangesControl({ | |||||
| !hasPr && stats != null && stats.fileCount > 0 ? stats : null; | ||||||
|
|
||||||
| return ( | ||||||
| <div className="flex h-6 items-stretch divide-x divide-border/60 overflow-hidden rounded-md border border-border/60 bg-muted/30 empty:hidden"> | ||||||
| <div className="flex h-7 items-stretch divide-x divide-border/60 overflow-hidden rounded-md border border-border/60 bg-muted/30 empty:hidden"> | ||||||
| {visibleStats && ( | ||||||
| <button | ||||||
| type="button" | ||||||
|
|
@@ -73,11 +73,11 @@ export const ChangesControl = memo(function ChangesControl({ | |||||
| aria-pressed={isChangesOpen} | ||||||
| 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", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Bound the stats face again by restoring Prompt for AI agents
Suggested change
|
||||||
| isChangesOpen && "bg-accent/60 text-foreground", | ||||||
| )} | ||||||
| > | ||||||
| <GitCompareArrows className="size-3.5 shrink-0" /> | ||||||
| <GitCompareArrows className="size-3.5" /> | ||||||
| {visibleStats.additions > 0 && ( | ||||||
| <span className="tabular-nums text-emerald-600 [.dark_&]:text-[#34d399]"> | ||||||
| +{visibleStats.additions} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export { | ||
| DEFAULT_WORKSPACE_SIDEBAR_TAB, | ||
| getWorkspaceSidebarTab, | ||
| setWorkspaceSidebarTab, | ||
| } from "./setWorkspaceSidebarTab"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import { beforeEach, describe, expect, it } from "bun:test"; | ||
| import { useRowlessSidebarTabStore } from "../../state/rowlessSidebarTabStore"; | ||
| import { setWorkspaceSidebarTab } from "./setWorkspaceSidebarTab"; | ||
| import { | ||
| getWorkspaceSidebarTab, | ||
| setWorkspaceSidebarTab, | ||
| } from "./setWorkspaceSidebarTab"; | ||
|
|
||
| type Collections = Parameters<typeof setWorkspaceSidebarTab>[0]; | ||
|
|
||
|
|
@@ -45,6 +48,17 @@ describe("setWorkspaceSidebarTab", () => { | |
| expect(useRowlessSidebarTabStore.getState().tabs["main-ws"]).toBe("files"); | ||
| }); | ||
|
|
||
| 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"); | ||
| }); | ||
|
Comment on lines
+51
to
+60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 AIThis 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. |
||
|
|
||
| it("keeps rowless choices per workspace", () => { | ||
| const collections = stubCollections({}); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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!