Skip to content

Commit c0727f3

Browse files
committed
fix: improve default model star styling and add tooltip
1 parent 6f510b0 commit c0727f3

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

src/browser/components/ModelSelector.tsx

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import React, {
88
} from "react";
99
import { cn } from "@/common/lib/utils";
1010
import { Star } from "lucide-react";
11+
import { TooltipWrapper, Tooltip } from "./Tooltip";
1112

1213
interface ModelSelectorProps {
1314
value: string;
@@ -251,31 +252,38 @@ export const ModelSelector = forwardRef<ModelSelectorRef, ModelSelectorProps>(
251252
<span className="truncate flex-1 min-w-0">{model}</span>
252253
<div className="flex items-center gap-1 shrink-0">
253254
{onSetDefaultModel && (
254-
<button
255-
type="button"
256-
onMouseDown={(e) => e.preventDefault()}
257-
onClick={(event) => {
258-
event.preventDefault();
259-
event.stopPropagation();
260-
const isDefault = defaultModel === model;
261-
// If it's already the default, do nothing (cannot unset)
262-
if (!isDefault) {
263-
onSetDefaultModel(model);
255+
<TooltipWrapper inline>
256+
<button
257+
type="button"
258+
onMouseDown={(e) => e.preventDefault()}
259+
onClick={(event) => {
260+
event.preventDefault();
261+
event.stopPropagation();
262+
const isDefault = defaultModel === model;
263+
// If it's already the default, do nothing (cannot unset)
264+
if (!isDefault) {
265+
onSetDefaultModel(model);
266+
}
267+
}}
268+
className={cn(
269+
"rounded-sm border px-1 py-0.5 transition-colors duration-150 flex items-center justify-center",
270+
defaultModel === model
271+
? "text-yellow-400 border-yellow-400/40 cursor-default"
272+
: "text-muted-light border-border-light/40 hover:border-foreground/60 hover:text-foreground"
273+
)}
274+
aria-label={
275+
defaultModel === model ? "Current default model" : "Set as default model"
264276
}
265-
}}
266-
className={cn(
267-
"rounded-sm border px-1 py-0.5 transition-colors duration-150 flex items-center justify-center",
268-
defaultModel === model
269-
? "text-yellow-400 border-yellow-400/40 cursor-default"
270-
: "text-muted-light border-border-light/40 hover:border-foreground/60 hover:text-foreground"
271-
)}
272-
aria-label={
273-
defaultModel === model ? "Current default model" : "Set as default model"
274-
}
275-
disabled={defaultModel === model}
276-
>
277-
<Star className={cn("h-3 w-3", defaultModel === model && "fill-current")} />
278-
</button>
277+
disabled={defaultModel === model}
278+
>
279+
<Star
280+
className={cn("h-3 w-3")}
281+
/>
282+
</button>
283+
<Tooltip className="tooltip" align="center">
284+
{defaultModel === model ? "Current default model" : "Set as default model"}
285+
</Tooltip>
286+
</TooltipWrapper>
279287
)}
280288
{onRemoveModel && defaultModel !== model && (
281289
<button

0 commit comments

Comments
 (0)