diff --git a/packages/app/src/components/dialog-select-model.tsx b/packages/app/src/components/dialog-select-model.tsx index d54f9369af1..c614c2d497f 100644 --- a/packages/app/src/components/dialog-select-model.tsx +++ b/packages/app/src/components/dialog-select-model.tsx @@ -7,6 +7,8 @@ import { Button } from "@opencode-ai/ui/button" import { Tag } from "@opencode-ai/ui/tag" import { Dialog } from "@opencode-ai/ui/dialog" import { List } from "@opencode-ai/ui/list" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import type { IconName } from "@opencode-ai/ui/icons/provider" import { DialogSelectProvider } from "./dialog-select-provider" import { DialogManageModels } from "./dialog-manage-models" @@ -35,6 +37,12 @@ const ModelList: Component<{ filterKeys={["provider.name", "name", "id"]} sortBy={(a, b) => a.name.localeCompare(b.name)} groupBy={(x) => x.provider.name} + groupHeader={(group) => ( +
+ + {group.category} +
+ )} sortGroupsBy={(a, b) => { if (a.category === "Recent" && b.category !== "Recent") return -1 if (b.category === "Recent" && a.category !== "Recent") return 1 @@ -52,7 +60,8 @@ const ModelList: Component<{ }} > {(i) => ( -
+
+ {i.name} Free diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 13f2b00a375..2be8a21c1d6 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -33,6 +33,8 @@ import { useSync } from "@/context/sync" import { FileIcon } from "@opencode-ai/ui/file-icon" import { Button } from "@opencode-ai/ui/button" import { Icon } from "@opencode-ai/ui/icon" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import type { IconName } from "@opencode-ai/ui/icons/provider" import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" import { IconButton } from "@opencode-ai/ui/icon-button" import { Select } from "@opencode-ai/ui/select" @@ -1560,6 +1562,12 @@ export const PromptInput: Component = (props) => { fallback={ @@ -1569,6 +1577,12 @@ export const PromptInput: Component = (props) => { @@ -1583,10 +1597,10 @@ export const PromptInput: Component = (props) => { > diff --git a/packages/ui/src/components/button.css b/packages/ui/src/components/button.css index 800795e8783..c25b89af993 100644 --- a/packages/ui/src/components/button.css +++ b/packages/ui/src/components/button.css @@ -123,13 +123,13 @@ &[data-size="normal"] { height: 24px; + line-height: 24px; padding: 0 6px; &[data-icon] { padding: 0 12px 0 4px; } font-size: var(--font-size-small); - line-height: var(--line-height-large); gap: 6px; /* text-12-medium */ @@ -137,7 +137,6 @@ font-size: var(--font-size-small); font-style: normal; font-weight: var(--font-weight-medium); - line-height: var(--line-height-large); /* 166.667% */ letter-spacing: var(--letter-spacing-normal); } diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx index 1283b30232f..8c92728d7b1 100644 --- a/packages/ui/src/components/list.tsx +++ b/packages/ui/src/components/list.tsx @@ -10,9 +10,15 @@ export interface ListSearchProps { autofocus?: boolean } +export interface ListGroup { + category: string + items: T[] +} + export interface ListProps extends FilteredListProps { class?: string children: (item: T) => JSX.Element + groupHeader?: (group: ListGroup) => JSX.Element emptyMessage?: string onKeyEvent?: (event: KeyboardEvent, item: T | undefined) => void onMove?: (item: T | undefined) => void @@ -116,7 +122,7 @@ export function List(props: ListProps & { ref?: (ref: ListRef) => void }) setScrollRef, }) - function GroupHeader(props: { category: string }): JSX.Element { + function GroupHeader(groupProps: { category: string; children?: JSX.Element }): JSX.Element { const [stuck, setStuck] = createSignal(false) const [header, setHeader] = createSignal(undefined) @@ -138,7 +144,7 @@ export function List(props: ListProps & { ref?: (ref: ListRef) => void }) return (
- {props.category} + {groupProps.children ?? groupProps.category}
) } @@ -185,7 +191,7 @@ export function List(props: ListProps & { ref?: (ref: ListRef) => void }) {(group) => (
- + {props.groupHeader?.(group)}
diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index 9947578b908..ae1321bac14 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -22,6 +22,8 @@ import { Accordion } from "./accordion" import { StickyAccordionHeader } from "./sticky-accordion-header" import { FileIcon } from "./file-icon" import { Icon } from "./icon" +import { ProviderIcon } from "./provider-icon" +import type { IconName } from "./provider-icons/types" import { IconButton } from "./icon-button" import { Tooltip } from "./tooltip" import { Card } from "./card" @@ -498,7 +500,13 @@ export function SessionTurn( {(msg() as UserMessage).agent} - {(msg() as UserMessage).model?.modelID} + + + {(msg() as UserMessage).model?.modelID} + {(msg() as UserMessage).variant || "default"}