diff --git a/apps/desktop/scripts/dev.mjs b/apps/desktop/scripts/dev.mjs index 09ef74e5..f5875cb1 100644 --- a/apps/desktop/scripts/dev.mjs +++ b/apps/desktop/scripts/dev.mjs @@ -65,7 +65,10 @@ while (!(await ready())) await sleep(100); let electron; function startElectron() { - electron = run("node", ["scripts/start-electron.mjs"], { + // pnpm inserts a lone `--` before arguments meant for the script. + const extra = process.argv.slice(2); + if (extra[0] === "--") extra.shift(); + electron = run("node", ["scripts/start-electron.mjs", ...extra], { cwd: desktopDir, env: { ...process.env, CODEWORK_WEB_URL: WEB_URL }, }); diff --git a/apps/desktop/scripts/start-electron.mjs b/apps/desktop/scripts/start-electron.mjs index 65928a80..21182c3f 100644 --- a/apps/desktop/scripts/start-electron.mjs +++ b/apps/desktop/scripts/start-electron.mjs @@ -40,7 +40,8 @@ const electronPath = process.platform === "darwin" ? brandedElectron() : electro const env = { ...process.env }; delete env.ELECTRON_RUN_AS_NODE; -const child = spawn(electronPath, ["."], { +// Extra arguments reach Electron, `--remote-debugging-port=9222` say. +const child = spawn(electronPath, [".", ...process.argv.slice(2)], { stdio: "inherit", cwd: desktopDir, env, diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index db80c2a7..fcd177e8 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -117,10 +117,10 @@ function createMainWindow(): BrowserWindow { minWidth: 840, minHeight: 620, // The web shell draws its own title bar (workspace switcher) beside the - // inset traffic lights, which sit centered in its 48px height. + // inset traffic lights, which sit centered in its 40px height. ...(process.platform === "darwin" && { titleBarStyle: "hiddenInset", - trafficLightPosition: { x: 14, y: 18 }, + trafficLightPosition: { x: 14, y: 14 }, }), // Windows and Linux take the window's icon; macOS ignores it for the Dock's. icon: ICON, diff --git a/apps/web/index.html b/apps/web/index.html index f37396af..397bf2e9 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -1,5 +1,5 @@ - + @@ -7,7 +7,8 @@ @@ -22,10 +23,10 @@ /* The app's desktop tint (--cw-desktop in style.css), so the swap to the app does not shift colour. */ body { - background: color-mix(in oklab, var(--t-bg) 96%, var(--t-text)); + background: var(--cw-desktop, var(--t-bg)); color: var(--t-text); font: - 13px/1.4 system-ui, + var(--text-ui, 12px) / 1.4 var(--font-sans, system-ui), -apple-system, "Segoe UI", sans-serif; diff --git a/apps/web/src/components/composer.tsx b/apps/web/src/components/composer.tsx index 5d86972d..b1c187c9 100644 --- a/apps/web/src/components/composer.tsx +++ b/apps/web/src/components/composer.tsx @@ -1,5 +1,5 @@ import { CornerDownLeft, X, type LucideIcon } from "lucide-react"; -import type { ComponentProps, ReactNode, Ref } from "react"; +import type { ReactNode, Ref } from "react"; import { cn } from "@/lib/utils"; import { isMac } from "@codeworksh/widget/view"; @@ -48,10 +48,8 @@ export function Composer({ return (
{ @@ -84,12 +82,12 @@ export function Composer({ placeholder={placeholder} aria-label="Prompt" // Grows with its text, from four lines (one when compact) up to about nine, then scrolls. - className={`block max-h-52 w-full resize-none bg-transparent text-[14px] leading-relaxed text-ink outline-none [field-sizing:content] placeholder:text-ink-muted ${compact ? "min-h-6" : "min-h-19.5"}`} + className={`block max-h-52 w-full resize-none bg-transparent text-body text-ink outline-none [field-sizing:content] placeholder:text-ink-muted ${compact ? "min-h-6" : "min-h-19.5"}`} />
{/* Pulled left by a control's padding, so the first one's icon lines up with the prompt's text. */} -
+
{controls}
{actions} @@ -97,7 +95,7 @@ export function Composer({ {tray !== undefined && ( // Inset from the card's rounded corners, tucked under its bottom edge. -
+
{tray}
)} @@ -106,17 +104,7 @@ export function Composer({ } /** Shared expanded surface for starting a session and replying to one. */ -export function PromptComposer(props: ComponentProps) { - return ( - - ); -} +export const PromptComposer = Composer; export function ComposerHeader({ title, @@ -128,9 +116,9 @@ export function ComposerHeader({ readonly onClose?: () => void; }) { return ( -
- - {title} +
+ + {title} {onClose !== undefined && ( diff --git a/apps/web/src/kernel/servers.ts b/apps/web/src/kernel/servers.ts index ada99e74..cd34bd5f 100644 --- a/apps/web/src/kernel/servers.ts +++ b/apps/web/src/kernel/servers.ts @@ -17,6 +17,8 @@ export interface Problem { /** The default server's problem from its status; undefined while the app can work with it. */ export function problemOf(status: ServerStatus): Problem | undefined { const { cli, server } = status; + // An already running, compatible server is usable even without a local CLI. + if (server._tag === "Running") return undefined; if (cli === null) return { title: "CodeWork Isn't Installed", @@ -43,25 +45,25 @@ export function problemOf(status: ServerStatus): Problem | undefined { title: "Incompatible Server Version", line: `${status.name} runs codework v${server.version}, which this app can't read.`, }; - case "Running": - return undefined; } } /** * Every server's status, as the app server last checked it, kept current as it checks again. When - * the default server becomes usable, whatever failed while it was not loads again. + * the default server becomes usable or its home changes, its queries load again. */ export const serversAtom = Server.runtime .atom( Stream.suspend(() => { - let wasUsable: boolean | undefined; + let previous: { readonly home: string | undefined; readonly usable: boolean } | undefined; return Stream.unwrap(Server.use((client) => Effect.succeed(client("servers.watch", undefined)))).pipe( Stream.tap((statuses) => { - const now = statuses.some((status) => status.isDefault && problemOf(status) === undefined); - const recovered = wasUsable === false && now; - wasUsable = now; - return recovered ? Reactivity.invalidate(codeworkKey) : Effect.void; + const current = statuses.find((status) => status.isDefault); + const home = current?.home.path; + const usable = current !== undefined && problemOf(current) === undefined; + const refresh = usable && previous !== undefined && (!previous.usable || previous.home !== home); + previous = { home, usable }; + return refresh ? Reactivity.invalidate(codeworkKey) : Effect.void; }), // The app server is local, so a dropped stream is only a moment's gap. Stream.retry(Schedule.spaced("1 second")), diff --git a/apps/web/src/landing/landing.tsx b/apps/web/src/landing/landing.tsx index 7c013fbd..bcbdf6b2 100644 --- a/apps/web/src/landing/landing.tsx +++ b/apps/web/src/landing/landing.tsx @@ -80,16 +80,17 @@ export function Landing() {
- -
+ +

What would you like to work on?

+
{notice !== undefined && } } + header={} autoFocus value={query} onChange={setQuery} onSubmit={() => void send()} - placeholder="Ask for changes, send follow-ups, or attach images" + placeholder="Describe a task or ask a question…" controls={ <> } - actions={} + actions={} tray={ <> diff --git a/apps/web/src/landing/sidebar.tsx b/apps/web/src/landing/sidebar.tsx index c39e7ba1..38e48b07 100644 --- a/apps/web/src/landing/sidebar.tsx +++ b/apps/web/src/landing/sidebar.tsx @@ -75,20 +75,23 @@ export function SessionsSidebar() { aria-label="Search sessions" value={query} onChange={(event) => setQuery(event.target.value)} - className="h-8 rounded-lg border-transparent bg-transparent pl-8 text-sm shadow-none focus-visible:bg-ink/5" + className="h-7 rounded-md border-transparent bg-transparent pl-8 text-ui shadow-none focus-visible:bg-selection-subtle" />
- + +

+ Recent sessions +

{problem !== undefined ? ( {place.kind === "none" && result.value.length === 0 ? ( <> - No Projects Yet + No projects yet {addProject !== undefined && ( } onClick={addProject} > - Add Project + Add project )} ) : ( - No Sessions Yet + No sessions yet )} ) @@ -126,16 +129,16 @@ export function SessionsSidebar() { type="button" title={`${session.project.path}\n${isMac ? "⌘" : "Ctrl"}-click opens it in a new frame\n⇧-click opens it in a new workspace`} aria-current={sessionAddress(session.id) === current ? "true" : undefined} - className="block w-full rounded-lg px-2.5 py-2 text-left transition-colors outline-none hover:bg-ink/5 focus-visible:bg-ink/5 aria-current:bg-ink/8" + className="block w-full rounded-md px-2.5 py-2 text-left outline-none hover:bg-selection-subtle focus-visible:ring-2 focus-visible:ring-ring aria-current:bg-selection" onClick={(event) => open(session, event)} onAuxClick={(event) => open(session, event)} > -
+
{session.project.name} {ago(session.updated)}
-
{session.title}
+
{session.title}
))} diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index f7abeb33..f2793399 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -15,11 +15,11 @@ function Root() { return ( -
+
{inSettings ? : }
diff --git a/apps/web/src/settings/blocks.tsx b/apps/web/src/settings/blocks.tsx index b0c92e5b..31030ac2 100644 --- a/apps/web/src/settings/blocks.tsx +++ b/apps/web/src/settings/blocks.tsx @@ -16,10 +16,10 @@ export function Page({ children: ReactNode; }) { return ( -
+
-

{title}

+

{title}

{actions}
{description !== undefined &&

{description}

} @@ -31,8 +31,8 @@ export function Page({ export function Section({ title, children }: { title: string; children: ReactNode }) { return ( -
-

{title}

+
+

{title}

{children}
); @@ -54,10 +54,10 @@ export function Row({ children?: ReactNode; }) { return ( -
+
{title} - {description !== undefined && {description}} + {description !== undefined && {description}}
{children}
diff --git a/apps/web/src/settings/layout.tsx b/apps/web/src/settings/layout.tsx index b732e00e..318d7979 100644 --- a/apps/web/src/settings/layout.tsx +++ b/apps/web/src/settings/layout.tsx @@ -26,7 +26,7 @@ export function SettingsSidebar() { return ( -

Settings

+

Settings

setQuery(event.target.value)} onKeyDown={(event) => { const first = matches[0]; @@ -65,7 +65,7 @@ export function SettingsSidebar() { diff --git a/apps/web/src/settings/themes.tsx b/apps/web/src/settings/themes.tsx index d2f3c91f..e56de930 100644 --- a/apps/web/src/settings/themes.tsx +++ b/apps/web/src/settings/themes.tsx @@ -20,7 +20,7 @@ export function ThemesSettings() { } >
-
+
{THEMES.map((theme) => { const selected = theme.id === current; return ( diff --git a/apps/web/src/shell/navigation.tsx b/apps/web/src/shell/navigation.tsx index b6c0ac19..e5c05853 100644 --- a/apps/web/src/shell/navigation.tsx +++ b/apps/web/src/shell/navigation.tsx @@ -9,7 +9,7 @@ export function Navigation() { return (