Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
218859f
fix(web): keep a table's totals row in place while rows load
nodemode-ai Nov 27, 2026
8d8ecda
fix(web/payments): load open invoices once per party with a stale guard
nodemode-ai Nov 27, 2026
e584693
feat(web): pass the document currency to the line grid
nodemode-ai Nov 27, 2026
6d27693
feat(icons): add sidebar icons for selling buying stock ledger and setup
nodemode-ai Nov 27, 2026
0476c36
feat(icons): map every sidebar view id to an icon
nodemode-ai Nov 27, 2026
1cfafb5
feat(web/payments): pick the payment party with the shared picker
nodemode-ai Nov 27, 2026
2d9e4e0
feat(web): show an icon beside each screen in the sidebar
nodemode-ai Nov 27, 2026
5bbd70f
fix(statements): size the totals tables with the shared block height …
nodemode-ai Nov 27, 2026
48e5765
fix(web): reserve the count's width so load more stays put
nodemode-ai Nov 27, 2026
a20d18d
fix(web): give the totals amounts a fixed column so posting does not …
nodemode-ai Nov 27, 2026
f5834a6
fix(masters): place a created row at its code order
nodemode-ai Nov 27, 2026
b96793f
feat(statements): start profit and loss at the fiscal year start
nodemode-ai Nov 27, 2026
df0d9ea
docs(masters): log how a created row is placed
nodemode-ai Nov 27, 2026
1add1b3
docs(statements): say the window starts profit and loss at the fiscal…
nodemode-ai Nov 27, 2026
f8fd26c
fix(ledger-screens): fill the window and keep the totals row still
nodemode-ai Nov 27, 2026
3ccbc58
docs(ledger-screens): log the table height and the totals row
nodemode-ai Nov 27, 2026
60f9089
fix(web/payments): reserve the allocation box so invoice rows do not …
nodemode-ai Nov 27, 2026
7cef5f2
docs(web): log the fixed totals column and the currency hand-off
nodemode-ai Nov 27, 2026
24b6470
fix(web/payments): hide the table filler row on payment and stock scr…
nodemode-ai Nov 27, 2026
da3cedb
docs(web): log the payment invoice load and reserved boxes
nodemode-ai Nov 27, 2026
3b2e661
docs(window): bring the window page up to date
nodemode-ai Nov 27, 2026
a23af35
fix(web): hide the table's filler row and pin the whole totals row
nodemode-ai Nov 27, 2026
ea475d9
fix(web): give the line grid a fixed-height scrolling body
nodemode-ai Nov 27, 2026
054132a
fix(web): hold the picker list at one height while it filters
nodemode-ai Nov 27, 2026
0bfa7c6
fix(web): size the table's filler from the row count
nodemode-ai Nov 27, 2026
77cf017
refactor(web): drop the per-screen filler rules the shared table now …
nodemode-ai Nov 27, 2026
a90d2e8
fix(ledger-screens): end the stylesheet with a newline
nodemode-ai Nov 27, 2026
f3f9e14
docs(ledger-screens): update the table log entry for the shared fix
nodemode-ai Nov 27, 2026
576b2b7
docs(window): state the scrolling grid, picker height and fixed tables
nodemode-ai Nov 27, 2026
513a2f3
docs(web): log the load more count width
nodemode-ai Nov 27, 2026
16b0357
chore(release): 0.8.0
nodemode-ai Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---
Expand Down
2 changes: 1 addition & 1 deletion docs/ledger/statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
17 changes: 9 additions & 8 deletions docs/window/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# 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. 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.

Expand All @@ -22,7 +24,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 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

Expand All @@ -34,12 +36,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.
2 changes: 1 addition & 1 deletion internal/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---
Expand Down
2 changes: 1 addition & 1 deletion internal/app/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package app

var Version = "v0.7.0"
var Version = "v0.8.0"

const Product = "FormLedger"
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
46 changes: 45 additions & 1 deletion web/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---
Expand Down Expand Up @@ -577,3 +577,47 @@ 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.

## 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.

### 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 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
- 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.

### 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.

### 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.
4 changes: 2 additions & 2 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formledger",
"private": true,
"version": "0.7.0",
"version": "0.8.0",
"license": "Apache-2.0",
"type": "module",
"scripts": {
Expand Down
15 changes: 15 additions & 0 deletions web/src/engine/statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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<ProfitAndLoss> {
const q = new URLSearchParams({ from, to });
return api.call<ProfitAndLoss>("GET", `/api/reports/profit-and-loss?${q}`);
Expand Down
36 changes: 36 additions & 0 deletions web/src/styles/parts.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,42 @@
border-block-end: 0;
}

.tbl[data-foot] {
--tbl-box: var(--tbl-block, calc(var(--row) * 14));
block-size: var(--tbl-box);
overflow: auto;
}

.tbl[data-foot] .tbl__table thead th {
position: sticky;
inset-block-start: 0;
}

.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: max(0px, calc(var(--tbl-box) - var(--row) * (var(--tbl-rows, 0) + 2) - 2px));
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;
}
Expand Down
4 changes: 4 additions & 0 deletions web/src/styles/views/doclists.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -32,6 +33,9 @@
}

.dl__count {
inline-size: var(--dl-count-width);
white-space: nowrap;
text-align: end;
font-variant-numeric: tabular-nums;
}

Expand Down
7 changes: 4 additions & 3 deletions web/src/styles/views/grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -178,7 +179,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);
Expand Down
2 changes: 2 additions & 0 deletions web/src/styles/views/ledger-screens.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
21 changes: 21 additions & 0 deletions web/src/styles/views/payments.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -93,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;
Expand Down
Loading
Loading