Show PR numbers without the # and make header buttons icon-only
PR badges in the sidebar rows, hover card, and right-sidebar PR tab now show the number alone. The Scripts and Open-in-editor header buttons drop their labels and gain a min height so they keep the same size icon-only.
This commit is contained in:
@@ -335,7 +335,7 @@ export function PrBadge({ hint }: { hint: PrHint }) {
|
|||||||
<ThemedGitPullRequest size={12} uniProps={iconUniProps} />
|
<ThemedGitPullRequest size={12} uniProps={iconUniProps} />
|
||||||
)}
|
)}
|
||||||
<Text style={textStyle} numberOfLines={1}>
|
<Text style={textStyle} numberOfLines={1}>
|
||||||
#{hint.number}
|
{hint.number}
|
||||||
</Text>
|
</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ function PrBadge({ hint }: { hint: PrHint }) {
|
|||||||
<ThemedGitPullRequest size={12} uniProps={iconUniProps} />
|
<ThemedGitPullRequest size={12} uniProps={iconUniProps} />
|
||||||
)}
|
)}
|
||||||
<Text style={textStyle} numberOfLines={1}>
|
<Text style={textStyle} numberOfLines={1}>
|
||||||
#{hint.number}
|
{hint.number}
|
||||||
</Text>
|
</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { describe, expect, it } from "vitest";
|
|||||||
import { formatPrTabLabel } from "./tab-label";
|
import { formatPrTabLabel } from "./tab-label";
|
||||||
|
|
||||||
describe("formatPrTabLabel", () => {
|
describe("formatPrTabLabel", () => {
|
||||||
it("returns #<number> when a pull request number is present", () => {
|
it("returns the number when a pull request number is present", () => {
|
||||||
expect(formatPrTabLabel(42)).toBe("#42");
|
expect(formatPrTabLabel(42)).toBe("42");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns #— fallback when the pull request number is null", () => {
|
it("returns the — fallback when the pull request number is null", () => {
|
||||||
expect(formatPrTabLabel(null)).toBe("#—");
|
expect(formatPrTabLabel(null)).toBe("—");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export function formatPrTabLabel(prNumber: number | null): string {
|
export function formatPrTabLabel(prNumber: number | null): string {
|
||||||
return prNumber === null ? "#—" : `#${prNumber}`;
|
return prNumber === null ? "—" : `${prNumber}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
gap: theme.spacing[2],
|
gap: theme.spacing[2],
|
||||||
|
minHeight: theme.fontSize.sm * 1.5,
|
||||||
},
|
},
|
||||||
splitButtonSpinnerOnly: {
|
splitButtonSpinnerOnly: {
|
||||||
transform: [{ scale: 0.8 }],
|
transform: [{ scale: 0.8 }],
|
||||||
|
|||||||
@@ -3390,7 +3390,7 @@ function WorkspaceScreenContent({
|
|||||||
onScriptTerminalStarted={handleScriptTerminalStarted}
|
onScriptTerminalStarted={handleScriptTerminalStarted}
|
||||||
onViewTerminal={handleViewScriptTerminal}
|
onViewTerminal={handleViewScriptTerminal}
|
||||||
onOpenUrlInBrowserTab={handleOpenUrlInBrowserTab}
|
onOpenUrlInBrowserTab={handleOpenUrlInBrowserTab}
|
||||||
hideLabels={showCompactButtonLabels}
|
hideLabels
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{!isMobile && workspaceDirectory ? (
|
{!isMobile && workspaceDirectory ? (
|
||||||
@@ -3398,7 +3398,7 @@ function WorkspaceScreenContent({
|
|||||||
serverId={normalizedServerId}
|
serverId={normalizedServerId}
|
||||||
cwd={workspaceDirectory}
|
cwd={workspaceDirectory}
|
||||||
activeFile={activeFileLocation}
|
activeFile={activeFileLocation}
|
||||||
hideLabels={showCompactButtonLabels}
|
hideLabels
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{!isMobile && isGitCheckout ? (
|
{!isMobile && isGitCheckout ? (
|
||||||
|
|||||||
@@ -542,6 +542,7 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
gap: theme.spacing[1.5],
|
gap: theme.spacing[1.5],
|
||||||
|
minHeight: theme.fontSize.sm * 1.5,
|
||||||
},
|
},
|
||||||
scriptList: {
|
scriptList: {
|
||||||
paddingVertical: theme.spacing[1],
|
paddingVertical: theme.spacing[1],
|
||||||
|
|||||||
Reference in New Issue
Block a user