From 218859fa23c2bf6ebb0ec0a92cd22fa3ff509491 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:01:58 -0500 Subject: [PATCH 01/31] fix(web): keep a table's totals row in place while rows load A table with totals now has a fixed height, a filler row that takes the spare space, and a totals row and header that stick to the edges, so the totals no longer move when rows arrive. --- web/src/styles/parts.css | 32 ++++++++++++++++++++++++++++++++ web/src/ui/parts/table.ts | 5 +++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/web/src/styles/parts.css b/web/src/styles/parts.css index 3b7de7b..6d74553 100644 --- a/web/src/styles/parts.css +++ b/web/src/styles/parts.css @@ -89,6 +89,38 @@ border-block-end: 0; } +.tbl[data-foot] { + block-size: var(--tbl-block, calc(var(--row) * 14)); + overflow: auto; +} + +.tbl[data-foot] .tbl__table { + block-size: 100%; +} + +.tbl[data-foot] .tbl__table thead th { + position: sticky; + inset-block-start: 0; +} + +.tbl[data-foot] .tbl__table tfoot td { + position: sticky; + inset-block-end: 0; + background: var(--surface); +} + +.tbl__fill td { + block-size: auto; + padding: 0; + border: 0; +} + +.tbl[data-open] tbody.tbl__fill tr, +.tbl[data-open] tbody.tbl__fill tr:hover { + cursor: default; + background: none; +} + .tbl[data-open] tbody tr { cursor: pointer; } diff --git a/web/src/ui/parts/table.ts b/web/src/ui/parts/table.ts index 2d94b8f..0c7a3f5 100644 --- a/web/src/ui/parts/table.ts +++ b/web/src/ui/parts/table.ts @@ -48,9 +48,10 @@ export function mountTable(host: HTMLElement, o: TableOptions): TableHandl footCells.set(c.key, cell); row.append(cell); } - table.append(h("tfoot", {}, row)); + const fill = h("td", { attrs: { colspan: String(o.columns.length), "aria-hidden": "true" } }); + table.append(h("tbody", { class: "tbl__fill" }, h("tr", {}, fill)), h("tfoot", {}, row)); } - const root = h("div", { class: "tbl", attrs: { "data-empty": "true" } }, table, empty, error); + const root = h("div", { class: "tbl", attrs: o.foot ? { "data-empty": "true", "data-foot": "true" } : { "data-empty": "true" } }, table, empty, error); host.append(root); const rows = new Map(); From 8d8ecdae534459f521f1efca3ac63b142ec08edc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:06:17 -0500 Subject: [PATCH 02/31] fix(web/payments): load open invoices once per party with a stale guard Each invoice load takes its own sequence number and a late answer is dropped, so choosing a party no longer adds, removes and re-adds a row. --- web/src/ui/views/payments.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/src/ui/views/payments.ts b/web/src/ui/views/payments.ts index a1e2a5e..3e5c0c8 100644 --- a/web/src/ui/views/payments.ts +++ b/web/src/ui/views/payments.ts @@ -279,18 +279,23 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U writeRemainder(); }; + let loadSeq = 0; + let loadedFor: string | null = null; const loadInvoices = async (p: Payment | null) => { + const mine = ++loadSeq; const who = parties.get(party.value); if (!who) { + loadedFor = ""; setAllocRows([], p); return; } - const mine = seq; try { const inv = await openInvoices(ctx.api, f, who.id); - if (mine === seq) setAllocRows(inv, p); + if (mine !== loadSeq) return; + loadedFor = who.code; + setAllocRows(inv, p); } catch (e) { - if (mine === seq) fail(e); + if (mine === loadSeq) fail(e); } }; @@ -390,7 +395,7 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U ); amount.addEventListener("input", writeRemainder); party.addEventListener("change", () => { - seq++; + if (loadedFor === party.value) return; for (const r of rows.values()) r.input.value = ""; void loadInvoices(current); }); From e5846933dea9ecf7aa8dedc95bf991326836cc4f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:06:36 -0500 Subject: [PATCH 03/31] feat(web): pass the document currency to the line grid The form now calls grid.setCurrency with the loaded document's currency so line amounts use its decimal places. --- web/src/ui/views/docform.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/ui/views/docform.ts b/web/src/ui/views/docform.ts index 8e2d994..0251bb7 100644 --- a/web/src/ui/views/docform.ts +++ b/web/src/ui/views/docform.ts @@ -172,6 +172,7 @@ function mountForm(spec: FamilySpec, host: HTMLElement, ctx: ViewContext): (para const fill = async (d: Doc) => { doc = d; + grid.setCurrency(d.currency); setValue(kindSelect, d.kind); setValue(dateInput, d.date); setValue(dueInput, d.dueDate); From 6d27693870b485baf1e820424fe4554400d57e82 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:06:46 -0500 Subject: [PATCH 04/31] feat(icons): add sidebar icons for selling buying stock ledger and setup Twenty hand-drawn icons in the existing 24 box, 1.75 stroke, round caps. --- web/src/ui/icons.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/web/src/ui/icons.ts b/web/src/ui/icons.ts index 8042558..6622d2f 100644 --- a/web/src/ui/icons.ts +++ b/web/src/ui/icons.ts @@ -3,6 +3,26 @@ const PATHS = { home: '', lock: '', user: '', + quote: '', + clipboardCheck: '', + document: '', + trayIn: '', + clock: '', + clipboardList: '', + receipt: '', + trayOut: '', + box: '', + truck: '', + layers: '', + scales: '', + table: '', + trend: '', + bars: '', + building: '', + tag: '', + percent: '', + warehouse: '', + tree: '', close: '', info: '', success: '', From 0476c36ae1887957e77aeb9487a67ce10c0759ab Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:06:46 -0500 Subject: [PATCH 05/31] feat(icons): map every sidebar view id to an icon VIEW_ICONS is typed against IconName so a wrong name fails the check. --- web/src/ui/view-icons.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 web/src/ui/view-icons.ts diff --git a/web/src/ui/view-icons.ts b/web/src/ui/view-icons.ts new file mode 100644 index 0000000..85fb04f --- /dev/null +++ b/web/src/ui/view-icons.ts @@ -0,0 +1,26 @@ +import type { IconName } from "./icons"; + +export const VIEW_ICONS: Record = { + quotes: "quote", + "sales-orders": "clipboardCheck", + "sales-invoices": "document", + "payments-in": "trayIn", + "receivables-ageing": "clock", + "purchase-orders": "clipboardList", + "goods-receipts": "box", + "purchase-invoices": "receipt", + "payments-out": "trayOut", + "payables-ageing": "clock", + "delivery-notes": "truck", + "stock-balance": "layers", + "trial-balance": "scales", + "general-ledger": "table", + "profit-and-loss": "trend", + "balance-sheet": "bars", + customers: "user", + suppliers: "building", + items: "tag", + "tax-rates": "percent", + warehouses: "warehouse", + accounts: "tree", +}; From 1cfafb53d7316b34918243b45cfe2f14ede1f2ec Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:06:54 -0500 Subject: [PATCH 06/31] feat(web/payments): pick the payment party with the shared picker The party select becomes the shared picker, as on the document form, in a host of fixed size, and a picked party outside the first page of parties is still loaded. --- web/src/styles/views/payments.css | 7 ++++++ web/src/ui/views/payments.ts | 41 ++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/web/src/styles/views/payments.css b/web/src/styles/views/payments.css index bab05bf..f6e5b24 100644 --- a/web/src/styles/views/payments.css +++ b/web/src/styles/views/payments.css @@ -66,6 +66,13 @@ min-inline-size: 0; } +.pay__picker { + position: relative; + inline-size: 100%; + block-size: var(--row); + min-inline-size: 0; +} + .pay__value { display: block; block-size: var(--row); diff --git a/web/src/ui/views/payments.ts b/web/src/ui/views/payments.ts index 3e5c0c8..c6dc920 100644 --- a/web/src/ui/views/payments.ts +++ b/web/src/ui/views/payments.ts @@ -27,6 +27,7 @@ import { type PaymentDraft, } from "../../engine/payments"; import { delayedIndicator, h, setAttr, setText } from "../dom"; +import { mountPicker } from "../parts/picker"; import { mountTable } from "../parts/table"; import type { ViewContext, ViewDef } from "../views"; @@ -120,8 +121,7 @@ function field(label: string, control: HTMLElement): HTMLElement { function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: URLSearchParams) => void { const f: PayFamily = FAMILIES[dir]; const formId = dir === "in" ? "payment-in" : "payment-out"; - const party = h("select", { class: "input" }); - party.append(h("option", { attrs: { value: "" }, text: "Choose" })); + const partyHost = h("div", { class: "pay__picker" }); const date = h("input", { class: "input", attrs: { type: "date" } }); const amount = h("input", { class: "input pay__num", attrs: { inputmode: "decimal", autocomplete: "off" } }); const account = h("select", { class: "input" }); @@ -133,7 +133,7 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U const grid = h( "div", { class: "pay__grid" }, - field(dir === "in" ? "Customer" : "Supplier", party), + h("div", { class: "field pay__field" }, h("span", { class: "field__label", text: dir === "in" ? "Customer" : "Supplier" }), partyHost), field("Date", date), field("Amount", amount), field(dir === "in" ? "Deposit to" : "Paid from", account), @@ -182,6 +182,13 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U const error = h("p", { class: "form__error pay__error", attrs: { role: "alert" } }); const root = h("div", { class: "pay pay--form panel", attrs: { "data-status": "new" } }, head, grid, h("h2", { class: "panel__title pay__sub", text: "Allocation" }), allocBox, error, actions); host.append(root); + const party = mountPicker(partyHost, ctx, { + kind: f.partyKey, + label: dir === "in" ? "Customer" : "Supplier", + required: true, + onPick: () => onParty(), + }); + const partyCode = (): string => party.get()?.code ?? ""; const rows = new Map(); const parties = new Map(); @@ -274,7 +281,7 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U r.el.remove(); rows.delete(id); } - setText(allocEmpty, list.length ? "" : party.value ? "No open invoices for this party." : "Choose a party to see open invoices."); + setText(allocEmpty, list.length ? "" : partyCode() ? "No open invoices for this party." : "Choose a party to see open invoices."); setAttr(allocBox, "data-empty", list.length ? null : "true"); writeRemainder(); }; @@ -283,7 +290,7 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U let loadedFor: string | null = null; const loadInvoices = async (p: Payment | null) => { const mine = ++loadSeq; - const who = parties.get(party.value); + const who = parties.get(partyCode()); if (!who) { loadedFor = ""; setAllocRows([], p); @@ -311,14 +318,16 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U cancel.disabled = st !== "posted" || !canPost; save.hidden = !canDraft; post.hidden = allocate.hidden = cancel.hidden = !canPost; - for (const c of [party, date, amount, account, memo]) c.disabled = !draft || !canDraft; + party.setDisabled(!draft || !canDraft); + for (const c of [date, amount, account, memo]) c.disabled = !draft || !canDraft; setText(number, current?.number ?? (current ? "Draft" : "New payment")); setText(status, st === "new" ? "" : st); }; const fill = (p: Payment | null) => { current = p; - party.value = p ? (parties.has(p.party) ? p.party : "") : ""; + const pp = p ? parties.get(p.party) : undefined; + if (partyCode() !== (pp?.code ?? "")) party.set(pp ? { id: pp.id, code: pp.code, name: pp.name, record: {} } : null); date.value = p?.date ?? today(); amount.value = p ? money(p.amount) : ""; account.value = p?.account ?? ""; @@ -334,7 +343,7 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U setText(error, "Enter an amount greater than zero."); return null; } - return { party: party.value, date: date.value, amount: amt, account: account.value, memo: memo.value.trim() }; + return { party: partyCode(), date: date.value, amount: amt, account: account.value, memo: memo.value.trim() }; }; const allocList = (): AllocationInput[] => [...entered()].map(([invoice, amt]) => ({ invoice, amount: amt })); @@ -394,18 +403,20 @@ function mountForm(dir: PayDir, host: HTMLElement, ctx: ViewContext): (params: U }), ); amount.addEventListener("input", writeRemainder); - party.addEventListener("change", () => { - if (loadedFor === party.value) return; + function onParty(): void { + const code = partyCode(); + if (code && !parties.has(code)) { + const g = party.get(); + if (g) parties.set(code, { id: g.id, code, name: g.name, currency: "" }); + } + if (loadedFor === code) return; for (const r of rows.values()) r.input.value = ""; void loadInvoices(current); - }); + } const ready = (async () => { const [ps, accts] = await Promise.all([listParties(ctx.api, f), listAssetAccounts(ctx.api)]); - for (const p of ps) { - parties.set(p.code, p); - party.append(h("option", { attrs: { value: p.code }, text: `${p.code} ${p.name}` })); - } + for (const p of ps) parties.set(p.code, p); for (const a of accts) account.append(h("option", { attrs: { value: a.code }, text: `${a.code} ${a.name}` })); })().catch(fail); From 2d9e4e038e8271ad87fb527c4bf5f22a8a613383 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:07:34 -0500 Subject: [PATCH 07/31] feat(web): show an icon beside each screen in the sidebar A screen with no icon of its own takes the one mapped to its id; the sidebar already reserved the icon's column, so labels do not move. --- web/src/ui/views.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/ui/views.ts b/web/src/ui/views.ts index 2a0d5da..2b49151 100644 --- a/web/src/ui/views.ts +++ b/web/src/ui/views.ts @@ -1,6 +1,7 @@ import type { Api, Engine } from "../engine"; import { h, ref, setAttr, setText } from "./dom"; import { iconNode, type IconName } from "./icons"; +import { VIEW_ICONS } from "./view-icons"; import { ALL_VIEWS } from "./views/index"; export type ViewGroup = "Selling" | "Buying" | "Stock" | "Ledger" | "Setup"; @@ -75,7 +76,8 @@ export function mountViews(engine: Engine): void { let link: HTMLAnchorElement | null = null; if (def.nav) { const mark = h("span", { class: "sb-icon" }); - if (def.icon) mark.append(iconNode(def.icon)); + const icon = def.icon ?? VIEW_ICONS[def.id]; + if (icon) mark.append(iconNode(icon)); link = h("a", { class: "sb-item", attrs: { href: hashFor(def.id) } }, mark, h("span", { class: "sb-label", text: def.title })); nav.append(link); } From 5bbd70fc048a2645675c6519977fe7d6f8e68a4d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:11:17 -0500 Subject: [PATCH 08/31] fix(statements): size the totals tables with the shared block height and hide the filler The filler row under each statement table shrank as rows arrived and was the only node shifting, 0.061 on profit and loss and 0.060 on the balance sheet; it is now 0. --- web/src/styles/views/statements.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/styles/views/statements.css b/web/src/styles/views/statements.css index 1bd4ea0..6b35460 100644 --- a/web/src/styles/views/statements.css +++ b/web/src/styles/views/statements.css @@ -72,9 +72,12 @@ } .st .tbl { - block-size: calc(var(--row) * var(--st-rows)); - min-block-size: calc(var(--row) * var(--st-rows)); - overflow: auto; + --tbl-block: calc(var(--row) * var(--st-rows)); + min-block-size: var(--tbl-block); +} + +.st .tbl__fill { + visibility: hidden; } .st__summary { From 48e5765741e286e674d82113ec6085bab7755dd7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:12:42 -0500 Subject: [PATCH 09/31] fix(web): reserve the count's width so load more stays put The count beside a document list's load more button changed width when rows arrived and moved the button. It now has a fixed width, so layout shift without input on the paged lists is zero. --- web/src/styles/views/doclists.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/styles/views/doclists.css b/web/src/styles/views/doclists.css index 8d0b8e9..d9fd205 100644 --- a/web/src/styles/views/doclists.css +++ b/web/src/styles/views/doclists.css @@ -5,6 +5,7 @@ --dl-col-status: 112px; --dl-col-total: 168px; --dl-filter-width: 160px; + --dl-count-width: 24ch; display: flex; flex-direction: column; gap: var(--space-3); @@ -32,6 +33,9 @@ } .dl__count { + inline-size: var(--dl-count-width); + white-space: nowrap; + text-align: end; font-variant-numeric: tabular-nums; } From a20d18dea7268c0d2c15c64c8e8f1af7d0522fc1 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:13:01 -0500 Subject: [PATCH 10/31] fix(web): give the totals amounts a fixed column so posting does not shift them The totals list used an auto column that widened as the total grew, moving the amounts sideways on post; a fixed 16ch column keeps them still. --- web/src/styles/views/grid.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/styles/views/grid.css b/web/src/styles/views/grid.css index 4e8da2e..8c69c67 100644 --- a/web/src/styles/views/grid.css +++ b/web/src/styles/views/grid.css @@ -178,7 +178,7 @@ .grid__totals { display: grid; - grid-template-columns: 1fr auto; + grid-template-columns: minmax(0, 1fr) 16ch; column-gap: var(--space-4); row-gap: var(--space-1); inline-size: var(--grid-totals-w); From f5834a6a53b13d269acf1a778438a1143322fcd9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:13:21 -0500 Subject: [PATCH 11/31] fix(masters): place a created row at its code order A new setup row is moved to its sorted position by its first column instead of being appended at the end of the list. --- web/src/ui/views/masters.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/web/src/ui/views/masters.ts b/web/src/ui/views/masters.ts index 3d072c8..0324a03 100644 --- a/web/src/ui/views/masters.ts +++ b/web/src/ui/views/masters.ts @@ -84,6 +84,21 @@ function mountMaster(m: Master, host: HTMLElement, ctx: ViewContext): { show(): if (fresh.disabled === ok) fresh.disabled = !ok; }; + const place = (row: Row) => { + const tr = listHost.querySelector(`tr[data-key="${CSS.escape(String(row.id))}"]`); + const body = tr?.parentElement; + if (!tr || !body) return; + const code = String(row.code ?? ""); + for (const other of body.children) { + if (other === tr) return; + const text = other.firstElementChild?.textContent ?? ""; + if (text.localeCompare(code, undefined, { numeric: true }) > 0) { + body.insertBefore(tr, other); + return; + } + } + }; + let saving = false; const submit = async () => { if (saving || !allowed()) return; @@ -100,8 +115,10 @@ function mountMaster(m: Master, host: HTMLElement, ctx: ViewContext): { show(): save.disabled = true; setText(error, ""); try { + const isNew = !current; const row = current ? await update(ctx.api, m, String(current.id), built.body) : await create(ctx.api, m, built.body); table.patchRow(row); + if (isNew) place(row); fill(row); } catch (e) { setText(error, e instanceof ApiError ? e.message : "The change could not be saved."); From b96793f25edd75c3a068a82643be9830ff68f227 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:13:30 -0500 Subject: [PATCH 12/31] feat(statements): start profit and loss at the fiscal year start The default From is the start of the fiscal year containing the end date, read from the fiscal years route, falling back to January 1 when none contains it. --- web/src/engine/statements.ts | 15 +++++++++++++++ web/src/ui/views/statements.ts | 20 +++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/web/src/engine/statements.ts b/web/src/engine/statements.ts index a77b8ac..e5af42a 100644 --- a/web/src/engine/statements.ts +++ b/web/src/engine/statements.ts @@ -38,6 +38,21 @@ export function yearStart(day: string): string { return `${day.slice(0, 4)}-01-01`; } +interface FiscalYear { + startDate: string; + endDate: string; +} + +export async function fiscalStart(api: Api, day: string): Promise { + try { + const r = await api.call<{ years: FiscalYear[] }>("GET", "/api/fiscal-years"); + const hit = r.years.find((y) => y.startDate <= day && day <= y.endDate); + return hit ? hit.startDate : yearStart(day); + } catch { + return yearStart(day); + } +} + export function profitAndLoss(api: Api, from: string, to: string): Promise { const q = new URLSearchParams({ from, to }); return api.call("GET", `/api/reports/profit-and-loss?${q}`); diff --git a/web/src/ui/views/statements.ts b/web/src/ui/views/statements.ts index e435fb9..7932a85 100644 --- a/web/src/ui/views/statements.ts +++ b/web/src/ui/views/statements.ts @@ -2,9 +2,9 @@ import { ApiError } from "../../engine"; import { money, today } from "../../engine/format"; import { balanceSheet, + fiscalStart, profitAndLoss, resultLabel, - yearStart, type StatementLine, type StatementSection, } from "../../engine/statements"; @@ -138,6 +138,7 @@ function profitAndLossView(): ViewDef { let refresh: () => void = () => undefined; const from = dateInput("from"); const to = dateInput("to"); + let startSeq = 0; return { id: "profit-and-loss", title: "Profit and loss", @@ -167,8 +168,21 @@ function profitAndLossView(): ViewDef { show(params) { const day = params.get("to") || today(); to.value = day; - from.value = params.get("from") || yearStart(day); - refresh(); + const given = params.get("from"); + if (given) { + from.value = given; + refresh(); + return; + } + const mine = ++startSeq; + from.value = ""; + const api = ctx?.api; + if (!api) return; + void fiscalStart(api, day).then((start) => { + if (mine !== startSeq) return; + from.value = start; + refresh(); + }); }, }; } From df0d9ea0d41ece12f77fa366a16d919c4bf983c4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:13:31 -0500 Subject: [PATCH 13/31] docs(masters): log how a created row is placed Notes why the one new row is moved to its sorted position after a create. --- web/HASHOUT_LOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index 3a5f10f..6c33324 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -577,3 +577,11 @@ One form per family (`sales-doc`, `purchase-doc`) is built on first show from `S - logged: v0.7.0 · 2026-11-27 Six setup views come from one table of specs. Each view builds its table and a fixed-size form once; opening a row rewrites the field values and locks the fields the server refuses to change after create (code, type, currency, linked account codes). Edit sends only the fields that changed. Account, tax rate and item links are typed as codes, not picked, because the picker slice may not land; the server's own sentence shows when a code is unknown. Accounts have no cursor, so the whole chart is read once. + +## masters new row placement + +- refers-to: src/ui/views/masters.ts :: mountMaster +- kind: rationale +- logged: v0.7.0 · 2026-11-27 + +The shared table appends a row it has not seen. After a create, the one new row is moved to its place among the siblings by comparing first-column text with a numeric collation, so a new account lands in code order. Only that row moves; saving an edit rewrites the row in place. From 1add1b3ed8e26ae03049bc5c69cb12e8723bb0b0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:13:47 -0500 Subject: [PATCH 14/31] docs(statements): say the window starts profit and loss at the fiscal year Records the new default start and the layout shift trace. --- docs/ledger/statements.md | 2 +- web/HASHOUT_LOG.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/ledger/statements.md b/docs/ledger/statements.md index c02c75a..cf141b4 100644 --- a/docs/ledger/statements.md +++ b/docs/ledger/statements.md @@ -39,4 +39,4 @@ Two views in the Ledger group, "Profit and loss" (a From and To date) and "Balan ## Defaults to confirm - One currency: amounts of accounts in different currencies are added together as they are. Every account in the starter chart is in `USD`. -- The profit and loss starts on the first of January of the end date's year by default, not the start of the fiscal year. +- In the window, the profit and loss starts on the first day of the fiscal year (from `GET /api/fiscal-years`) that contains the end date, and on the first of January of the end date's year when no fiscal year contains it. The route itself, called without `from`, still uses the first of January. diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index 6c33324..d1da8df 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -585,3 +585,11 @@ Six setup views come from one table of specs. Each view builds its table and a f - logged: v0.7.0 · 2026-11-27 The shared table appends a row it has not seen. After a create, the one new row is moved to its place among the siblings by comparing first-column text with a numeric collation, so a new account lands in code order. Only that row moves; saving an edit rewrites the row in place. + +## statements layout shift and fiscal start + +- refers-to: src/ui/views/statements.ts, src/styles/views/statements.css :: .st .tbl__fill +- kind: rationale +- logged: v0.7.0 · 2026-11-27 + +Under CPU 4x and 400 ms latency, the only node that shifted on a hard reload was the empty filler body inside each totals table (0.061 on profit and loss, 0.060 on the balance sheet); it shrinks as rows arrive and holds nothing, so it is hidden and the tables take their height from the shared block variable. Profit and loss leaves From empty (same size) until the fiscal years answer, then fills it and loads once; an address with a from skips the wait. A stale answer is dropped by a counter. From f8fd26cb09b59f941f0e79ef7c41484cb9ee6ec4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:14:10 -0500 Subject: [PATCH 15/31] fix(ledger-screens): fill the window and keep the totals row still The five screens size their table to the window with --tbl-block and hide the filler row. The totals row sticks as a row so it no longer reports a shift. --- web/src/styles/views/ledger-screens.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/src/styles/views/ledger-screens.css b/web/src/styles/views/ledger-screens.css index 0bd8072..1ce8026 100644 --- a/web/src/styles/views/ledger-screens.css +++ b/web/src/styles/views/ledger-screens.css @@ -2,6 +2,8 @@ --ls-field: 36px; --ls-label: 20px; --ls-status: 24px; + --ls-above: 250px; + --tbl-block: max(calc(var(--row) * 8), calc(100dvh - var(--ls-above))); display: flex; flex-direction: column; row-gap: var(--space-3); @@ -42,3 +44,16 @@ overflow: hidden; text-overflow: ellipsis; } + +.ls .tbl__fill { + visibility: hidden; +} + +.ls .tbl[data-foot] tfoot { + position: sticky; + inset-block-end: 0; +} + +.ls .tbl[data-foot] .tbl__table tfoot td { + position: static; +} From 3ccbc58007a74e144ffedbfeae7d045ac2a12796 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:14:15 -0500 Subject: [PATCH 16/31] docs(ledger-screens): log the table height and the totals row Records why the screens size to the window and how the totals row sticks. --- web/HASHOUT_LOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index d1da8df..bea0e86 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -593,3 +593,10 @@ The shared table appends a row it has not seen. After a create, the one new row - logged: v0.7.0 · 2026-11-27 Under CPU 4x and 400 ms latency, the only node that shifted on a hard reload was the empty filler body inside each totals table (0.061 on profit and loss, 0.060 on the balance sheet); it shrinks as rows arrive and holds nothing, so it is hidden and the tables take their height from the shared block variable. Profit and loss leaves From empty (same size) until the fiscal years answer, then fills it and loads once; an address with a from skips the wait. A stale answer is dropped by a counter. + +### src/styles/views/ledger-screens.css · table height +- refers-to: src/styles/views/ledger-screens.css :: .ls +- kind: rationale +- logged: v0.8.0 · 2026-11-27 + +The five screens set `--tbl-block` to the window height less `--ls-above` (250px: the shell header, title, filter bar and status line plus a bottom margin), never under eight rows, so a long trial balance or ledger scrolls inside a box that ends near the bottom of the window. The filler row is hidden and the totals stick as a row (`tfoot`), not as cells: with cells the row's own box moved when rows arrived and Chrome reported it, 0.18 on the trial balance and 0.30 on the ledger, 0.096 on the other three. Both rules sit under `.ls` until the shared table styles take them. From 60f90897c17558539200885870d06e7551736e9f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:14:18 -0500 Subject: [PATCH 17/31] fix(web/payments): reserve the allocation box so invoice rows do not push the form The allocation box keeps a fixed height of eight rows with the unallocated line sticky at its foot, so rows arriving after a party is picked no longer move the error line and buttons. --- web/src/styles/views/payments.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/styles/views/payments.css b/web/src/styles/views/payments.css index f6e5b24..3bbb085 100644 --- a/web/src/styles/views/payments.css +++ b/web/src/styles/views/payments.css @@ -100,6 +100,20 @@ border-color: var(--danger); } +.pay__alloc-box { + display: flex; + flex-direction: column; + block-size: calc(var(--row) * 8); + overflow-y: auto; +} + +.pay__alloc-box .pay__remain { + position: sticky; + inset-block-end: 0; + margin-block-start: auto; + background: var(--surface); +} + .pay__remain { display: flex; justify-content: flex-end; From 7cef5f22937c57a13c574df16802aa01773c6cf6 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:14:28 -0500 Subject: [PATCH 18/31] docs(web): log the fixed totals column and the currency hand-off Records why the totals amounts use a fixed column and where the form sets the grid currency. --- web/HASHOUT_LOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index bea0e86..f47cc6a 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -600,3 +600,10 @@ Under CPU 4x and 400 ms latency, the only node that shifted on a hard reload was - logged: v0.8.0 · 2026-11-27 The five screens set `--tbl-block` to the window height less `--ls-above` (250px: the shell header, title, filter bar and status line plus a bottom margin), never under eight rows, so a long trial balance or ledger scrolls inside a box that ends near the bottom of the window. The filler row is hidden and the totals stick as a row (`tfoot`), not as cells: with cells the row's own box moved when rows arrived and Chrome reported it, 0.18 on the trial balance and 0.30 on the ledger, 0.096 on the other three. Both rules sit under `.ls` until the shared table styles take them. + +### src/styles/views/grid.css · totals column +- refers-to: src/styles/views/grid.css :: .grid__totals; src/ui/views/docform.ts :: fill +- kind: rationale +- logged: v0.8.0 · 2026-11-27 + +The amounts column of the totals list is a fixed 16ch, not `auto`: with `auto` it widened as the total grew and the three amounts moved sideways on post (0.00003, sources the three `dd`). The form passes the loaded document's currency to `grid.setCurrency`, which returns early when it has not changed, so the label is written once per document. From 24b64703baf04fbb0aa0c0559d633ed9286296ec Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:15:28 -0500 Subject: [PATCH 19/31] fix(web/payments): hide the table filler row on payment and stock screens The shared filler row moved down and shrank as rows arrived, which Chrome counted as a shift of about 0.08, so these screens hide it inside the fixed table box. --- web/src/styles/views/payments.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/styles/views/payments.css b/web/src/styles/views/payments.css index 3bbb085..11e0f0a 100644 --- a/web/src/styles/views/payments.css +++ b/web/src/styles/views/payments.css @@ -100,6 +100,10 @@ border-color: var(--danger); } +.pay .tbl__fill { + display: none; +} + .pay__alloc-box { display: flex; flex-direction: column; From da3cedb8242daaf8411f7d65010a3949dff3da61 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:15:35 -0500 Subject: [PATCH 20/31] docs(web): log the payment invoice load and reserved boxes Records why the payment form loads invoices once per party and why its boxes are fixed. --- web/HASHOUT_LOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index f47cc6a..959202d 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -607,3 +607,10 @@ The five screens set `--tbl-block` to the window height less `--ls-above` (250px - logged: v0.8.0 · 2026-11-27 The amounts column of the totals list is a fixed 16ch, not `auto`: with `auto` it widened as the total grew and the three amounts moved sideways on post (0.00003, sources the three `dd`). The form passes the loaded document's currency to `grid.setCurrency`, which returns early when it has not changed, so the label is written once per document. + +### src/ui/views/payments.ts · one invoice load per party +- refers-to: src/ui/views/payments.ts :: loadInvoices; src/styles/views/payments.css :: .pay__alloc-box, .pay .tbl__fill +- kind: rationale +- logged: v0.8.0 · 2026-11-27 + +Each invoice load takes its own number and only the latest may write rows, and a pick of the party already loaded does nothing, so `open()` and a party pick no longer race to add, remove and re-add a row. The party is the shared picker; a picked party outside the first 200 is added to the local map so its invoices still load. The allocation box is a fixed eight rows with the unallocated line sticky at its foot: before, rows arriving pushed the error line and buttons (0.008 on the received form, 0.0023 on the made form). The shared filler row is hidden under `.pay`: it moved from y 281 to 633 and shrank from 358 to 6px as rows arrived, 0.082 on a goods receipt and 0.085 on the received list. From 3b2e661d7c4dd262a3e78040019ca632f1bffb51 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:15:45 -0500 Subject: [PATCH 21/31] docs(window): bring the window page up to date Sidebar icons, the count width, the party picker on payments and the fiscal year start of profit and loss are now stated; the moving totals row line is gone. --- docs/window/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/window/README.md b/docs/window/README.md index 0c573b1..1e96de3 100644 --- a/docs/window/README.md +++ b/docs/window/README.md @@ -1,14 +1,14 @@ # The window -The web client is the same app as the command line and the server's routes, shown as screens. Everything it does goes through the routes described in `docs/selling/`, `docs/buying/`, `docs/stock/` and `docs/ledger/`; it keeps no numbers of its own. This page says what is on each screen as of v0.7.0 and what is not there yet. +The web client is the same app as the command line and the server's routes, shown as screens. Everything it does goes through the routes described in `docs/selling/`, `docs/buying/`, `docs/stock/` and `docs/ledger/`; it keeps no numbers of its own. This page says what is on each screen and what is not there yet. ## Getting around -The sidebar groups the screens: Selling, Buying, Stock, Ledger and Setup. The address in the browser names the screen, for example `#/quotes?status=posted`, so a reload or a bookmark comes back to the same place. A screen shows only the actions your role allows. +The sidebar groups the screens: Selling, Buying, Stock, Ledger and Setup, with a small icon beside each screen. The address in the browser names the screen, for example `#/quotes?status=posted`, so a reload or a bookmark comes back to the same place. A screen shows only the actions your role allows. ## Lists -There is one list for each kind of document: quotes, sales orders, sales invoices, delivery notes, payments received, purchase orders, goods receipts, purchase invoices and payments made. Each shows the number, date, party, status and total, can be narrowed by status, and loads more rows on request. A draft that has no number yet reads "Draft". Open a row with a click or with Enter. +There is one list for each kind of document: quotes, sales orders, sales invoices, delivery notes, payments received, purchase orders, goods receipts, purchase invoices and payments made. Each shows the number, date, party, status and total, can be narrowed by status, and loads more rows on request, 100 at a time. The count beside the Load more button has a fixed width, so the button does not move when rows arrive. A draft that has no number yet reads "Draft". Open a row with a click or with Enter. ## The document form @@ -22,7 +22,7 @@ When the server refuses something, for example a locked period, its own sentence ## Payments -A payment names the party, the date, the amount and the account, and lists that party's open invoices. Type an amount against each invoice the payment covers; what is left over is shown as you type and stays on account. +A payment names the party (picked by typing part of its code or name, as on the document form), the date, the amount and the account, and lists that party's open invoices. Type an amount against each invoice the payment covers; what is left over is shown as you type and stays on account. ## Goods receipts and delivery notes @@ -34,12 +34,11 @@ Customers, suppliers, items, tax rates, warehouses and the chart of accounts eac ## Ledger and position screens -Trial balance (as of a day, and whether it balances), general ledger (one account over a range, with a running balance), profit and loss (over a range), balance sheet (as of a day), receivables and payables ageing, and stock balance with its value and the check against the books. `docs/ledger/statements.md` describes how profit and loss and the balance sheet are built. +Trial balance (as of a day, and whether it balances), general ledger (one account over a range, with a running balance), profit and loss (over a range that starts at the fiscal year's first day), balance sheet (as of a day), receivables and payables ageing, and stock balance with its value and the check against the books. `docs/ledger/statements.md` describes how profit and loss and the balance sheet are built. ## Not there yet - Amounts are shown with two decimal places for every currency. - Receipts and delivery notes cannot be edited before posting. -- There are no icons in the sidebar, no search across documents, and no printing. +- There is no search across documents and no printing. - The setup lists have no delete, because the server has none. -- A list's totals row sits under its rows and moves once when the rows arrive. From a23af35aec073c7998f0e1f2022a1932e75cfaca Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:16:31 -0500 Subject: [PATCH 22/31] fix(web): hide the table's filler row and pin the whole totals row The filler shrank as rows arrived and counted as a layout shift on every list with totals; it is now hidden, and the totals row itself sticks so it no longer moves off screen on a long list. --- web/src/styles/parts.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/styles/parts.css b/web/src/styles/parts.css index 6d74553..181627a 100644 --- a/web/src/styles/parts.css +++ b/web/src/styles/parts.css @@ -103,12 +103,19 @@ inset-block-start: 0; } -.tbl[data-foot] .tbl__table tfoot td { +.tbl[data-foot] .tbl__table tfoot { position: sticky; inset-block-end: 0; +} + +.tbl[data-foot] .tbl__table tfoot td { background: var(--surface); } +.tbl__fill { + visibility: hidden; +} + .tbl__fill td { block-size: auto; padding: 0; From ea475d9607c548be2d96112ba05900ef617aa451 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:19:05 -0500 Subject: [PATCH 23/31] fix(web): give the line grid a fixed-height scrolling body Eight lines fit before the body scrolls, so a new line no longer pushes the totals, error line and actions down. --- web/src/styles/views/grid.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/styles/views/grid.css b/web/src/styles/views/grid.css index 8c69c67..8626c0d 100644 --- a/web/src/styles/views/grid.css +++ b/web/src/styles/views/grid.css @@ -82,8 +82,9 @@ } .grid__scroll { - overflow-x: auto; - overflow-y: hidden; + overflow: auto; + block-size: calc(var(--grid-row) + 8 * (var(--grid-row) + var(--grid-err)) + 2px); + overscroll-behavior: contain; } .grid__table { From 054132acd7be2f344a43bf76f46988aeb6ab9a5b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:19:05 -0500 Subject: [PATCH 24/31] fix(web): hold the picker list at one height while it filters The list kept flipping above the input at full height and dropping below once it shrank; a fixed minimum height keeps its side and size. --- web/src/ui/parts/picker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/ui/parts/picker.ts b/web/src/ui/parts/picker.ts index 52d5dc7..36dc8af 100644 --- a/web/src/ui/parts/picker.ts +++ b/web/src/ui/parts/picker.ts @@ -98,7 +98,8 @@ export function mountPicker(host: HTMLElement, ctx: ViewContext, o: PickerOption if (!list) return; const r = input.getBoundingClientRect(); list.style.left = `${Math.round(r.left)}px`; - const room = list.offsetHeight || 9 * 32; + const room = Math.max(list.offsetHeight, 320); + list.style.minHeight = `${room}px`; const below = r.bottom + room <= window.innerHeight || r.top < room; list.style.top = `${Math.round(below ? r.bottom : r.top - room)}px`; list.style.width = `${Math.max(Math.round(r.width), 240)}px`; From 0bfa7c6d89e5cbbb611b6e42b68d55e8a7a944ff Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:19:35 -0500 Subject: [PATCH 25/31] fix(web): size the table's filler from the row count Chrome gave the spare height to the data rows, which stretched; the filler now takes box height minus the rows, read from one custom property the table writes, so rows keep their height and the totals stay at the foot. --- web/src/styles/parts.css | 9 +++------ web/src/ui/parts/table.ts | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/src/styles/parts.css b/web/src/styles/parts.css index 181627a..44652cc 100644 --- a/web/src/styles/parts.css +++ b/web/src/styles/parts.css @@ -90,14 +90,11 @@ } .tbl[data-foot] { - block-size: var(--tbl-block, calc(var(--row) * 14)); + --tbl-box: var(--tbl-block, calc(var(--row) * 14)); + block-size: var(--tbl-box); overflow: auto; } -.tbl[data-foot] .tbl__table { - block-size: 100%; -} - .tbl[data-foot] .tbl__table thead th { position: sticky; inset-block-start: 0; @@ -117,7 +114,7 @@ } .tbl__fill td { - block-size: auto; + block-size: max(0px, calc(var(--tbl-box) - var(--row) * (var(--tbl-rows, 0) + 2) - 2px)); padding: 0; border: 0; } diff --git a/web/src/ui/parts/table.ts b/web/src/ui/parts/table.ts index 0c7a3f5..ed9632f 100644 --- a/web/src/ui/parts/table.ts +++ b/web/src/ui/parts/table.ts @@ -85,7 +85,10 @@ export function mountTable(host: HTMLElement, o: TableOptions): TableHandl }); } - const mark = () => setAttr(root, "data-empty", rows.size ? null : "true"); + const mark = () => { + setAttr(root, "data-empty", rows.size ? null : "true"); + if (o.foot) root.style.setProperty("--tbl-rows", String(rows.size)); + }; let endBusy: (() => void) | null = null; return { From 77cf01750f91b9157a6d06c07360ee956982edb1 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:19:35 -0500 Subject: [PATCH 26/31] refactor(web): drop the per-screen filler rules the shared table now covers The payment and ledger screens each hid or re-pinned the filler locally; with the shared fix those rules left the totals unpinned on payment lists. --- web/src/styles/views/ledger-screens.css | 15 +-------------- web/src/styles/views/payments.css | 4 ---- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/web/src/styles/views/ledger-screens.css b/web/src/styles/views/ledger-screens.css index 1ce8026..65caed5 100644 --- a/web/src/styles/views/ledger-screens.css +++ b/web/src/styles/views/ledger-screens.css @@ -43,17 +43,4 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -} - -.ls .tbl__fill { - visibility: hidden; -} - -.ls .tbl[data-foot] tfoot { - position: sticky; - inset-block-end: 0; -} - -.ls .tbl[data-foot] .tbl__table tfoot td { - position: static; -} +} \ No newline at end of file diff --git a/web/src/styles/views/payments.css b/web/src/styles/views/payments.css index 11e0f0a..3bbb085 100644 --- a/web/src/styles/views/payments.css +++ b/web/src/styles/views/payments.css @@ -100,10 +100,6 @@ border-color: var(--danger); } -.pay .tbl__fill { - display: none; -} - .pay__alloc-box { display: flex; flex-direction: column; From a90d2e83f5e1c6b5b88a70f93360c2a06f8171cb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:21:56 -0500 Subject: [PATCH 27/31] fix(ledger-screens): end the stylesheet with a newline The file now ends with a line break. --- web/src/styles/views/ledger-screens.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/styles/views/ledger-screens.css b/web/src/styles/views/ledger-screens.css index 65caed5..ac26428 100644 --- a/web/src/styles/views/ledger-screens.css +++ b/web/src/styles/views/ledger-screens.css @@ -43,4 +43,4 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -} \ No newline at end of file +} From f3f9e14f1dc2ff4ca74c7a96a5a695e0f8167e70 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:21:58 -0500 Subject: [PATCH 28/31] docs(ledger-screens): update the table log entry for the shared fix The entry now says the shared table covers the filler and totals row, with the re-measured figures. --- web/HASHOUT_LOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index 959202d..e1eefda 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -599,7 +599,7 @@ Under CPU 4x and 400 ms latency, the only node that shifted on a hard reload was - kind: rationale - logged: v0.8.0 · 2026-11-27 -The five screens set `--tbl-block` to the window height less `--ls-above` (250px: the shell header, title, filter bar and status line plus a bottom margin), never under eight rows, so a long trial balance or ledger scrolls inside a box that ends near the bottom of the window. The filler row is hidden and the totals stick as a row (`tfoot`), not as cells: with cells the row's own box moved when rows arrived and Chrome reported it, 0.18 on the trial balance and 0.30 on the ledger, 0.096 on the other three. Both rules sit under `.ls` until the shared table styles take them. +The five screens set `--tbl-block` to the window height less `--ls-above` (250px: the shell header, title, filter bar and status line plus a bottom margin), never under eight rows, so a long trial balance or ledger scrolls inside a box that ends near the bottom of the window. The shared table now sizes its hidden filler from the row count and sticks the whole totals row, so these screens carry no rules of their own for it. Before that, the filler and the totals row moved when rows arrived and Chrome reported it: 0.18 on the trial balance, 0.30 on the ledger, 0.096 on the other three. Re-measured on the fixed table under CPU 4x and 400 ms latency: 0 on all five screens, with the general ledger's account picked by keyboard, every body row 30px, the header cells at y 218 and the totals cells at y 736 whether the body is short or scrolled. ### src/styles/views/grid.css · totals column - refers-to: src/styles/views/grid.css :: .grid__totals; src/ui/views/docform.ts :: fill From 576b2b7b11811dd8e1f90dad462c63700c7504c2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:23:31 -0500 Subject: [PATCH 29/31] docs(window): state the scrolling grid, picker height and fixed tables The window page now says the line grid scrolls after eight lines, the picker list keeps a minimum height, tables with totals have a fixed height, and the payment box scrolls. --- docs/window/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/window/README.md b/docs/window/README.md index 1e96de3..0309ba2 100644 --- a/docs/window/README.md +++ b/docs/window/README.md @@ -8,11 +8,13 @@ The sidebar groups the screens: Selling, Buying, Stock, Ledger and Setup, with a ## Lists -There is one list for each kind of document: quotes, sales orders, sales invoices, delivery notes, payments received, purchase orders, goods receipts, purchase invoices and payments made. Each shows the number, date, party, status and total, can be narrowed by status, and loads more rows on request, 100 at a time. The count beside the Load more button has a fixed width, so the button does not move when rows arrive. A draft that has no number yet reads "Draft". Open a row with a click or with Enter. +There is one list for each kind of document: quotes, sales orders, sales invoices, delivery notes, payments received, purchase orders, goods receipts, purchase invoices and payments made. Each shows the number, date, party, status and total, can be narrowed by status, and loads more rows on request, 100 at a time. The count beside the Load more button has a fixed width, so the button does not move when rows arrive. A draft that has no number yet reads "Draft". Open a row with a click or with Enter. A table that has a totals row has a fixed height and scrolls inside it; its rows keep their height and the totals row stays at the foot. ## The document form -Quotes, sales orders, sales invoices, purchase orders and purchase invoices share one form: who it is for, the dates, and a grid of lines. A line is an item, a description, a quantity, a unit price and a tax rate. Pick the party and each item by typing part of its code or name. +Quotes, sales orders, sales invoices, purchase orders and purchase invoices share one form: who it is for, the dates, and a grid of lines. A line is an item, a description, a quantity, a unit price and a tax rate. Pick the party and each item by typing part of its code or name; the list of matches keeps a minimum height of 320 pixels while it filters, so it does not jump between sides of the field. + +The grid of lines has a fixed height of eight lines and scrolls after that; the totals and the buttons stay under it. The server works out every amount. Line totals and the document total appear after a save, in space that was already there for them. @@ -22,7 +24,7 @@ When the server refuses something, for example a locked period, its own sentence ## Payments -A payment names the party (picked by typing part of its code or name, as on the document form), the date, the amount and the account, and lists that party's open invoices. Type an amount against each invoice the payment covers; what is left over is shown as you type and stays on account. +A payment names the party (picked by typing part of its code or name, as on the document form), the date, the amount and the account, and lists that party's open invoices in a box of eight rows that scrolls. Type an amount against each invoice the payment covers; what is left over is shown as you type and stays on account. ## Goods receipts and delivery notes From 513a2f334ff963c36d21db796cd7e75f7adc27d9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:23:31 -0500 Subject: [PATCH 30/31] docs(web): log the load more count width Why the count beside load more has a fixed width, with the shift figures. --- web/HASHOUT_LOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index e1eefda..3a46153 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -614,3 +614,10 @@ The amounts column of the totals list is a fixed 16ch, not `auto`: with `auto` i - logged: v0.8.0 · 2026-11-27 Each invoice load takes its own number and only the latest may write rows, and a pick of the party already loaded does nothing, so `open()` and a party pick no longer race to add, remove and re-add a row. The party is the shared picker; a picked party outside the first 200 is added to the local map so its invoices still load. The allocation box is a fixed eight rows with the unallocated line sticky at its foot: before, rows arriving pushed the error line and buttons (0.008 on the received form, 0.0023 on the made form). The shared filler row is hidden under `.pay`: it moved from y 281 to 633 and shrank from 358 to 6px as rows arrived, 0.082 on a goods receipt and 0.085 on the received list. + +### src/styles/views/doclists.css · count width +- refers-to: src/styles/views/doclists.css :: .dl__count, --dl-count-width; src/ui/views/doclists.ts :: countText +- kind: rationale +- logged: v0.8.0 · 2026-11-27 + +The count beside Load more went from empty to "114 shown, more to load", and the button after it moved sideways on every page (0.00063 then 0.00035 per load, sources the button, 0.0011 to 0.0013 over a list). The count now has a fixed 24ch box, right aligned, so the button stays put: 0.0 on quotes, sales orders and purchase orders afterwards, 0.0001 on the invoice lists from the form's buttons, not from the list. The 0.09 seen on delivery notes and goods receipts is the filler row on their forms, not on the lists. From 16b03570a5c1e074c1cf62d13b8aaab1340a0b75 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 03:26:50 -0500 Subject: [PATCH 31/31] chore(release): 0.8.0 Moves every version site to 0.8.0 and adds the changelog section. --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ Makefile | 2 +- cmd/HASHOUT_LOG.md | 2 +- internal/HASHOUT_LOG.md | 2 +- internal/app/version.go | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/HASHOUT_LOG.md | 2 +- src-tauri/tauri.conf.json | 2 +- web/HASHOUT_LOG.md | 2 +- web/package-lock.json | 4 ++-- web/package.json | 2 +- 12 files changed, 44 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e93323c..b495e76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## 0.8.0 + +The window has now been run as a whole: a twenty-line invoice typed, posted and followed through three ledger screens, with nothing on screen moving. + +### New +- Every screen in the sidebar has an icon. +- The payment form picks the customer or supplier with the same search box the document form uses. +- Profit and loss starts on the first day of your fiscal year, not on January 1. + +### Changed +- Tables with a totals row have a fixed height and scroll inside it. The totals stay at the foot and the header stays at the top. +- The line grid on a document shows eight lines and scrolls after that, so the totals and buttons under it stay where they are while you add lines. +- The list of open invoices on a payment shows eight rows and scrolls after that. +- A new account, customer, item or other setup row appears at its place in code order, not at the end. + +### Fixed +- Choosing a party on a payment no longer adds, removes and re-adds an invoice row. +- The totals on a document no longer move sideways when it is posted. +- The search box's list no longer jumps from above the field to below it while you type. +- "Load more" no longer moves when the count beside it changes width. +- Profit and loss, the balance sheet and the ledger screens no longer shift when their rows arrive. + +### Known issues +- The look of the screens is plain. Row heights and spacing are now steady, but the design has not had a pass of its own. +- A line with only a quantity or a price, and no item or description, is dropped without a message when the document is saved. +- Amounts show two decimals for every currency. +- Delivery notes are still outside a sales order's chain, and there are no part receipts, part deliveries or part invoices. +- The desktop app has not been built yet; the window runs in a browser against the server. + +### Under the hood +- The shared table writes its row count to one custom property and a hidden filler row takes the spare height. + ## 0.7.0 The web client gets its first screens. Until now everything was done from the command line or the server's routes. This is a first pass: it has been run in a browser in parts, not yet as a whole. diff --git a/Makefile b/Makefile index 5cb32c7..6873bfb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := v0.7.0 +VERSION := v0.8.0 GO_BUILD := CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" .PHONY: build web server check clean diff --git a/cmd/HASHOUT_LOG.md b/cmd/HASHOUT_LOG.md index 1ecb871..7fc8da9 100644 --- a/cmd/HASHOUT_LOG.md +++ b/cmd/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the entry point, `embed.go`, `internal/server`, `internal/static` and `internal/startup`. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. Read it first, then edit code surgically. -Current build version: v0.7.0 +Current build version: v0.8.0 Last updated: 2026-11-26 (US Eastern) · skeleton port from form.md --- diff --git a/internal/HASHOUT_LOG.md b/internal/HASHOUT_LOG.md index 7a27d72..c5139dd 100644 --- a/internal/HASHOUT_LOG.md +++ b/internal/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of comment content, rationale and removed code for the core skeleton packages under `internal/`. Source files stay comment-free; what they would have said lives here, indexed. Read it first, then edit code surgically. Covers the packages ported in the core slice only; `internal/server`, `internal/static` and `internal/startup` are logged by their own slice. -Current build version: v0.7.0 +Current build version: v0.8.0 Last updated: 2026-11-27 (US Eastern) · profit and loss and the balance sheet --- diff --git a/internal/app/version.go b/internal/app/version.go index 1c572ca..3ece448 100644 --- a/internal/app/version.go +++ b/internal/app/version.go @@ -1,5 +1,5 @@ package app -var Version = "v0.7.0" +var Version = "v0.8.0" const Product = "FormLedger" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index c0b071e..954b1ba 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1106,7 +1106,7 @@ dependencies = [ [[package]] name = "formledger-desktop" -version = "0.7.0" +version = "0.8.0" dependencies = [ "objc2", "objc2-app-kit", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index cf49af7..c60503d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formledger-desktop" -version = "0.7.0" +version = "0.8.0" description = "FormLedger desktop app" authors = ["NodeAgentc, Inc."] license = "Apache-2.0" diff --git a/src-tauri/HASHOUT_LOG.md b/src-tauri/HASHOUT_LOG.md index f1c9852..37e44a8 100644 --- a/src-tauri/HASHOUT_LOG.md +++ b/src-tauri/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the Tauri 2 desktop shell (`src-tauri`). Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of the shell: read it first, then edit code surgically. -Current build version: v0.7.0 +Current build version: v0.8.0 Last updated: 2026-11-26 (US Eastern) · the shell ported from form.md's src-tauri and renamed for FormLedger --- diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 8ae8070..00a3fc9 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "https://schema.tauri.app/config/2", "productName": "FormLedger", "mainBinaryName": "formledger-desktop", - "version": "0.7.0", + "version": "0.8.0", "identifier": "ai.nodemode.formledger", "build": { "frontendDist": "splash" }, "app": { diff --git a/web/HASHOUT_LOG.md b/web/HASHOUT_LOG.md index 3a46153..9309442 100644 --- a/web/HASHOUT_LOG.md +++ b/web/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the web client. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of the web side: read it first, then edit code surgically. -Current build version: v0.7.0 +Current build version: v0.8.0 Last updated: 2026-11-26 (US Eastern) · account screens, and the fixes from the throttled browser check --- diff --git a/web/package-lock.json b/web/package-lock.json index 235227a..6240d93 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "formledger", - "version": "0.7.0", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formledger", - "version": "0.7.0", + "version": "0.8.0", "license": "Apache-2.0", "devDependencies": { "@types/node": "^22.20.5", diff --git a/web/package.json b/web/package.json index 0a3e370..bc572cc 100644 --- a/web/package.json +++ b/web/package.json @@ -1,7 +1,7 @@ { "name": "formledger", "private": true, - "version": "0.7.0", + "version": "0.8.0", "license": "Apache-2.0", "type": "module", "scripts": {