From 0e2b0929d04c9e824f3677558d1fdb56688801a9 Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Fri, 20 Nov 2026 19:29:33 -0800 Subject: [PATCH 1/5] feat(desktop): the sidebar reads in a light system, and a new version is one quiet press (#16 #21) The window's skin was cut for the dark scheme but dressed every scheme: on a system set to light the sidebar stayed black under dark ink, so every title in it but the lit one vanished. The dark values are now scoped to the dark scheme and light takes the app's own floor and card. e2e-tests/appearance.spec.ts measures each sidebar title against its ground (WCAG 4.5:1) in both schemes; on the old skin the light run reads 1.0:1. The main window had no update prompt (the banner lived in the old layout). The bar now says "Update available" beside Local AI when the feed names a newer version, checked once the window is up and every half hour; one press downloads, installs, stops the node and opens Hanzo again (the installer does the restart on Windows). A failure says so and can be pressed again. Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV --- .../e2e-tests/appearance.spec.ts | 76 ++++++++ .../src/__tests__/update.test.tsx | 164 ++++++++++++++++++ apps/hanzo-desktop/src/app.css | 17 +- apps/hanzo-desktop/src/host.tsx | 13 +- apps/hanzo-desktop/src/update.tsx | 143 +++++++++++++++ 5 files changed, 408 insertions(+), 5 deletions(-) create mode 100644 apps/hanzo-desktop/e2e-tests/appearance.spec.ts create mode 100644 apps/hanzo-desktop/src/__tests__/update.test.tsx create mode 100644 apps/hanzo-desktop/src/update.tsx diff --git a/apps/hanzo-desktop/e2e-tests/appearance.spec.ts b/apps/hanzo-desktop/e2e-tests/appearance.spec.ts new file mode 100644 index 00000000..7018e1fa --- /dev/null +++ b/apps/hanzo-desktop/e2e-tests/appearance.spec.ts @@ -0,0 +1,76 @@ +/** + * The window reads in both schemes — measured, not reviewed. + * + * The window's skin (src/app.css) is cut for the dark scheme; left unscoped it + * also dressed a window whose reader's system is light: the sidebar stayed + * black under dark ink, so every title in it but the lit one vanished and a + * non-developer saw a column of nothing. Each label in the sidebar must read + * (WCAG 4.5:1) on whatever it sits on, in light and in dark. + */ +import { expect, type Page, test } from '@playwright/test'; + +async function enter(page: Page) { + await page.setViewportSize({ width: 1280, height: 900 }); + await page.goto('/'); + await page.getByRole('button', { name: /Not now|Continue without login/ }).click(); + await expect(page.locator('[data-slot="app-column"]')).toBeVisible({ timeout: 30_000 }); +} + +type Reading = { label: string; ratio: number }; + +/** Every title in the sidebar, with its contrast against what is painted behind it. */ +async function sidebar(page: Page): Promise { + return page.evaluate(() => { + const parse = (c: string): number[] | null => { + const m = c.match(/rgba?\(([^)]+)\)/); + if (!m) return null; + const [r = 0, g = 0, b = 0, a = 1] = m[1]!.split(/[ ,/]+/).filter(Boolean).map(Number); + return [r, g, b, a]; + }; + const over = (top: number[], under: number[]) => { + const a = top[3]!; + return [0, 1, 2].map((i) => top[i]! * a + under[i]! * (1 - a)).concat(1); + }; + const ground = (el: Element): number[] => { + const chain: number[][] = []; + for (let n: Element | null = el; n; n = n.parentElement) { + const c = parse(getComputedStyle(n).backgroundColor); + if (c && c[3]! > 0) chain.push(c); + if (c && c[3] === 1) break; + } + return chain.reduceRight((under, c) => over(c, under), [255, 255, 255, 1]); + }; + const lum = (c: number[]) => { + const [r, g, b] = c.map((v) => { + const s = v! / 255; + return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4; + }); + return 0.2126 * r! + 0.7152 * g! + 0.0722 * b!; + }; + const out: { label: string; ratio: number }[] = []; + const column = document.querySelector('[data-slot="app-column"]')!; + for (const el of column.querySelectorAll('button, a')) { + const label = (el.textContent ?? '').trim(); + if (!label || (el as HTMLElement).offsetParent === null) continue; + const fg = parse(getComputedStyle(el).color); + if (!fg) continue; + const bg = ground(el); + const text = over(fg, bg); + const [hi, lo] = [lum(text), lum(bg)].sort((a, b) => b - a); + out.push({ label, ratio: (hi! + 0.05) / (lo! + 0.05) }); + } + return out; + }); +} + +for (const scheme of ['light', 'dark'] as const) { + test(`every title in the sidebar reads in the ${scheme} scheme`, async ({ page }) => { + await page.emulateMedia({ colorScheme: scheme }); + await enter(page); + const read = await sidebar(page); + const names = read.map((r) => r.label); + expect(names, 'the rail names its apps').toEqual(expect.arrayContaining(['Chat', 'Dev', 'Library'])); + for (const r of read) expect(r.ratio, `${r.label} on the ${scheme} sidebar`).toBeGreaterThanOrEqual(4.5); + await page.screenshot({ path: `${process.env.SHOT_DIR ?? 'test-results'}/sidebar-${scheme}.png` }); + }); +} diff --git a/apps/hanzo-desktop/src/__tests__/update.test.tsx b/apps/hanzo-desktop/src/__tests__/update.test.tsx new file mode 100644 index 00000000..df0a5776 --- /dev/null +++ b/apps/hanzo-desktop/src/__tests__/update.test.tsx @@ -0,0 +1,164 @@ +/** + * The bar's update mark, exercised through the plugin calls it makes. + * + * Nothing shows until the feed names a newer version; then one quiet line; + * one press installs it and opens Hanzo again, and a failure is said and can be + * pressed again. The Tauri plugins are the boundary and are replaced here. + */ +import { act, fireEvent, render, screen } from '@testing-library/react'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + +const plugin = vi.hoisted(() => ({ + check: vi.fn(), + relaunch: vi.fn(async () => undefined), + invoke: vi.fn(async () => undefined), + platform: vi.fn(() => 'macos'), +})); + +vi.mock('@tauri-apps/plugin-updater', () => ({ check: plugin.check })); +vi.mock('@tauri-apps/plugin-process', () => ({ relaunch: plugin.relaunch })); +vi.mock('@tauri-apps/plugin-os', () => ({ platform: plugin.platform })); +vi.mock('@tauri-apps/api/core', () => ({ invoke: plugin.invoke })); +vi.mock('../utils/tauri-check', () => ({ isTauriAvailable: () => true })); + +import { GuiProvider } from '@hanzo/gui'; + +import config from '../../gui.config'; +import { percent, say, Update } from '../update'; + +type Event = { event: 'Started'; data: { contentLength: number } } | { event: 'Progress'; data: { chunkLength: number } } | { event: 'Finished' }; + +function release(play: (emit: (e: Event) => void) => Promise) { + return { + available: true, + version: '1.2.0', + downloadAndInstall: vi.fn(async (onEvent: (e: Event) => void) => play(onEvent)), + }; +} + +const mount = () => + render( + + + , + ); + +/** Let the first check (15 s in) answer. */ +async function opened() { + await act(async () => { + await vi.advanceTimersByTimeAsync(15_000); + }); +} + +describe('the update mark', () => { + beforeEach(() => { + vi.useFakeTimers(); + for (const m of [plugin.check, plugin.relaunch, plugin.invoke]) m.mockClear(); + plugin.platform.mockReturnValue('macos'); + }); + afterEach(() => vi.useRealTimers()); + + it('says nothing when the feed has nothing newer', async () => { + plugin.check.mockResolvedValue(null); + mount(); + await opened(); + expect(plugin.check).toHaveBeenCalledTimes(1); + expect(screen.queryByText(/Update/)).toBeNull(); + }); + + it('says nothing when the feed cannot be read', async () => { + plugin.check.mockRejectedValue(new Error('offline')); + mount(); + await opened(); + expect(screen.queryByText(/Update/)).toBeNull(); + }); + + it('shows one quiet line for a newer version, and asks again every half hour', async () => { + plugin.check.mockResolvedValue(release(async () => undefined)); + mount(); + await opened(); + const mark = screen.getByRole('button', { name: /Hanzo 1\.2\.0 is ready/ }); + expect(mark).toHaveTextContent('Update available'); + await act(async () => { + await vi.advanceTimersByTimeAsync(30 * 60 * 1000); + }); + expect(plugin.check).toHaveBeenCalledTimes(2); + }); + + it('installs on one press: progress, the node stopped, Hanzo opened again', async () => { + let step: (e: Event) => void = () => undefined; + let finish: () => void = () => undefined; + plugin.check.mockResolvedValue( + release( + (emit) => + new Promise((resolve) => { + step = emit; + finish = resolve; + }), + ), + ); + mount(); + await opened(); + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: /is ready/ })); + }); + expect(screen.getByText('Updating…')).toBeInTheDocument(); + await act(async () => { + step({ event: 'Started', data: { contentLength: 200 } }); + step({ event: 'Progress', data: { chunkLength: 50 } }); + }); + expect(screen.getByText('Updating… 25%')).toBeInTheDocument(); + await act(async () => { + step({ event: 'Finished' }); + finish(); + }); + expect(plugin.invoke).toHaveBeenCalledWith('hanzo_node_kill'); + expect(plugin.relaunch).toHaveBeenCalledTimes(1); + }); + + it('leaves the restart to the installer on Windows', async () => { + plugin.platform.mockReturnValue('windows'); + plugin.check.mockResolvedValue(release(async () => undefined)); + mount(); + await opened(); + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: /is ready/ })); + }); + expect(plugin.relaunch).not.toHaveBeenCalled(); + }); + + it('says a failed install and can be pressed again', async () => { + const rel = release(async () => { + throw new Error('disk full'); + }); + plugin.check.mockResolvedValue(rel); + mount(); + await opened(); + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: /is ready/ })); + }); + const again = screen.getByRole('button', { name: /could not be installed/ }); + expect(again).toHaveTextContent('Update didn’t finish. Try again'); + expect(plugin.relaunch).not.toHaveBeenCalled(); + await act(async () => { + fireEvent.click(again); + }); + expect(rel.downloadAndInstall).toHaveBeenCalledTimes(2); + }); +}); + +describe('what the bar says', () => { + it('reads progress as whole percent, and nothing until the size is known', () => { + expect(percent(50, 200)).toBe(25); + expect(percent(201, 200)).toBe(100); + expect(percent(10, undefined)).toBeNull(); + expect(percent(10, 0)).toBeNull(); + }); + + it('presses only while there is something to install or retry', () => { + expect(say({ name: 'none' })).toBeNull(); + expect(say({ name: 'ready', version: '1.2.0' })?.press).toBe(true); + expect(say({ name: 'updating', version: '1.2.0', percent: 5 })?.press).toBe(false); + expect(say({ name: 'failed', version: '1.2.0' })?.press).toBe(true); + }); +}); diff --git a/apps/hanzo-desktop/src/app.css b/apps/hanzo-desktop/src/app.css index ca39ce07..a399f571 100644 --- a/apps/hanzo-desktop/src/app.css +++ b/apps/hanzo-desktop/src/app.css @@ -14,7 +14,7 @@ * it appends at runtime, after this sheet, so an equal selector would lose on * order alone. One extra type selector wins on specificity instead. */ -html:root { +html:root:not(.t_light):not(.light) { /* Unified Hanzo Dev obsidian outer floor & inset rounded stage pane. */ --pane-floor: #050505; --pane-fill: #0f0f12; @@ -31,6 +31,19 @@ html:root { --desk-surface: #111114; } +/* LIGHT: the same cut in the app's own light ground. The dark values above are + scoped to the dark scheme: left on `html:root` they also dressed a window + whose reader's system is light, so the sidebar stayed black under dark ink + and every title in it but the lit one disappeared. Here the sidebar and the + stage take the app's floor and card, and the hairlines go dark. */ +html:root.t_light, +html:root.light { + --desk-panel: var(--pane-floor); + --desk-panel-lit: none; + --desk-panel-edge: var(--pane-edge, var(--border)); + --desk-surface: var(--pane-fill, var(--card)); +} + /* THE WINDOW has no lamp: pure obsidian #050505 floor. */ [data-slot='window'] { background-color: var(--pane-floor) !important; @@ -201,7 +214,7 @@ html:root { } /* THE COMPOSER: a shade of the sidebar's, darker than its ground. */ -html [data-slot='pane'] [data-slot='composer'] { +html:root:not(.t_light):not(.light) [data-slot='pane'] [data-slot='composer'] { background-color: rgb(255 255 255 / 0.06) !important; } diff --git a/apps/hanzo-desktop/src/host.tsx b/apps/hanzo-desktop/src/host.tsx index 9ce7c0ef..0ed59b38 100644 --- a/apps/hanzo-desktop/src/host.tsx +++ b/apps/hanzo-desktop/src/host.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState, useSyncExternalStore, type MouseEvent } from 'react'; import { getBrand } from '@hanzo/desktop-brand-config'; import { ORG_KEY } from '@hanzo/event'; -import { GuiProvider } from '@hanzo/gui'; +import { GuiProvider, XStack } from '@hanzo/gui'; import { IamProvider, useIam } from '@hanzo/iam/react'; import { configure, Look, Rooms, type Link, type Router } from '@hanzo/app'; import { App, type Titlebar } from '@hanzo/app/App'; @@ -26,6 +26,7 @@ import { openLocalAiManager, } from './local-ai'; import BenchmarkPage, { LSA_URL, ZEN_27B_TREE_PRESET } from './pages/benchmark'; +import { Update } from './update'; import { Welcome } from './Welcome'; import { safeListen } from './utils/tauri-check'; @@ -100,11 +101,17 @@ function LocalAi() { // 78px clear there; Windows and Linux keep their native title bar above the // page and need none. The bar drags the window. Its controls are the window's: // Local AI, in place of the minimise, maximise and close a frameless window -// would draw, which the native title bar already has. +// would draw, which the native title bar already has, and, when there is a newer +// version, the one quiet line that installs it (update.tsx). const BAR: Titlebar = { inset: /Mac/.test(navigator.userAgent) ? 78 : 0, drag: { 'data-tauri-drag-region': true }, - controls: , + controls: ( + + + + + ), }; /** The composer's microphone, on whatever page draws it. */ diff --git a/apps/hanzo-desktop/src/update.tsx b/apps/hanzo-desktop/src/update.tsx new file mode 100644 index 00000000..66ffea48 --- /dev/null +++ b/apps/hanzo-desktop/src/update.tsx @@ -0,0 +1,143 @@ +import { invoke } from '@tauri-apps/api/core'; +import { platform } from '@tauri-apps/plugin-os'; +import { relaunch } from '@tauri-apps/plugin-process'; +import { check, type Update as Release } from '@tauri-apps/plugin-updater'; +import { Button, Text } from '@hanzo/ui'; +import { useCallback, useEffect, useRef, useState } from 'react'; + +import { isTauriAvailable } from './utils/tauri-check'; + +// A NEW VERSION, SAID QUIETLY, INSTALLED IN ONE PRESS. +// +// Hanzo asks the update feed (tauri.conf.json `plugins.updater`) once the window +// is up and every half hour after. When there is a newer version the bar says +// "Update available" in its own quiet voice, beside Local AI, and nothing else +// moves: no banner over the page, no dialog. One press downloads it, installs +// it and opens Hanzo again, so nobody has to find a download page or a +// terminal. The Hanzo node is stopped once the download is whole, as it was +// before the update could replace its files. + +const EVERY = 30 * 60 * 1000; +/** Long enough that the update check never competes with the window opening. */ +const FIRST = 15 * 1000; + +export type Stage = + | { name: 'none' } + | { name: 'ready'; version: string } + | { name: 'updating'; version: string; percent: number | null } + | { name: 'failed'; version: string }; + +/** Whole percent of a download, or null while its size is not yet known. */ +export function percent(done: number, total: number | undefined): number | null { + return total && total > 0 ? Math.min(100, Math.round((done / total) * 100)) : null; +} + +/** What the bar says for a stage: the words, the hover line and whether a press does anything. */ +export function say(stage: Stage): { text: string; hint: string; press: boolean } | null { + switch (stage.name) { + case 'none': + return null; + case 'ready': + return { + text: 'Update available', + hint: `Hanzo ${stage.version} is ready. Press to update and restart.`, + press: true, + }; + case 'updating': + return { + text: stage.percent === null ? 'Updating…' : `Updating… ${stage.percent}%`, + hint: 'Hanzo restarts when this finishes.', + press: false, + }; + case 'failed': + return { + text: 'Update didn’t finish. Try again', + hint: `Hanzo ${stage.version} could not be installed. Press to try again.`, + press: true, + }; + } +} + +/** The update feed's newest version, the stage it puts the bar in, and the press that installs it. */ +export function useUpdate(): { stage: Stage; install: () => void } { + const [stage, setStage] = useState({ name: 'none' }); + const release = useRef(null); + const busy = useRef(false); + + useEffect(() => { + if (!isTauriAvailable()) return; + let stopped = false; + const look = async () => { + if (busy.current) return; + try { + const found = await check(); + if (stopped || busy.current) return; + release.current = found; + setStage(found ? { name: 'ready', version: found.version } : { name: 'none' }); + } catch { + // No feed, no network or an unsigned local build: the bar says nothing. + } + }; + const first = setTimeout(() => void look(), FIRST); + const again = setInterval(() => void look(), EVERY); + return () => { + stopped = true; + clearTimeout(first); + clearInterval(again); + }; + }, []); + + const install = useCallback(() => { + const found = release.current; + if (!found || busy.current) return; + busy.current = true; + let total: number | undefined; + let done = 0; + setStage({ name: 'updating', version: found.version, percent: null }); + found + .downloadAndInstall((event) => { + if (event.event === 'Started') total = event.data.contentLength; + else if (event.event === 'Progress') { + done += event.data.chunkLength; + setStage({ name: 'updating', version: found.version, percent: percent(done, total) }); + } else if (event.event === 'Finished') { + setStage({ name: 'updating', version: found.version, percent: 100 }); + void invoke('hanzo_node_kill').catch(() => undefined); + } + }) + // Windows' installer restarts Hanzo itself; the others are opened again here. + .then(() => (platform() === 'windows' ? undefined : relaunch())) + .catch(() => { + busy.current = false; + setStage({ name: 'failed', version: found.version }); + }); + }, []); + + return { stage, install }; +} + +/** The bar's update mark: nothing until there is a newer version, then one quiet line. */ +export function Update() { + const { stage, install } = useUpdate(); + const line = say(stage); + if (!line) return null; + return ( + + ); +} From 7e8cac9bd36b85fb8fcd108711f29b020dc28d72 Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Fri, 20 Nov 2026 19:40:57 -0800 Subject: [PATCH 2/5] feat(desktop): Developer mode is in the window's own Settings (#22) The window's Settings page is the desktop's own, so the app's General pane (and the Developer mode switch in it) is not reachable from it. The page now holds the same switch the account card, the palette and a run's menu hold: off for a new person, one press, kept on this device (@hanzo/build's hanzo.dev_mode). Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV --- .../src/__tests__/developer-mode.test.tsx | 44 ++++++++++++++++ apps/hanzo-desktop/src/desktop-shortcuts.tsx | 50 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 apps/hanzo-desktop/src/__tests__/developer-mode.test.tsx diff --git a/apps/hanzo-desktop/src/__tests__/developer-mode.test.tsx b/apps/hanzo-desktop/src/__tests__/developer-mode.test.tsx new file mode 100644 index 00000000..2c57857d --- /dev/null +++ b/apps/hanzo-desktop/src/__tests__/developer-mode.test.tsx @@ -0,0 +1,44 @@ +/** + * Developer mode in the window's own Settings: off for a new person, one switch, + * kept on this device, and the same switch the account card, ⌘K and a run's menu + * hold (@hanzo/build's `hanzo.dev_mode`), so turning it on here shows the process + * in Dev at once. + */ +import { DEV_MODE_KEY } from '@hanzo/build/dev-mode'; +import { fireEvent, render, screen } from '@testing-library/react'; +import { beforeEach, describe, expect, it } from 'vitest'; + +import { DesktopSettings } from '../desktop-shortcuts'; + +const page = () => + render( undefined} onBack={() => undefined} />); + +describe('Developer mode in Settings', () => { + beforeEach(() => window.localStorage.clear()); + + it('is off for a new person, and says what it shows', () => { + page(); + const mark = screen.getByRole('switch', { name: 'Developer mode' }); + expect(mark).toHaveAttribute('aria-checked', 'false'); + expect(screen.getByTestId('desktop-dev-mode')).toHaveTextContent( + 'Shows the process: the terminal, the commands Hanzo runs and each step. Off, Hanzo shows the result.', + ); + }); + + it('turns on with one press, is kept on this device, and turns off again', () => { + page(); + const mark = screen.getByRole('switch', { name: 'Developer mode' }); + fireEvent.click(mark); + expect(mark).toHaveAttribute('aria-checked', 'true'); + expect(window.localStorage.getItem(DEV_MODE_KEY)).toBe('true'); + fireEvent.click(mark); + expect(mark).toHaveAttribute('aria-checked', 'false'); + expect(window.localStorage.getItem(DEV_MODE_KEY)).toBe('false'); + }); + + it('opens on what the device kept', () => { + window.localStorage.setItem(DEV_MODE_KEY, 'true'); + page(); + expect(screen.getByRole('switch', { name: 'Developer mode' })).toHaveAttribute('aria-checked', 'true'); + }); +}); diff --git a/apps/hanzo-desktop/src/desktop-shortcuts.tsx b/apps/hanzo-desktop/src/desktop-shortcuts.tsx index 02fcc753..4c502ff4 100644 --- a/apps/hanzo-desktop/src/desktop-shortcuts.tsx +++ b/apps/hanzo-desktop/src/desktop-shortcuts.tsx @@ -1,4 +1,5 @@ import { KEYS } from '@hanzo/app/help'; +import { DEV_MODE_NOTE, useDevMode } from '@hanzo/build/dev-mode'; import { openUrl } from '@tauri-apps/plugin-opener'; import { useEffect, useState } from 'react'; @@ -201,6 +202,7 @@ export function DesktopSettings({ ); const [hanzodUp, setHanzodUp] = useState(null); const [engineUp, setEngineUp] = useState(null); + const [devMode, setDevMode] = useDevMode(); useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -304,6 +306,54 @@ export function DesktopSettings({
+
+
+

Developer mode

+

{DEV_MODE_NOTE}

+
+ +
+
Date: Fri, 20 Nov 2026 19:48:49 -0800 Subject: [PATCH 3/5] docs(desktop): LLM.md says how the skin reads in both schemes, how the update mark works, where Developer mode is Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV --- LLM.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/LLM.md b/LLM.md index 7848aa63..ae16866a 100644 --- a/LLM.md +++ b/LLM.md @@ -326,6 +326,24 @@ owns: into the same, so sign-out or checkout never replaces the app with a page. - **Look**: `gui.config.ts` is `@hanzo/ui/gui-config`'s `monochrome`, hanzo.ai's config, for every window; `main.tsx` loads hanzo.ai's stylesheets in its order. +- **Both schemes**: `src/app.css` cuts the window's own skin (obsidian floor, one + sidebar surface) for the DARK scheme only, scoped `html:root:not(.t_light):not(.light)`; + light takes the app's own floor and card and a small block of `--desk-*` aliases. + Unscoped, the dark values dressed a system set to light too: the sidebar stayed + black under dark ink and every title in it but the lit one disappeared. + `e2e-tests/appearance.spec.ts` measures each sidebar title against what is painted + behind it (4.5:1) in both schemes. `src/desktop.css` is not imported by this window. +- **Updates**: `src/update.tsx`, in the bar beside Local AI. Once the window is up + (15 s) and every 30 minutes it asks the feed (`plugins.updater`); with a newer + version the bar says "Update available" and nothing else moves. One press + downloads, installs, stops the node and relaunches (Windows' installer restarts + itself). A failed install says so and can be pressed again. The old banner lives + in the retired layout and is not mounted here. +- **Developer mode**: the window's own `/settings` page (`DesktopSettings`) holds + the same switch as the account card, the palette (⌘K), ⌘⇧D and a run's menu: + `@hanzo/build/dev-mode`'s `hanzo.dev_mode`, off for a new person. The app's own + Settings pages are not reachable from this window, so a switch only drawn there + would not be found. The stack is pinned in `pnpm-workspace.yaml`'s catalog to the versions hanzo-inc/app pins. Move them together. From 1220088025363dc3300975206d29a5b69c359e48 Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Fri, 20 Nov 2026 20:27:38 -0800 Subject: [PATCH 4/5] feat(desktop): draw @hanzo/app 0.3.115 and @hanzo/build 0.2.138 Takes the shell changes for #12 #13 #14 #15 #18 #19: Auto picks the folder the ask is about, a local run answers in words with its process only in Developer mode, a run's own Archive and Delete work and ask first in the middle of the page, and a site can be redesigned with a live preview. The window's app patch is regenerated against the published 0.3.115 (the same four files, offsets only). 0.3.111 and 0.3.112 crash the window (their sidebar role card needs an account provider the desktop has none of), so nothing older than 0.3.113 will do. Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV --- ....3.109.patch => @hanzo__app@0.3.115.patch} | 8 ++-- pnpm-lock.yaml | 38 +++++++++---------- pnpm-workspace.yaml | 10 +++-- 3 files changed, 29 insertions(+), 27 deletions(-) rename patches/{@hanzo__app@0.3.109.patch => @hanzo__app@0.3.115.patch} (98%) diff --git a/patches/@hanzo__app@0.3.109.patch b/patches/@hanzo__app@0.3.115.patch similarity index 98% rename from patches/@hanzo__app@0.3.109.patch rename to patches/@hanzo__app@0.3.115.patch index f5ba7fec..1f06dc5f 100644 --- a/patches/@hanzo__app@0.3.109.patch +++ b/patches/@hanzo__app@0.3.115.patch @@ -1,5 +1,5 @@ diff --git a/dist/Chat.js b/dist/Chat.js -index dca4365..46e2461 100644 +index 88c81c9..b89d175 100644 --- a/dist/Chat.js +++ b/dist/Chat.js @@ -876,10 +876,12 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = @@ -101,7 +101,7 @@ index dca4365..46e2461 100644 }, [anonymous, sendAnon]); // THE WAYS PAST A PAUSE. The upgrade opens the plans over the app; a page opens; Continue // with credits turns the org's choice on and asks the last question again on -@@ -1974,6 +1983,28 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = +@@ -1975,6 +1984,28 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = setPreparing(t("Uploading {files}", { files: names(holding, t) })); const landedFiles = (await Promise.all(holding.map(landed))).filter((f) => !!f); spend(at); @@ -130,7 +130,7 @@ index dca4365..46e2461 100644 const attached = landedFiles.map(refOf); const reused = earlier.filter((f) => !attached.some((a) => a.id === f.id)); const all = [...attached, ...reused]; -@@ -2036,6 +2067,9 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = +@@ -2037,6 +2068,9 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = const failure = (question) => { const failed = failures[question.id]; const text = words(question.content); @@ -140,7 +140,7 @@ index dca4365..46e2461 100644 const whom = addressed(text, cast); const wrong = failed?.error ?? null; const how = wrong ? refusalOf(wrong) : null; -@@ -2060,7 +2094,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = +@@ -2061,7 +2095,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = : how?.provider ? t("{model} is unavailable right now.", { model: familyOf(model) || nameOf(model, listed) }) : plainly(wrong, t("this conversation"), t); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79c62e19..1e92b57d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,14 +10,14 @@ catalogs: specifier: 0.7.0 version: 0.7.0 '@hanzo/app': - specifier: 0.3.109 - version: 0.3.109 + specifier: 0.3.115 + version: 0.3.115 '@hanzo/brand': specifier: 1.4.8 version: 1.4.8 '@hanzo/build': - specifier: 0.2.132 - version: 0.2.132 + specifier: 0.2.138 + version: 0.2.138 '@hanzo/composer': specifier: 0.2.1 version: 0.2.1 @@ -556,7 +556,7 @@ overrides: yaml@2: '>=2.8.3' patchedDependencies: - '@hanzo/app@0.3.109': 3944fb5f371d7c0bcbfa1ea77a6a3e492fb9a90c2c74f5b43605d2c7acf209cc + '@hanzo/app@0.3.115': ce940d00ebbb521fcfb545f902082343da8205f9730acfe42a8fed50ea2761ef '@hanzo/studio@0.1.15': 817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a '@hanzo/ui@8.33.6': 27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293 '@hanzogui/shell@8.4.3': bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d @@ -570,7 +570,7 @@ importers: version: 0.7.0(react@19.2.8) '@hanzo/app': specifier: 'catalog:' - version: 0.3.109(patch_hash=3944fb5f371d7c0bcbfa1ea77a6a3e492fb9a90c2c74f5b43605d2c7acf209cc)(d47866a274940394d2d5b21667d8bfce) + version: 0.3.115(patch_hash=ce940d00ebbb521fcfb545f902082343da8205f9730acfe42a8fed50ea2761ef)(fb31c5f0cabc7fe92807c3f5922b4865) '@hanzo/appearance': specifier: 0.2.15 version: 0.2.15(react@19.2.8) @@ -579,7 +579,7 @@ importers: version: 1.4.8(react@19.2.8) '@hanzo/build': specifier: 'catalog:' - version: 0.2.132(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + version: 0.2.138(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': specifier: 'catalog:' version: 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) @@ -618,7 +618,7 @@ importers: version: 1.8.17 '@hanzo/studio': specifier: 0.1.15 - version: 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(120e05229a244465ea23c37be9cc7305) + version: 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(1e7e7fee44b22c0d6c6e797d5208be40) '@hanzo/tabs': specifier: 'catalog:' version: https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -1786,13 +1786,13 @@ packages: react: optional: true - '@hanzo/app@0.3.109': - resolution: {integrity: sha512-Bx1+C00erRtzkdwnY7IELTXMAS0XF/uW+xzd6E7zwqAPkI+gmTsZToHJdF4dTUimohQ9vToqjPGsYpKQClCx1A==} + '@hanzo/app@0.3.115': + resolution: {integrity: sha512-yF2i4IDQCnSAHcXutVdgRX9OL/Om6zjRT8QhE8jo5ETGVaIX907yU7pm8nkjTyB3AEs60jGkwNiPhcg+vIDFVQ==} engines: {node: '>=22.18'} peerDependencies: '@hanzo/ai': '>=0.7.0' '@hanzo/appearance': 0.2.15 - '@hanzo/build': '>=0.2.132' + '@hanzo/build': '>=0.2.138' '@hanzo/composer': '>=0.2.0' '@hanzo/design': 0.5.44 '@hanzo/event': 0.3.69 @@ -1827,8 +1827,8 @@ packages: react: optional: true - '@hanzo/build@0.2.132': - resolution: {integrity: sha512-IXeOZpoB0EgDXEmFg5cJocCRX0P6Q/aZW8NhKFVyIEfgFuWNVzQbH7GmAxHOAFqHVSYkSpT5Sov8sacaEJxZeA==} + '@hanzo/build@0.2.138': + resolution: {integrity: sha512-M8kebr/45XKfTh9tFdTzUme6890McNh4T4trapl4DQp/9fc/G6xcFQTH50m8aFojhBeJ4jqeME/DbnX10WNKbw==} engines: {node: '>=22.18'} peerDependencies: '@hanzo/composer': '>=0.2.0' @@ -12617,11 +12617,11 @@ snapshots: optionalDependencies: react: 19.2.8 - '@hanzo/app@0.3.109(patch_hash=3944fb5f371d7c0bcbfa1ea77a6a3e492fb9a90c2c74f5b43605d2c7acf209cc)(d47866a274940394d2d5b21667d8bfce)': + '@hanzo/app@0.3.115(patch_hash=ce940d00ebbb521fcfb545f902082343da8205f9730acfe42a8fed50ea2761ef)(fb31c5f0cabc7fe92807c3f5922b4865)': dependencies: '@hanzo/ai': 0.7.0(react@19.2.8) '@hanzo/appearance': 0.2.15(react@19.2.8) - '@hanzo/build': 0.2.132(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + '@hanzo/build': 0.2.138(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/design': 0.5.44 '@hanzo/event': 0.3.69(react@19.2.8) @@ -12632,7 +12632,7 @@ snapshots: '@hanzo/logo': 1.0.26(react@19.2.8) '@hanzo/mod': 0.1.2(react@19.2.8) '@hanzo/personas': 1.3.3 - '@hanzo/studio': 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(120e05229a244465ea23c37be9cc7305) + '@hanzo/studio': 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(1e7e7fee44b22c0d6c6e797d5208be40) '@hanzo/ui': 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) '@hanzo/usage': 0.1.18(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/voice': 0.1.19(react@19.2.8) @@ -12656,7 +12656,7 @@ snapshots: optionalDependencies: react: 19.2.8 - '@hanzo/build@0.2.132(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8)': + '@hanzo/build@0.2.138(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8)': dependencies: '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -12820,9 +12820,9 @@ snapshots: '@hanzogui/lucide-icons-2': 8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) react: 19.2.8 - '@hanzo/studio@0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(120e05229a244465ea23c37be9cc7305)': + '@hanzo/studio@0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(1e7e7fee44b22c0d6c6e797d5208be40)': dependencies: - '@hanzo/build': 0.2.132(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + '@hanzo/build': 0.2.138(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzo/i18n': 0.6.1(react@19.2.8) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index fefbca5e..c6d26f17 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -80,14 +80,14 @@ overrides: # already answered). @hanzo/studio 0.1.15 so a GPU status that is not a fleet no # longer crashes Studio in lit(), and the window reaches the engine through the # hanzo-studio scheme (src-tauri/src/studio_proxy.rs), since studio.hanzo.ai's -# CORS admits no window origin. @hanzo/app 0.3.109 with what only a desktop +# CORS admits no window origin. @hanzo/app 0.3.115 with what only a desktop # window does: a signed-out reader chats with the local engine (any local model, # images and text files read in the window, Local AI from a failed turn), lists # that stay empty without a session, the desktop's ⌘N and ⇧⌘M in the shortcut # list, and no Google Workspace until Google verifies its scopes. Drop each when # its pin moves to a release that carries it. patchedDependencies: - '@hanzo/app@0.3.109': patches/@hanzo__app@0.3.109.patch + '@hanzo/app@0.3.115': patches/@hanzo__app@0.3.115.patch '@hanzo/ui@8.33.6': patches/@hanzo__ui@8.33.6.patch '@hanzo/studio@0.1.15': patches/@hanzo__studio@0.1.15.patch '@hanzogui/shell@8.4.3': patches/@hanzogui__shell@8.4.3.patch @@ -101,10 +101,12 @@ allowBuilds: sharp: true unrs-resolver: true minimumReleaseAgeExclude: + - '@hanzo/app@0.3.115' - '@hanzo/app@0.3.109' - '@hanzo/app@0.3.107' - '@hanzo/ai@0.7.0' - '@hanzo/appearance@0.2.15' + - '@hanzo/build@0.2.138' - '@hanzo/build@0.2.132' - '@hanzo/build@0.2.130' - '@hanzo/design@0.5.44' @@ -245,7 +247,7 @@ catalog: '@hanzo/ai': '0.7.0' '@hanzo/appearance': '0.2.15' '@hanzo/brand': '1.4.8' - '@hanzo/build': '0.2.132' + '@hanzo/build': '0.2.138' '@hanzo/composer': '0.2.1' '@hanzo/data': '1.2.4' '@hanzo/design': '0.5.44' @@ -256,7 +258,7 @@ catalog: '@hanzo/iam': '0.21.42' '@hanzo/personas': '1.0.5' '@hanzo/plans': '1.8.17' - '@hanzo/app': '0.3.109' + '@hanzo/app': '0.3.115' '@hanzo/studio': '0.1.15' # The commit hanzo-inc/app's lock holds (0.1.17); npm stops at 0.1.7, under # @hanzo/app's floor of 0.1.8. From b638c46a6f701f086ad8f3a9977e30280c91b4cb Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Fri, 20 Nov 2026 20:35:37 -0800 Subject: [PATCH 5/5] test(desktop): the redesign flow through the window's own commands (#15) The spec fork A wrote against the real window bundle with a stand-in for the Rust commands; it needs @hanzo/app 0.3.114 or later. Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV --- .../e2e-tests/redesign-site.spec.ts | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 apps/hanzo-desktop/e2e-tests/redesign-site.spec.ts diff --git a/apps/hanzo-desktop/e2e-tests/redesign-site.spec.ts b/apps/hanzo-desktop/e2e-tests/redesign-site.spec.ts new file mode 100644 index 00000000..ae506377 --- /dev/null +++ b/apps/hanzo-desktop/e2e-tests/redesign-site.spec.ts @@ -0,0 +1,148 @@ +/** + * Redesign a site from its address, through the window's own commands (hanzo-inc/app#312, hanzoai/desktop#15). + * + * The main window is hanzo.ai's app, and Dev's New on This computer offers to redesign an address pasted into it: the + * window opens the site and saves a copy for the agent (`local_site_capture`), serves the folder's `redesign/` live + * (`local_preview_start`) and shows it in Chrome (`local_preview_open`), and the agent is the ordinary + * `local_workspace_run_dev`. There is no Tauri runtime in this suite, so the IPC is a stand-in that answers the way + * the Rust commands do and writes every call down; the Rust side is `cargo test local_site`. Signed in with a token + * the app reads from the keychain record, against a stubbed platform. + */ +import { expect, type Page, test } from '@playwright/test'; + +const b64 = (o: object) => Buffer.from(JSON.stringify(o)).toString('base64url'); +const expires = Math.floor(Date.now() / 1000) + 86_400; +const TOKEN = [ + b64({ alg: 'none', typ: 'JWT' }), + b64({ sub: 'u1', name: 'James', email: 'james@acme.test', owner: 'acme', exp: expires, orgs: [{ org: 'acme', role: 'member' }], org: 'acme' }), + 'x', +].join('.'); +const SESSION = JSON.stringify({ + hanzo_iam_access_token: TOKEN, + hanzo_iam_refresh_token: 'r', + hanzo_iam_expires_at: String(Date.now() + 86_400_000), +}); + +type Call = { cmd: string; args: Record }; + +/** A signed-in window whose IPC is a stand-in for the desktop's commands. `refuse` is what `local_site_capture` says no with. */ +async function signedIn(page: Page, refuse = ''): Promise { + const calls: Call[] = []; + await page.exposeFunction('__ipc', (call: Call) => calls.push(call)); + await page.addInitScript( + ({ session, refuse }) => { + let callback = 1; + (window as unknown as Record).__TAURI_INTERNALS__ = { + metadata: { currentWindow: { label: 'main' }, currentWebview: { label: 'main', windowLabel: 'main' } }, + transformCallback(f: unknown) { + const id = callback++; + (window as unknown as Record)[`_${id}`] = f; + return id; + }, + unregisterCallback() {}, + convertFileSrc: (p: string) => p, + async invoke(cmd: string, args: Record) { + (window as unknown as { __ipc: (c: unknown) => void }).__ipc({ cmd, args }); + switch (cmd) { + case 'secure_storage_get': + if (args.key === 'iam-session') return session; + throw 'Key not found'; + case 'plugin:event|listen': + return callback++; + case 'local_site_folder': + return { name: args.name, path: `/Users/james/Documents/Hanzo/${args.name}` }; + case 'local_site_capture': + if (refuse) throw refuse; + return { title: 'Acme Plumbing', url: args.url, files: ['page.html', 'text.md'], screenshot: false }; + case 'local_preview_start': + return { url: 'http://127.0.0.1:9933/', port: 9933 }; + case 'local_workspace_run_dev': + return { session_id: 's1', output: 'The page hides its call to action. I rebuilt it around one clear button.', process: '', success: true }; + case 'local_workspace_discover': + return []; + default: + return null; + } + }, + }; + localStorage.setItem('hanzo.local_workspaces', JSON.stringify([{ id: 'w1', name: 'shop', path: '/Users/james/work/shop', addedAt: 1, lastOpenedAt: 5 }])); + }, + { session: SESSION, refuse }, + ); + await page.route('**/v1/**', (route) => { + const path = new URL(route.request().url()).pathname; + const json = (body: unknown) => route.fulfill({ contentType: 'application/json', body: JSON.stringify(body), headers: { 'access-control-allow-origin': '*' } }); + if (path.endsWith('/stream')) return route.fulfill({ contentType: 'text/event-stream', body: ': ok\n\n' }); + if (path === '/v1/agent/sessions' || path === '/v1/agents/sessions') return json({ sessions: [] }); + if (path === '/v1/agent/targets' || path === '/v1/agents/targets') return json({ targets: [] }); + if (path.startsWith('/v1/agents/chat/conversations')) return json({ conversations: [] }); + if (path === '/v1/project') return json([]); + return json({}); + }); + return calls; +} + +const sidebar = (calls: Call[]) => calls.map((c) => c.cmd).filter((c) => /^local_(site|preview|workspace_run)/.test(c)); + +test.describe('Redesign a site in Hanzo Desktop', () => { + test('an address pasted in Dev is offered as a redesign, and one press does all of it through the window’s commands', async ({ page }) => { + const calls = await signedIn(page); + await page.setViewportSize({ width: 1280, height: 860 }); + await page.goto('/dev'); + const ask = page.getByPlaceholder(/Ask, build/); + await ask.fill('https://www.acme.com/plumbing', { timeout: 60_000 }); + const offer = page.locator('[data-slot="redesign-offer"]'); + await expect(offer).toContainText('Redesign acme.com?'); + await page.screenshot({ path: 'test-results/redesign-offer.png' }); + + await offer.getByRole('button', { name: 'Redesign this site' }).click(); + const card = page.locator('[data-slot="redesign"]'); + await expect(card).toContainText('Redesigned acme.com', { timeout: 15_000 }); + await expect(card).toContainText('Live preview: http://127.0.0.1:9933/'); + await expect(card).toContainText('The page hides its call to action. I rebuilt it around one clear button.'); + await page.screenshot({ path: 'test-results/redesign-done.png' }); + + // The window's commands, in order: a new folder named for the site, the site saved into it, the redesign served and shown, the agent run there. + expect(sidebar(calls)).toEqual(['local_site_folder', 'local_site_capture', 'local_preview_start', 'local_preview_open', 'local_workspace_run_dev']); + const [folder, capture, start, open, run] = ['local_site_folder', 'local_site_capture', 'local_preview_start', 'local_preview_open', 'local_workspace_run_dev'].map( + (cmd) => calls.find((c) => c.cmd === cmd)!, + ); + const dir = '/Users/james/Documents/Hanzo/acme-redesign'; + expect(folder.args).toEqual({ name: 'acme-redesign' }); + expect(capture.args).toEqual({ url: 'https://www.acme.com/plumbing', dir }); + expect(start.args).toEqual({ dir }); + expect(open.args).toEqual({ url: 'http://127.0.0.1:9933/' }); + expect(run.args.workspacePath).toBe(dir); + expect(String(run.args.prompt)).toContain('Redesign the website https://www.acme.com/plumbing (Acme Plumbing).'); + expect(String(run.args.prompt)).toContain('- .hanzo/reference/text.md:'); + expect(String(run.args.prompt)).toContain('Do not start a server and do not use the network'); + + // Open in Chrome shows the same address again. + await card.getByRole('button', { name: 'Open in Chrome' }).click(); + await expect.poll(() => calls.filter((c) => c.cmd === 'local_preview_open').length).toBe(2); + // The redesign's folder is now the one Auto picks. + await expect(page.getByRole('button', { name: /^Folder: / })).toHaveAccessibleName('Folder: Auto · acme-redesign'); + }); + + test('a site the window will not open is said in plain words, and no agent is run', async ({ page }) => { + const calls = await signedIn(page, 'Hanzo opens sites on the internet, or one running on this computer. That address is on a private network.'); + await page.goto('/dev'); + await page.getByPlaceholder(/Ask, build/).fill('http://192.168.1.10/', { timeout: 60_000 }); + await page.getByPlaceholder(/Ask, build/).press('Enter'); + const card = page.locator('[data-slot="redesign"]'); + await expect(card).toContainText('Could not redesign 192.168.1.10'); + await expect(card).toContainText('That address is on a private network.'); + expect(sidebar(calls)).toEqual(['local_site_folder', 'local_site_capture']); + await page.screenshot({ path: 'test-results/redesign-refused.png' }); + }); + + test('an ask that only holds a link is a normal run in the folder', async ({ page }) => { + const calls = await signedIn(page); + await page.goto('/dev'); + const ask = page.getByPlaceholder(/Ask, build/); + await ask.fill('What does https://www.acme.com say about pricing?', { timeout: 60_000 }); + await expect(page.locator('[data-slot="redesign-offer"]')).toHaveCount(0); + await ask.press('Enter'); + await expect.poll(() => sidebar(calls)).toEqual(['local_workspace_run_dev']); + }); +});