diff --git a/DESIGN.md b/DESIGN.md index 9c08676b..e2a4975f 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -97,6 +97,8 @@ The system is intentionally minimal and bg-only. Chrome recedes; terminals are t The system explicitly rejects: rounded SaaS cards, gradient accents, hacker-aesthetic green-on-black, "Slack-style" Electron chrome bloat, decorative animations, and any token that hardcodes a color. If a user installs a high-contrast theme, the chrome can look flatter than usual: that is accepted, not "fixed" with overrides. +**Scope.** This design system governs every product surface: the lib components, the VS Code webview, the standalone app, and the server-served Pocket app — auth screens included (`docs/specs/pocket-app.md`). The marketing website keeps its own separate "homepage" design system (`website/src/index.css`: Ubuntu Mono / Ubuntu Sans Mono, a fixed dark palette, the caramel accent), scoped to marketing pages only. The two share nothing except lib components embedded in the site's playgrounds, which bring this system's tokens with them; product surfaces never consume homepage tokens, and marketing chrome never consumes `--vscode-*`. + **Key Characteristics:** - Host-theme-driven palette: every color is a `var(--vscode-*)` passthrough. - Bg-only chrome: no decorative borders, no resting shadows, no accent stripes. diff --git a/docs/specs/pocket-app.md b/docs/specs/pocket-app.md index fd972ca1..f891c878 100644 --- a/docs/specs/pocket-app.md +++ b/docs/specs/pocket-app.md @@ -74,6 +74,51 @@ default, matching the homepage brand. The server (`server/`) stays the only dynamic code: accounts, relay, and static serving of the built Pocket bundle. +## Design system and theming + +Pocket is a product surface, not a marketing page: all of it — the auth +screens included — renders on the shared themeable design system +(`--color-*` tokens over `--vscode-*`; [theme.md](./theme.md), `DESIGN.md`). +The website's separate "homepage" design system (`website/src/index.css`) is +never used by Pocket or anything else the server serves. There is no +Pocket-specific palette; changing the theme re-skins the auth screens and +the wall together. + +Pocket has no VS Code host and boots into auth long before a Wall exists, so +the app restores the theme itself before first paint: `main.tsx` calls +`restorePocketTheme()` (`lib/src/remote/pocket-app/pocket-theme.ts`) before +the first render, with the Kimbie Dark default; `PocketWall` repeats it +idempotently via `usePocketTheme()` for isolated consumers (stories). The +default is one shared `POCKET_THEME_ID` constant that the website playground +imports, so the playground cannot drift from the real Pocket default. +Restoring also syncs document-level browser chrome that in-app hosts don't +need: `color-scheme` on the root element (native form controls, scrollbars) +and the `` address-bar tint, taken from the applied +theme's type and resolved `sideBar.background`. The static meta values in +`lib/pocket/index.html` are pre-boot placeholders only. + +Phone-specific exceptions to the desktop chrome scale (`DESIGN.md`'s +Two-Step Rule), kept deliberately narrow: + +* Form inputs use 16px text: smaller input text triggers iOS zoom-on-focus, + and 10–12px inputs are illegible at thumb distance. +* Chrome type runs a step larger than desktop (13px body, 11–12px + secondary), and touch targets are taller: 44px block actions, 36px row + actions. + +The chrome itself follows theme.md's three-pair rule: the page is the app +pair, the header band is the active-header pair (the "titlebar", doubling as +the primary-action tone), and host rows are the inactive-header pair. +Secondary text is alpha on the owning pair's foreground, and presence is +intensity — an offline row drops to `opacity-55`; there is no online badge, +no border, no `surface-raised`, no `muted`. The one status color is +`text-error`, delineated by a red inset hairline for the error notice +(panel-border is transparent in many themes). Source of truth: +`lib/src/remote/pocket-app/App.tsx` (views + the `pkButton`/`PK` +vocabulary), `lib/src/remote/pocket-app/pocket-theme.ts` (theme boot + +browser-chrome sync), `lib/pocket/index.html` (structural viewport rules + +pre-boot color fallbacks). + ## Deployment: same-origin, always WebAuthn binds passkeys to the serving origin, and Chrome's Private Network @@ -100,3 +145,6 @@ code. `MobileTerminalUi` + `MobileWall` independently. 2. **CloudFlare routing** — the SaaS deployment above; deferred until SaaS. Nothing in the shipped architecture needs rework for it. +3. **Theme picker in Pocket** — the app restores the persisted theme but + exposes no picker; add the shared `ThemePicker` (and its theme-debugger + entry) once its dropdown is phone-friendly. diff --git a/docs/specs/server.md b/docs/specs/server.md index 8e29ae9d..cba1d347 100644 --- a/docs/specs/server.md +++ b/docs/specs/server.md @@ -252,6 +252,11 @@ Served by the server, built from `lib`: straight away. * Picker renders `directory.snapshot`; tapping a pane attaches with the phone's cols/rows and reuses the existing mobile terminal UI (xterm). +* All of it — auth screens included — renders on the shared themeable design + system, with the theme restored before first paint + (`docs/specs/pocket-app.md`, Design system and theming). The server serves + no styling of its own; its only self-authored output is the plaintext + missing-build stub. ## Testing diff --git a/docs/specs/theme.md b/docs/specs/theme.md index cc69d461..e672d97d 100644 --- a/docs/specs/theme.md +++ b/docs/specs/theme.md @@ -8,7 +8,12 @@ theme-appropriate xterm.js colors. VSCode extension mode gets `--vscode-*` variables from VSCode. Standalone and website mode apply the same shape of variables to `document.body` with -`applyTheme()` from a bundled or installed Dormouse theme. Both paths run the +`applyTheme()` from a bundled or installed Dormouse theme. The Pocket app is +a fourth host: it restores the persisted/bundled theme with +`restoreActiveTheme()` before its first paint — auth screens included — and +additionally syncs document-level browser chrome (`color-scheme`, +`meta[name="theme-color"]`); see +[pocket-app.md](./pocket-app.md#design-system-and-theming). All paths run the same consumed-token resolver from `lib/src/lib/themes/vscode-color-resolver.ts` so omitted theme JSON keys behave like VSCode registry defaults before Dormouse renders. diff --git a/lib/pocket/index.html b/lib/pocket/index.html index 0ff5f90e..8c09b302 100644 --- a/lib/pocket/index.html +++ b/lib/pocket/index.html @@ -6,7 +6,10 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1.0, user-scalable=no" /> - + + + Dormouse Pocket