diff options
| author | Adam <[email protected]> | 2025-12-22 04:37:10 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-22 05:46:07 -0600 |
| commit | 653c206688262c080cba988a237acd67da9e714f (patch) | |
| tree | e74c1d439ffe4a4ed31b318d0091dc702526c288 /packages/ui/src/components | |
| parent | 580f46b589e3cfdbf21d135ee61e2e258c76e46e (diff) | |
| download | opencode-653c206688262c080cba988a237acd67da9e714f.tar.gz opencode-653c206688262c080cba988a237acd67da9e714f.zip | |
feat(desktop): mobile responsiveness
Diffstat (limited to 'packages/ui/src/components')
| -rw-r--r-- | packages/ui/src/components/icon.tsx | 1 | ||||
| -rw-r--r-- | packages/ui/src/components/message-part.tsx | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/ui/src/components/icon.tsx b/packages/ui/src/components/icon.tsx index 8642be0f8..75a737d88 100644 --- a/packages/ui/src/components/icon.tsx +++ b/packages/ui/src/components/icon.tsx @@ -54,6 +54,7 @@ const icons = { photo: `<path d="M16.6665 16.6666L11.6665 11.6666L9.99984 13.3333L6.6665 9.99996L3.08317 13.5833M2.9165 2.91663H17.0832V17.0833H2.9165V2.91663ZM13.3332 7.49996C13.3332 8.30537 12.6803 8.95829 11.8748 8.95829C11.0694 8.95829 10.4165 8.30537 10.4165 7.49996C10.4165 6.69454 11.0694 6.04163 11.8748 6.04163C12.6803 6.04163 13.3332 6.69454 13.3332 7.49996Z" stroke="currentColor" stroke-linecap="square"/>`, share: `<path d="M10.0013 12.0846L10.0013 3.33464M13.7513 6.66797L10.0013 2.91797L6.2513 6.66797M17.0846 10.418V17.0846H2.91797V10.418" stroke="currentColor" stroke-linecap="square"/>`, download: `<path d="M13.9583 10.6257L10 14.584L6.04167 10.6257M10 2.08398V13.959M16.25 17.9173H3.75" stroke="currentColor" stroke-linecap="square"/>`, + menu: `<path d="M2.5 5H17.5M2.5 10H17.5M2.5 15H17.5" stroke="currentColor" stroke-linecap="square"/>`, } export interface IconProps extends ComponentProps<"svg"> { diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index f2fa0f320..4f0645bf8 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -5,9 +5,11 @@ import { FilePart, Message as MessageType, Part as PartType, + ReasoningPart, TextPart, ToolPart, UserMessage, + Todo, } from "@opencode-ai/sdk/v2" import { useData } from "../context" import { useDiffComponent } from "../context/diff" @@ -111,7 +113,7 @@ export type ToolInfo = { subtitle?: string } -export function getToolInfo(tool: string, input: Record<string, any> = {}): ToolInfo { +export function getToolInfo(tool: string, input: any = {}): ToolInfo { switch (tool) { case "read": return { @@ -186,8 +188,7 @@ export function getToolInfo(tool: string, input: Record<string, any> = {}): Tool } function getToolPartInfo(part: ToolPart): ToolInfo { - const state = part.state as any - const input = state.input || {} + const input = part.state.input || {} return getToolInfo(part.tool, input) } @@ -424,7 +425,7 @@ PART_MAPPING["text"] = function TextPartDisplay(props) { } PART_MAPPING["reasoning"] = function ReasoningPartDisplay(props) { - const part = props.part as any + const part = props.part as ReasoningPart return ( <Show when={part.text.trim()}> <div data-component="reasoning-part"> @@ -722,14 +723,14 @@ ToolRegistry.register({ trigger={{ title: "To-dos", subtitle: props.input.todos - ? `${props.input.todos.filter((t: any) => t.status === "completed").length}/${props.input.todos.length}` + ? `${props.input.todos.filter((t: Todo) => t.status === "completed").length}/${props.input.todos.length}` : "", }} > <Show when={props.input.todos?.length}> <div data-component="todos"> <For each={props.input.todos}> - {(todo: any) => ( + {(todo: Todo) => ( <Checkbox readOnly checked={todo.status === "completed"}> <div data-slot="message-part-todo-content" data-completed={todo.status === "completed"}> {todo.content} |
