From 887a819f2444c8454a43049983d831194883c6cd Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Fri, 17 Oct 2025 12:05:52 -0500 Subject: wip: desktop work --- packages/desktop/src/components/prompt-input.tsx | 2 +- packages/desktop/src/components/session-list.tsx | 38 ------------------- packages/desktop/src/context/sync.tsx | 5 ++- packages/desktop/src/index.css | 2 +- packages/desktop/src/pages/index.tsx | 48 ++++++++++++++++++++---- 5 files changed, 46 insertions(+), 49 deletions(-) delete mode 100644 packages/desktop/src/components/session-list.tsx (limited to 'packages/desktop/src') diff --git a/packages/desktop/src/components/prompt-input.tsx b/packages/desktop/src/components/prompt-input.tsx index 48d238401..0f8fb5930 100644 --- a/packages/desktop/src/components/prompt-input.tsx +++ b/packages/desktop/src/components/prompt-input.tsx @@ -187,7 +187,7 @@ export const PromptInput: Component = (props) => { return (
- {(session) => ( - - - - )} - - ) -} diff --git a/packages/desktop/src/context/sync.tsx b/packages/desktop/src/context/sync.tsx index 5d64f3ee7..5ba6b1af2 100644 --- a/packages/desktop/src/context/sync.tsx +++ b/packages/desktop/src/context/sync.tsx @@ -1,4 +1,4 @@ -import type { Message, Agent, Provider, Session, Part, Config, Path, File, FileNode } from "@opencode-ai/sdk" +import type { Message, Agent, Provider, Session, Part, Config, Path, File, FileNode, Project } from "@opencode-ai/sdk" import { createStore, produce, reconcile } from "solid-js/store" import { createContext, createMemo, Show, useContext, type ParentProps } from "solid-js" import { useSDK, useEvent } from "@/context" @@ -9,6 +9,7 @@ function init() { ready: boolean provider: Provider[] agent: Agent[] + project: Project config: Config path: Path session: Session[] @@ -21,6 +22,7 @@ function init() { node: FileNode[] changes: File[] }>({ + project: { id: "", worktree: "", time: { created: 0, initialized: 0 } }, config: {}, path: { state: "", config: "", worktree: "", directory: "" }, ready: false, @@ -96,6 +98,7 @@ function init() { const sdk = useSDK() const load = { + project: () => sdk.project.current().then((x) => setStore("project", x.data!)), provider: () => sdk.config.providers().then((x) => setStore("provider", x.data!.providers)), path: () => sdk.path.get().then((x) => setStore("path", x.data!)), agent: () => sdk.app.agents().then((x) => setStore("agent", x.data ?? [])), diff --git a/packages/desktop/src/index.css b/packages/desktop/src/index.css index b4717a4e8..4af87bca6 100644 --- a/packages/desktop/src/index.css +++ b/packages/desktop/src/index.css @@ -1 +1 @@ -@import "@opencode-ai/css/tailwind.css"; +@import "@opencode-ai/ui/styles/tailwind"; diff --git a/packages/desktop/src/pages/index.tsx b/packages/desktop/src/pages/index.tsx index 1174f1e16..4133887c9 100644 --- a/packages/desktop/src/pages/index.tsx +++ b/packages/desktop/src/pages/index.tsx @@ -1,4 +1,4 @@ -import { Icon, Tooltip } from "@opencode-ai/ui" +import { Button, Icon, List, Tooltip } from "@opencode-ai/ui" import { FileIcon, IconButton } from "@/ui" import FileTree from "@/components/file-tree" import EditorPane from "@/components/editor-pane" @@ -6,12 +6,12 @@ import { For, Match, onCleanup, onMount, Show, Switch } from "solid-js" import { SelectDialog } from "@/components/select-dialog" import { useSync, useSDK, useLocal } from "@/context" import type { LocalFile, TextSelection } from "@/context/local" -import SessionList from "@/components/session-list" import SessionTimeline from "@/components/session-timeline" -import PromptForm, { type PromptContentPart, type PromptSubmitValue } from "@/components/prompt-form" +import { type PromptContentPart, type PromptSubmitValue } from "@/components/prompt-form" import { createStore } from "solid-js/store" import { getDirectory, getFilename } from "@/utils" import { PromptInput } from "@/components/prompt-input" +import { DateTime } from "luxon" export default function Page() { const local = useLocal() @@ -225,13 +225,45 @@ export default function Page() { ) return ( -
- +
+
-
- +
+
+ {sync.data.path.directory} +
+
+
+ +
+ x.id} onSelect={(s) => local.session.setActive(s?.id)}> + {(session) => ( + +
+
+ + {session.title} + + + {DateTime.fromMillis(session.time.updated).toRelative()} + +
+
+ 2 files changed +
+ +43 + -2 +
+
+
+
+ )} +
+
-
+
{(activeSession) => } -- cgit v1.2.3