List each account's statement files, and open them

The Accounts screen gets a Statements list: every file in every account
folder beside what the index made of it -- imported, changed since,
not imported yet (or failed), or gone from disk while its rows remain --
with its size, modified and import times, and how many transactions it
brought in. Clicking a name opens the file.

The list is read from the folders, not the index, through
importer.StatementFiles, so a file shows exactly when import would read
it; store.SourceFiles and importer.Checksum then say how far each has
got. A file the index remembers but the disk lost is listed as missing
rather than vanishing, since its rows would not survive a rebuild.

A file is served only by finding it in that list, never by joining the
requested name onto a path. Statements come from outside and are served
from the app's origin, so none is rendered as a page: text is text/plain
under CSP sandbox, anything not text or PDF is a sandboxed download, and
PDFs -- whose viewers refuse a sandbox -- open in the browser's own
isolated viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 20:00:03 +02:00
co-authored by Claude Opus 5.5
parent 7f5b4846ef
commit 9ad6c05f9a
8 changed files with 373 additions and 7 deletions
+20
View File
@@ -166,6 +166,26 @@ fresh command would:
Shift-click **Import** for `import --force`.
### Statements
The Accounts screen (`1`) also lists every statement file in every account
folder, with what the index made of it:
| Status | Meaning |
| --- | --- |
| `✓` imported | read, and unchanged since |
| `⚠` changed | the file differs from what was imported; Import re-reads it |
| `•` not imported | new since the last import — or an import tried and failed, in which case the error is in the import report |
| `✗` gone from disk | imported once, then removed; its transactions stay in the index only until it is rebuilt |
**Added** is how many transactions the file brought in. Statements that overlap
share rows, and a shared row counts towards whichever file was imported first,
so a later statement covering the same days can add fewer rows than it holds.
Click a file name to open it. PDFs and CSVs open in the browser; anything else
downloads. Only files import would read are listed or served — not
`account.toml`, dotfiles, or anything outside an account's `include` patterns.
### Adding statements from the browser
The Accounts screen (`1`) has an **Add statements** panel: pick the account,