From 70cd41fbb3c9bd7f474fcfacefa6d77e00a1309a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Tue, 1 Dec 2026 19:14:58 -0500 Subject: [PATCH 01/11] feat(topbar): the agent and gear buttons at the top right, in FormPortal's icon button style --- web/HASHOUT_LOG.md | 9 +++++++++ web/index.html | 4 ++++ web/src/styles/shell.css | 41 ++++++++++++++++++++++++++++++++++++++-- web/src/ui/app.ts | 16 ++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index dc0ef99..1ffabc5 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -960,3 +960,12 @@ Checked by script, opening a copy of each committed folder in this branch's engi - Receivables, payables and the stock ledger all agree with their ledger accounts. The 48 templates were each posted with a write-scope app token to a fresh company with the starter chart, as `templates/README.md` says. All 48 answered 201 and all 48 are listed. Each `POST /api/templates/{id}/use` answer was then saved as a real draft through `/api/sales/docs` or `/api/purchase/docs`, and all 48 drafts were saved. + +### index.html, src/styles/shell.css, src/ui/app.ts · the agent and gear buttons at the top right +- refers-to: index.html :: .topbar__tools; src/styles/shell.css :: .topbar, .topbar__tools; src/ui/app.ts :: bindTools +- kind: rationale +- logged: v0.15.1 · 2026-12-02 (EST) + +The Form shell standard, line 1: the top bar ends with FormPortal's icon buttons, the agent (robot) button and then the gear. Both SVGs are FormPortal's `index.html` lines 39 and 59 byte for byte (checked with a string compare), and the button style is FormPortal's `.top .icon-btn` (30 px square, 1 px raised edge, 7 px radius, 6 px gap, 16 px glyph at stroke 1.7), mapped to FormLedger's tokens. The top bar grid gains a third `auto` column, so the crumbs keep their `minmax(0, 1fr)` and nothing in the first two columns moves. The right padding goes from `--space-4` to `--space-3` so the gear sits as close to the edge as FormPortal's. + +The robot button runs `view.dock`, the same command as View, Agent Dock and Ctrl or Cmd+J. Its pressed look is CSS on `:root[data-ft-dock="open"]`, which `reserveDock` sets before the dock mounts, so a dock saved open shows the pressed button on the first app frame with no class change after. `aria-pressed` follows the `formledger:dock` event the adapter already sends. The gear carries `data-prefs-open` and `aria-haspopup="dialog"`, as FormPortal's does; one delegated click listener runs `app.preferences` for every `[data-prefs-open]`, so the Home button and the user menu item can carry the same attribute. The sidebar head is unchanged: icon, name and version only. diff --git a/web/index.html b/web/index.html index 5c62f1b..5b0bf5f 100644 --- a/web/index.html +++ b/web/index.html @@ -120,6 +120,10 @@

Join these books

Home + + + +
diff --git a/web/src/styles/shell.css b/web/src/styles/shell.css index 0a828bc..33ce167 100644 --- a/web/src/styles/shell.css +++ b/web/src/styles/shell.css @@ -306,13 +306,50 @@ button.sb-item { .topbar { display: grid; - grid-template-columns: auto minmax(0, 1fr); + grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); - padding: 0 var(--space-4) 0 var(--space-2); + padding: 0 var(--space-3) 0 var(--space-2); border-block-end: 1px solid var(--border); } +.topbar__tools { + display: flex; + justify-content: flex-end; + gap: 6px; +} + +.topbar__tools .icon-btn { + inline-size: 30px; + block-size: 30px; + color: var(--text-secondary); + background: var(--surface-2); + border: 1px solid var(--border-strong); + border-radius: 7px; +} + +.topbar__tools .icon-btn .ic { + inline-size: var(--icon); + block-size: var(--icon); +} + +.topbar__tools .icon-btn:hover, +.topbar__tools .icon-btn[aria-expanded="true"] { + color: var(--text); + background: var(--active); +} + +.topbar__tools .icon-btn:focus-visible { + outline: 2px solid var(--focus); + outline-offset: 1px; +} + +:root[data-ft-dock="open"] .topbar__tools [data-ref="dock-toggle"] { + color: var(--accent); + background: var(--accent-wash); + border-color: var(--accent-line); +} + .topbar__nav { display: inline-grid; grid-auto-flow: column; diff --git a/web/src/ui/app.ts b/web/src/ui/app.ts index b547da2..1c7944e 100644 --- a/web/src/ui/app.ts +++ b/web/src/ui/app.ts @@ -231,6 +231,21 @@ function bindCommands(engine: Engine): void { }; } +function bindTools(engine: Engine): void { + const dockBtn = ref("dock-toggle"); + dockBtn.addEventListener("click", () => engine.commands.run("view.dock")); + document.addEventListener("formledger:dock", (e) => { + const open = String((e as CustomEvent<{ open?: boolean }>).detail?.open === true); + if (dockBtn.getAttribute("aria-pressed") !== open) dockBtn.setAttribute("aria-pressed", open); + }); + document.addEventListener("click", (e) => { + const opener = (e.target as Element | null)?.closest?.("[data-prefs-open]"); + if (!opener) return; + e.preventDefault(); + engine.commands.run("app.preferences"); + }); +} + function mountShell(engine: Engine): void { const enabled = (id: string) => { const c = engine.commands.get(id); @@ -243,6 +258,7 @@ function mountShell(engine: Engine): void { export function mountApp(engine: Engine): void { reserveDock(); bindCommands(engine); + bindTools(engine); bindNav(engine); bindUserMenu(engine); bindHistory(engine); From b8cad2e159eb2a8b4a2c193d55f1da1b8d00a944 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Tue, 1 Dec 2026 19:17:15 -0500 Subject: [PATCH 02/11] feat(prefs): Preferences as FormVis's floating dialog with the wire, one section at a time, opened from every way in --- web/HASHOUT_LOG.md | 30 ++++ web/index.html | 4 +- web/src/styles/prefs-dialog.css | 302 ++++++++++++++++++++++++++++++++ web/src/styles/prefs.css | 98 ----------- web/src/ui/app.ts | 6 +- web/src/ui/prefs-dialog.ts | 181 +++++++++++++++++++ web/src/ui/prefs.ts | 71 ++------ web/src/ui/views.ts | 8 +- 8 files changed, 538 insertions(+), 162 deletions(-) create mode 100644 web/src/styles/prefs-dialog.css create mode 100644 web/src/ui/prefs-dialog.ts diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index 1ffabc5..4378c9b 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -969,3 +969,33 @@ The 48 templates were each posted with a write-scope app token to a fresh compan The Form shell standard, line 1: the top bar ends with FormPortal's icon buttons, the agent (robot) button and then the gear. Both SVGs are FormPortal's `index.html` lines 39 and 59 byte for byte (checked with a string compare), and the button style is FormPortal's `.top .icon-btn` (30 px square, 1 px raised edge, 7 px radius, 6 px gap, 16 px glyph at stroke 1.7), mapped to FormLedger's tokens. The top bar grid gains a third `auto` column, so the crumbs keep their `minmax(0, 1fr)` and nothing in the first two columns moves. The right padding goes from `--space-4` to `--space-3` so the gear sits as close to the edge as FormPortal's. The robot button runs `view.dock`, the same command as View, Agent Dock and Ctrl or Cmd+J. Its pressed look is CSS on `:root[data-ft-dock="open"]`, which `reserveDock` sets before the dock mounts, so a dock saved open shows the pressed button on the first app frame with no class change after. `aria-pressed` follows the `formledger:dock` event the adapter already sends. The gear carries `data-prefs-open` and `aria-haspopup="dialog"`, as FormPortal's does; one delegated click listener runs `app.preferences` for every `[data-prefs-open]`, so the Home button and the user menu item can carry the same attribute. The sidebar head is unchanged: icon, name and version only. + +### src/ui/prefs-dialog.ts, src/styles/prefs-dialog.css · Preferences as FormVis's floating dialog with the wire +- refers-to: src/ui/prefs-dialog.ts :: mountPrefsDialog; src/ui/prefs.ts :: prefSections; src/ui/views.ts :: apply; src/ui/app.ts :: app.preferences; index.html :: [data-prefs-open] +- kind: rationale, removed-code +- logged: v0.15.1 · 2026-12-02 (EST) + +The Form shell standard, line 2: Preferences is a floating dialog, never a page. Ported by hand from FormVis 2.9.0 `ui/app-dialogs.ts` (`SettingsDialog`, `markSection`, `drawWire`) and `styles/dialogs.css` 155 to 195, through FormPortal's port in `extensions/prefs/index.ts`, which uses a native `` with `showModal()`. The native dialog gives the dimmed window (`::backdrop`, `--bg-scrim`), the top layer (no z-index needed for the frame, so the one scale is untouched), an inert window behind it and Esc through the `cancel` event. A Tab and Shift+Tab handler wraps focus inside the dialog, so the browser chrome is never reached either. A click whose target is the dialog itself (the backdrop) closes it. So do the close button, Done, a route change and leaving the app screen (sign out, lock). + +The rail floats 28 px left of the panel (`inset-inline-end: calc(100% + var(--space-7))`), FormVis's 232 px, and folds to 76 px icons below 1040 px wide, where the panel moves in to 112 px. The wire is FormVis's: an SVG at the frame's origin with a shade path and a line path, from the active tab's right edge along a trunk in the gap to the port on the panel's left edge at the header divider. It is redrawn on rAF from a ResizeObserver on the frame, window resize and every section change, and only the two `d` attributes and the port's `transform` change, each only when its value differs. FormVis and FormPortal stack every section and scroll-spy them; the standard asks for one section at a time, so each card is `hidden` unless current and the pages scroll back to the top on a switch. The frame has a fixed size (`min(780px, 100vw - 300px)` by `min(86vh, 620px)`), so switching sections changes nothing outside the pages box. FormVis opens and closes its dialogs with no transition (`Dialog.open` and `close` only flip `hidden`), and this does the same. + +Every setting stays: Appearance (theme, accent), Menus in Window (macOS only), Agents ("Show the agent dock", the `formledger.agentDock` state the dock already restores before it mounts) and Security (the app lock, which goes through the engine's `account.lock` command, and the Account link). `prefs.ts` keeps the section builders and exports `prefSections(engine)`; `security` takes the engine instead of a view context. Every way in opens the dialog: the gear, Ctrl or Cmd+comma, the FormLedger menu (macOS) or Edit menu (Windows, Linux) Preferences item, the palette, Home's Preferences button and the user menu item (both now `button[data-prefs-open]` instead of links), and an old `#/preferences` link, which `views.ts` turns back into the hash of the view showing and then opens the dialog. + +Removed from `src/ui/prefs.ts`, the page view and its scroll spy: + +``` +export function prefsView(): ViewDef { + return { + id: "preferences", + title: "Preferences", + group: "Setup", + nav: false, + icon: "settings", + mount(host, ctx) { + ... + host.append(h("div", { class: "prefs" }, nav, pages)); + const scroller = host.closest("[data-ref='views']"); + const spy = new IntersectionObserver( +``` + +Removed from `src/ui/views.ts`: `import { prefsView } from "./prefs";` and `const defsAll = [...ALL_VIEWS, ...HUB_VIEWS, prefsView()];`. Removed from `src/ui/app.ts`: `"app.preferences": go("preferences"),`. Removed from `src/styles/prefs.css`: the page layout rules `.prefs`, `.prefs__nav`, `.prefs__tab` and its states, `.prefs__tabicon`, `.prefs__tablabel`, `.prefs__pages` (with `padding-block-end: 40vh`), `.prefs__sec`, `.prefs__sechead` and the `max-width: 760px` media query. Removed from `index.html`: `Preferences` and ``. diff --git a/web/index.html b/web/index.html index 5b0bf5f..e942d14 100644 --- a/web/index.html +++ b/web/index.html @@ -135,7 +135,7 @@

Good mornin

What customers owe you, what you owe suppliers, your cash, and the last invoices on each side.

- Preferences +