imp: web: page the journal and register views, and link to each year (#586) - #2749
Merged
Merged
Conversation
acinader
force-pushed
the
web-paging
branch
from
September 29, 2026 19:59
1670fea to
60cbe4d
Compare
acinader
force-pushed
the
web-paging
branch
from
September 30, 2026 05:02
60cbe4d to
cba4d14
Compare
…ledgerorg#586] The journal and register views show the newest 1000 matching transactions, a "Showing 1 to 1,000 of N transactions" line, Newer and Older links, and up to ten numbered page links. A page parameter selects the page; a missing or bad one means the first, one past the end means the last. The report is sliced after it is computed, so the register's running balance continues across pages; the register chart plots the page's rows. When the matches span more than one year, a years row links to the search with date:YYYY in place of its date terms, plus All; more than twenty years are grouped by decade. Account links from a transaction, in the journal and the register, carry a txn parameter, which opens the account's register on the page holding it. (The register's date links open that day's journal entries.) Tests: yesod-test cases for paging, the years row, and txn links; a browser spec for policy violations, the register chart, and scrolling to a linked transaction. AI usage: Claude Fable 5.1, ~70k output tokens.
AI usage: Claude Fable 5.1, ~2k output tokens.
…rnals --start sets the first day instead of 2000-01-01, and --days spreads the transactions evenly over that many days instead of one per day. Two new sample journals use them: century-sparse (1000 transactions over a hundred years) and dense-year (6000 in one year), for trying hledger-web's paging and years row. AI usage: Claude Fable 5.1, ~4k output tokens.
acinader
force-pushed
the
web-paging
branch
from
September 30, 2026 05:27
cba4d14 to
a79b9e9
Compare
Member
|
I'm not seeing any paging UI with main. Is it just me ? |
Contributor
Author
Contributor
Author
Contributor
Author
|
worth noting that I have not had it as a single file untl a few days ago when I started working on the bs, bse, cf, is stuff where I switched to a single file. I should now be a good performance test and I'll check that out and/or open an issue if i see performance issues. |
Member
|
Ah, cool, I see it now. I had tested with just under 1000 txns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


hledger-web's journal and register views render every matching transaction into one page. A journal of 16,000 transactions gives a 19 MB journal page with 48,000 table rows and a 22 MB register page: slow to transfer and render. Fixes #586.
This PR pages the two views, in the simple server-rendered way suggested in #848:
pageparameter in the URL names the page, so pages can be bookmarked; a missing or bad one means the first page, one past the end means the last.date:2025replacing any date term), with All to widen it again. More than twenty years are grouped by decade.page=3drifts as transactions are added; the year links are the stable bookmarks.Hledger.Web.Paging; it keeps a page to a megabyte or two and a few thousand rows.Also:
tools/generatejournalgains--startand--days, andjust samplejournalsmakes two journals for trying this: a sparse century (1000 transactions over a hundred years, which fits on one page and shows the decade rows) and a dense year (6000 transactions, six pages).Tests: yesod-test cases for slicing, the links at both ends, clamping, bad page numbers, the page-size boundary, the page-number window, the years row (with negated terms and under --depth), carrying the rest of the search, the register balance and chart across a page boundary, linked transactions, decade grouping, and small journals' unchanged pages; a browser spec for what only a browser shows: a paged page loading without policy violations, the register chart drawn from the page's rows, and a link to a transaction on another page scrolling to it. The JSON API is unchanged.
How to test
http://127.0.0.1:5062/journal shows "Showing 1 to 1,000 of 6,000 transactions 1 2 3 4 5 6 Older ›", with 1 in bold and not a link; http://127.0.0.1:5062/journal?page=6 is the last page, with "‹ Newer" and 6 in bold. With a multi-year journal the years row appears above the table.
AI usage: Claude Fable 5.1, plus Claude Opus 5.5 for preparing this PR. About 0.38M output tokens in the main sessions (the per-commit estimates in the commit messages sum to ~76k; the rest went to planning, review triage, the test plan, and drafting), plus the subagent runs below, which produced findings, not code. Output is what the model wrote; total adds the input it read, mostly cached context re-read on each turn.