The plan and the status documents say what is true after the merges of 2026-10-29: served.md section 0, the 8.0.1 rows and unit Status lines for S4.4, S5, S6, S7 and P6 (landed, with commits), the 8.0.2 resume paragraph turned into the record of what the merges found, P6's At-merge bullet (the write-off and dedup interaction, the five tests its interrupted gate never reached, schema 18), P9a's Done-when 1 verified by the green two-user job, D-58 and D-59 in order. D-60 (the owner): per merge a compile and the unit's own tests; the exhaustive gates once per batch, at the end. AGENTS.md's two gate sentences, HANDOFF.md's merging procedure and the plan carry it, with the reason: five full gates around five merges took twelve hours and the one gate at the end found the same five tests. Q-9 (open, for the owner): P6's `ledger-store` -> `ledger-import` dependency, with the options and the recommendation; architecture.md marks the arrow as under review. testing.md records the merge's test changes under P6. STATUS.md gains "Now (2026-10-29)" with the gate figures (170 suites, 2,944 tests, 77 minutes), the CI state and the next steps; HANDOFF.md, roadmap.md, gui.md and the parties doc drop the paused-branch wording; README counts 129 tools and about 2,950 tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
157 lines
8.6 KiB
Markdown
157 lines
8.6 KiB
Markdown
# ledger-gui — design
|
|
|
|
Phase 4 of the roadmap (`plan/roadmap.md`). A desktop app (egui/eframe) for the
|
|
people who own the books and the accountant who checks them. Same
|
|
audience as QuickBooks, none of its visual language.
|
|
|
|
## What it is for
|
|
|
|
It answers the questions an owner actually has, then shows the evidence:
|
|
|
|
- **How much money do we have, and how long does it last?** Cash today,
|
|
the trend, burn, runway, what's coming due.
|
|
- **Are we making money?** Revenue, spending, and profit by month; what
|
|
changed and why.
|
|
- **Where does the money go?** Spending by category and vendor, over time.
|
|
- **Who owes whom?** Payables, receivables, cards, money owed to members.
|
|
- **Is anything wrong or missing?** Entries without receipts, drafts never
|
|
posted, unreconciled accounts, uncategorized tax lines, 1099 vendors with
|
|
no W-9, past periods left open, a journal that fails verification.
|
|
- **Can I trust this number?** Every number drills down to the lines that
|
|
make it, each line to its entry, each entry to its rendered receipt and
|
|
its complete journal history (who did what, when, hash-chained).
|
|
|
|
An accountant gets the same data at full depth: statements with interval
|
|
columns and comparisons, the general ledger, trial balance, the raw
|
|
journal with its verification status.
|
|
|
|
## Principles
|
|
|
|
1. **Answer first.** Every screen leads with the answer in words and one
|
|
big number, then the chart, then the table, then the raw data.
|
|
2. **Everything drills down.** Any amount is a link. Navigation is a
|
|
history stack (back/forward, like a browser) with a breadcrumb.
|
|
3. **All the data, nothing hidden.** Withdrawn attachments, reversals,
|
|
drafts, every journal event: visible, marked for what they are.
|
|
4. **Read-only by construction.** The GUI has no write path: it reads the
|
|
hash-chained journal and the blob store and builds its own in-memory
|
|
view (`ledger_store::Snapshot`). Changes happen through the agent (MCP).
|
|
Where the GUI finds something to fix, it offers a ready-to-paste prompt
|
|
for the agent ("Attach the receipt for entry 12 — Anthropic, $7.40").
|
|
5. **Live.** It follows the journal: a change made by the agent appears
|
|
within a second, highlighted as new.
|
|
6. **Numbers are typography.** Tabular figures everywhere (Inter with
|
|
`tnum` frozen in), right-aligned, parentheses for negatives in
|
|
statements, a minus sign elsewhere, never a float.
|
|
7. **No accounting logic in the GUI.** Statements, balances, and series
|
|
come from `ledger-core` (new reports land there, where MCP can use
|
|
them too). The GUI arranges and draws.
|
|
|
|
## Screens
|
|
|
|
- **Overview** — KPI tiles with sparkline and change vs. the prior period
|
|
(cash, runway, revenue, spending, net income, owed by / owed to);
|
|
cash over time; income vs. spending by month; spending by category;
|
|
needs-attention list; recent activity from the journal.
|
|
- **Cash** — every cash and card account with balance and trend; inflows
|
|
and outflows by month; burn and runway; known upcoming outflows
|
|
(recurring entries, bills due, schedules).
|
|
- **Profit** — P&L by month as chart and table, spending breakdown with
|
|
month-over-month change, by class.
|
|
- **Transactions** — the register of every entry: search, filters
|
|
(account, vendor, class, date, status, receipt yes/no, amount), and a
|
|
detail pane with lines, the rendered receipt (PDF pages, images),
|
|
vendor, reversal links, and the entry's journal history.
|
|
- **Reports** — P&L, balance sheet, cash flow, trial balance, general
|
|
ledger, members' equity, tax summary, A/R and A/P aging, 1099
|
|
worksheet. Date presets, interval columns (total / month / quarter /
|
|
year), comparison to the prior period or year. Every amount drills down.
|
|
- **Accounts** — the chart with balances and tax categories; an account
|
|
opens its register with a running balance and a balance chart.
|
|
- **Documents** — every receipt and company document, rendered, with its
|
|
category, entry link, and withdrawal status.
|
|
- **Company** — profile, members and capital, periods, fixed assets,
|
|
amortization schedules, recurring entries, vendors and 1099 status.
|
|
- **Journal** — the raw event log, filterable, each event expandable to
|
|
its JSON, with the hash-chain verification result.
|
|
|
|
Global: command palette (Ctrl+K) to jump to any account, entry, vendor,
|
|
document, or report; back/forward (Alt+←/→); light and dark themes.
|
|
|
|
## Architecture
|
|
|
|
- `ledger-store::Snapshot`: read-only. Verifies the journal chain,
|
|
replays it into a `Ledger`, projects it into an in-memory SQLite with
|
|
the same code the writer uses, reads blobs. `refresh()` applies only
|
|
new journal lines (or reloads if the file was rewritten).
|
|
- `ledger-config` (moved out of `ledger-mcp`): `wanderbooks.toml`.
|
|
- `ledger-gui`:
|
|
- `data` — a loader thread follows the journal (notify-driven, polling as the fallback) and sends new snapshots.
|
|
- `model` — view models built from a snapshot (pure, unit-tested).
|
|
- `ui/*` — one module per screen; `widgets` (money, tiles, sparkline,
|
|
tables, charts); `theme`; `receipts` (PDF via `hayro`, images via
|
|
`image`; textures cached by blob hash).
|
|
- Tests: model unit tests, `egui_kittest` screenshots of every screen
|
|
against a fixture book.
|
|
- Web build later: the model is plain data, so a server can ship it.
|
|
|
|
## Status (2026-10-28)
|
|
|
|
Built 2026-10-12 (the first version): every screen above, the palette,
|
|
history, themes, live updates (a store write reaches the view model in
|
|
~30 ms), receipt rendering for PDFs and images, a deterministic demo
|
|
company (`wanderbooks gui --demo`; also the screenshot fixture), and a
|
|
screenshot test (`SHOT_DIR=… cargo test -p ledger-gui --test screens`,
|
|
optionally `SHOT_BOOKS`, `SHOT_ONLY`, `SHOT_DARK`).
|
|
|
|
Built since, by the "Served" plan (`plan/served.md`):
|
|
|
|
- **The data root is the only source** (D-44): `wanderbooks gui <book>`
|
|
opens a book of the data root, read-only, its settings from the
|
|
journal and its vault from its own `vault/` and `keys/`; `--data-dir`
|
|
and `--books-toml` are gone. The viewer holds the books open (a lease
|
|
of kind app) and still opens with the server stopped.
|
|
- **The Books menu** (P2 slice 8, D-19): Back up now, Restore…, New
|
|
books…, Connect Claude Code, Connect Codex, Close the books, each
|
|
handed to the server through the same functions the command line
|
|
uses; the Export menu (the CPA package, the 1099 worksheet, Save a
|
|
copy, Save the W-9), each a new file in Downloads. The viewer writes
|
|
nothing of the books (`tests/read_only.rs`, `tests/owner_menu.rs`).
|
|
- **The format-upgrade dialog** (D-39): asked at every open of waiting
|
|
books, a standing notice, the owner passphrase typed in the viewer.
|
|
- **Color schemes** (D-19's menu): the viewer's own family and twenty
|
|
editor families, 80 schemes, each at WCAG AA contrast, worn live on
|
|
hover (`tests/schemes.rs`, `docs/color-schemes.md`).
|
|
- **Needs attention is the engine's** (U0b, D-53): one function in
|
|
`ledger-package::attention` over `PackageBooks`, read by the viewer and
|
|
by `books.start`; the viewer only maps each item's target to a route,
|
|
and `the_viewer_and_books_start_see_the_same_attention` proves the two
|
|
lists equal. Principle 4's "ready-to-paste prompt" now comes from that
|
|
engine.
|
|
- **Pages added:** Invoices & Bills (Money in, Money out, a document's
|
|
page with its timeline, overview tiles; P4b S2) and Save invoice PDF
|
|
(S3); Projects and a project's snapshot (D-43); parties with roles,
|
|
W-9 and the TIN clipboard copy (D-29); fixed assets with the tax-basis
|
|
figures (P3); reconciliation; the journal page describing every event
|
|
in plain words.
|
|
- **Compatibility tests:** `tests/old_books.rs` (books an earlier version
|
|
wrote open to their figures), `tests/newer_journal.rs` (a newer journal
|
|
says "update wanderbooks", never half-read), `tests/view_model.rs`
|
|
(every figure shown is the engine's).
|
|
|
|
Landed 2026-10-29: the invoice page shows sends (S5), a discount-deadline
|
|
column and the tie-out badge (S6), write-offs on the timeline (S7),
|
|
documents grouped by category and subject (P6). S4.5 adds the number,
|
|
terms, bill-to and the issued copy to Save.
|
|
|
|
Next, in the plan's order: S4.5's page changes; P4's draft states in
|
|
Needs attention; P11a (the installed app: the viewer is its face, with
|
|
"Check for updates" in the menu) and P11b (the agent dock along the
|
|
bottom of the window, Claude Code or Codex in it, started in the book's
|
|
books home; D-27). Not planned: a web build, which belongs to the hosted
|
|
service (`plan/served.md` section 11, a browser viewer); the remote
|
|
viewer replica (D-51: a backup clone opened read-only serves instead).
|
|
Still open from the first version's list: a cash forecast with a
|
|
confidence band, receipt zoom and multi-page navigation, keyboard
|
|
navigation in lists, virtualized lists for very large books.
|