Skip to content

Commit 71ebf11

Browse files
committed
Match branch selector trigger to other outline buttons
1 parent 969aa2e commit 71ebf11

3 files changed

Lines changed: 23 additions & 21 deletions

File tree

apps/code/src/renderer/components/ui/combobox/Combobox.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381

382382
.combobox-trigger.size-1 {
383383
height: var(--space-5);
384-
gap: var(--space-1);
384+
gap: var(--space-2);
385385
font-size: var(--font-size-1);
386386
line-height: var(--line-height-1);
387387
letter-spacing: var(--letter-spacing-1);
@@ -586,7 +586,7 @@
586586
}
587587

588588
.combobox-trigger.variant-outline {
589-
color: var(--gray-11);
589+
color: var(--gray-12);
590590
background-color: transparent;
591591
box-shadow: inset 0 0 0 1px var(--gray-a7);
592592
}
@@ -609,7 +609,7 @@
609609
}
610610

611611
.combobox-trigger.variant-outline .combobox-trigger-icon {
612-
color: var(--gray-11);
612+
color: var(--gray-12);
613613
}
614614

615615
.combobox-trigger:disabled .combobox-trigger-icon {

apps/code/src/renderer/components/ui/combobox/Combobox.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { CaretDown, Check, MagnifyingGlass } from "@phosphor-icons/react";
2-
import { Popover } from "@radix-ui/themes";
1+
import { Check, MagnifyingGlass } from "@phosphor-icons/react";
2+
import { ChevronDownIcon } from "@radix-ui/react-icons";
3+
import { Button, Flex, Popover } from "@radix-ui/themes";
4+
import type { Responsive } from "@radix-ui/themes/dist/esm/props/prop-def.js";
35
import { Command as CmdkCommand } from "cmdk";
46
import React, {
57
createContext,
@@ -150,7 +152,7 @@ function ComboboxRoot({
150152
interface ComboboxTriggerProps {
151153
children?: React.ReactNode;
152154
className?: string;
153-
variant?: ComboboxTriggerVariant;
155+
variant?: "outline" | "ghost" | "surface" | "soft" | "classic";
154156
color?: string;
155157
placeholder?: string;
156158
style?: React.CSSProperties;
@@ -159,33 +161,33 @@ interface ComboboxTriggerProps {
159161
function ComboboxTrigger({
160162
children,
161163
className = "",
162-
variant = "surface",
164+
variant = "outline",
163165
placeholder = "Select...",
164166
style,
165167
}: ComboboxTriggerProps) {
166168
const { size, value, open, disabled, getItemLabel } = useComboboxContext();
167169

168170
const displayValue =
169171
children ?? (getItemLabel(value) || value || placeholder);
170-
const hasPlaceholder = !children && !value;
171172

172173
return (
173174
<Popover.Trigger>
174-
<button
175-
type="button"
176-
className={`combobox-trigger size-${size} variant-${variant} ${className}`}
177-
data-state={open ? "open" : "closed"}
178-
data-placeholder={hasPlaceholder ? "" : undefined}
175+
<Button
176+
color="gray"
177+
variant={variant}
178+
size={size as Responsive<"1" | "2" | "3">}
179179
disabled={disabled}
180+
className={className}
181+
data-state={open ? "open" : "closed"}
180182
style={style}
181183
>
182-
<span className="combobox-trigger-inner">{displayValue}</span>
183-
{!disabled && (
184-
<span className="combobox-trigger-icon">
185-
<CaretDown weight="bold" />
186-
</span>
187-
)}
188-
</button>
184+
<Flex justify="between" align="center" gap="2">
185+
<Flex align="center" gap="2" style={{ minWidth: 0 }}>
186+
{displayValue}
187+
</Flex>
188+
{!disabled && <ChevronDownIcon style={{ flexShrink: 0 }} />}
189+
</Flex>
190+
</Button>
189191
</Popover.Trigger>
190192
);
191193
}

apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function BranchSelector({
122122
effectiveLoading || (isCloudMode && open && cloudBranchesFetchingMore);
123123

124124
const triggerContent = (
125-
<Flex align="center" gap="1" style={{ minWidth: 0 }}>
125+
<Flex align="center" gap="2" style={{ minWidth: 0 }}>
126126
{showSpinner ? (
127127
<Spinner size="1" />
128128
) : (

0 commit comments

Comments
 (0)