Skip to content

feat(ledger): write snapshot from the window, a key of its own, and a page drawn by FormTxt (0.12.0) - #11

Merged
nodemode-ai merged 34 commits into
mainfrom
feat/key-snapshot-formtxt-0.12.0
Nov 28, 2026
Merged

nodemode-ai merged 34 commits into
mainfrom
feat/key-snapshot-formtxt-0.12.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Contributor

feat(ledger): write snapshot from the window, a key of its own, and a page drawn by FormTxt (0.12.0)

Summary

  • Write snapshot in the menubar and the palette now writes the snapshot through a new owner-only route, into snapshots inside the data folder, and says where it is and how many tables and rows it holds. Before, it only showed the command to run.
  • With FORMLEDGER_KEY_HOME set and no key file, the server makes a key once, keeps it and encrypts the ledger, converting an existing plain one. The desktop shell is written to set it to its app data folder. formledger encrypt keeps a dated plain copy and never overwrites an earlier one.
  • Printing through FormTxt was run for real. Cause of the fault found: when FormTxt refused or did not know the template, FormLedger printed the plain page without a word. It now says why, and waits 100 seconds, up from 45.
  • Ctrl or Cmd+P opens Search as in form.md; Print is Ctrl or Cmd+Alt+P.
  • Template cards name the accounts they post to, read from the chart of accounts. The templates screen no longer moves a line as names arrive (the empty name line had no reserved height).
  • Dashboards sit closer to form.md's: card corners, larger figures, short axis labels.

Commits

34 commits, oldest first, release commit last:

  • 10 feat (plain copy, snapshot route and action, key home, account names, shell key folder, typed account name, window commands and keys)
  • 12 fix (card shift, menubar keys, palette columns and hints, dashboards, charts, printout reasons, snapshot toast, shell key hand-over)
  • 11 docs (encryption, print, security, log entries)
  • 1 chore (release)

Version

v0.12.0 (release commit is last). Bumped: internal/app/version.go, Makefile line 1, web/package.json, two fields in web/package-lock.json, src-tauri/tauri.conf.json, src-tauri/Cargo.toml, the formledger-desktop entry in src-tauri/Cargo.lock, the "Current build version" line in the four HASHOUT_LOG.md files, the README badge, and a new CHANGELOG.md section.

Checks

  • go build ./... passed at each commit; go vet ./..., gofmt and npm run check in web/ passed at the head.
  • The exit run in Chrome at CPU 4x with a slowed network: a twenty-line invoice typed and posted, trial balance, general ledger and profit and loss opened, 0 layout shift with and without input.
  • On the release commit, same throttling: hard reload of dashboards 0, of templates 0; Ctrl+P opened the palette; "snapshot" then Enter wrote a file and the toast read 13 tables and 90 rows, 0 shift.
  • By the slices: an invoice drawn by FormTxt 0.38.0 and, with FormTxt stopped, by the plain renderer; the refusal and unknown-template sentences; encrypt and the key home step run twice on seeded ledgers (key made once, database not readable as SQLite, 30 items back through the API).
  • One slice saw a shift of 0.0001 on dashboards from the top bar's title; it did not show in the run on the release commit.

Not run: the desktop shell and its menubar were not compiled (one cargo check --offline stopped at dependency resolution); nothing ran on macOS or Windows; the 403 and 409 answers of the snapshot route; statements through FormTxt; the light theme on dashboards.

Merging

Merge with a merge commit so each commit and its signature stays. Do not squash.

formledger encrypt now writes the plain database beside the new one under a dated name it never overwrites, and says where it is and that it is not encrypted.
…y route

POST /api/snapshot writes a snapshot into the snapshots folder of the data folder and answers with its path and table row counts.
With FORMLEDGER_KEY_HOME set and no key file, the server makes an owner-only key there once, encrypts an existing plain ledger with a plain copy kept, and uses that key on every later start.
The card text grid now reserves a control-high name row, so the meta line no longer drops when names arrive and the gallery shifts zero.
writeSnapshot posts to the snapshot route and updates one toast in place with the path, table count and row count.
Search opens the command palette on Cmd or Ctrl+P, Print moves to Cmd or Ctrl+Alt+P, and Write Snapshot loses its ellipsis because it now acts at once.
The palette lists Print on Cmd or Ctrl+Alt+P to match the menubar.
Template lists, single templates and the use body now carry accountName looked up from the chart of accounts at read time, so screens can show 4100 Sales instead of a bare code. The name is never stored.
engine_start gives the env pair FORMLEDGER_KEY_HOME with the app's own data folder unless a key file is already configured; main.rs has to add it to the sidecar command.
Gallery cards gain a reserved line naming the accounts a template posts to, such as 4100 Sales, and each preview row carries its account as a tooltip.
…ckup

ENCRYPTION.md now says the desktop app keeps its own key, that encrypt keeps a dated plain copy, that losing the key loses the books, and how to back the key up and restore it.
The desktop section now says the server side is done and the shell passes its folder once main.rs adds engine_start::key_home.
One entry in each log: why FORMLEDGER_KEY_HOME is the seam, how the copy is named and kept, and the main.rs line still owed.
Records why the card text rows are fixed and how account names are read from the chart on every template read.
Dashboard cards used the sheet radius; form.md cards use a smaller one, built here from the radius tokens.
The KPI figure moves from the 22 px size to the title size with weight 650 and tight tracking, as form.md sets its big numbers; the row is still fixed so nothing shifts.
A refusal, a missing template, a timeout or an empty answer from FormTxt now carries a sentence saying what happened and what to do, and the wait is 100 seconds so the person has time to answer the Allow outside agents question.
The vertical axis printed full two-decimal amounts that crowded the left gutter; it now prints compact figures such as 2K, as form.md does. Hover readouts keep the exact amount.
Records the measured differences, what changed and what was left.
When FormTxt refuses or fails and the plain renderer draws instead, the print route sends the reason in X-FormLedger-Renderer-Note and cli print writes it on standard error.
The 403 note now says the plain page was drawn and quotes FormTxt's own words before saying how to allow outside agents.
PRINT.md now says an invoice was drawn by FormTxt 0.38.0, gives the refusal note, the 100 second wait and the three set-up steps, and says where FormTxt saves the outside agents answer.
The waiting toast grew from one line to four when the answer came and moved by 0.00108; one toast at the end moves nothing.
Typing in the palette moved the group column by 0.0001 as rows changed; fixed columns with the group at the trailing edge keep every row still.
Records what the real FormTxt answered, why refusals now carry a note, the longer wait, and where FormTxt saves the outside agents answer.
The key hint sat centered in its fixed column; it now ends against the group column.
The sidecar now gets FORMLEDGER_KEY_HOME set to the app data folder unless a key file is configured, as engine_start::key_home asks.
Template lines and used lines carry accountName, read from the chart of accounts by the server.
Why the toast waits for the answer and why the palette columns have fixed widths.
What was checked in the menubar, what changed and how far cargo check got.
Write snapshot calls the new route. Ctrl or Cmd+P opens search, Ctrl or Cmd+Alt+P prints, and the shortcuts toast says so.
Data at rest now covers FORMLEDGER_KEY_HOME and where the desktop app is written to keep the key.
The key home line is in main.rs now; the doc no longer says it is still waiting.
Every version site moves to v0.12.0, the changelog gets its section and the README lists FORMLEDGER_KEY_HOME.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 28, 2026 00:07
@nodemode-ai
nodemode-ai merged commit 1f83071 into main Nov 28, 2026
2 checks passed
@nodemode-ai
nodemode-ai deleted the feat/key-snapshot-formtxt-0.12.0 branch November 28, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant