Repository navigation
Conversation
|
This looks great; given a toggle so it's not shown by default, it seems a strict improvement for hledger-web users. The proposed handling of startup options and startup queries sounds good. Yes, our tag parsing is too loose and needs.. something.. What's the problem with listing all commodities as links ? Too verbose ? It sounds useful. |
(A useful learning aid for hledger CLI users too, demonstrating the different modes more easily.) |
|
Thank you for the feedback. Helpful.
|
|
Here's my suggestion for how command line startup options and query arguments map to the web UI. hledger-web OPTIONS parameterize the url that browse mode opens.
hledger-web QUERY ARGUMENTS keep doing what they do today, filtering the journal at load time, bounding what any url can produce. Today hledger-web merges both into one invisible initial query. So a startup A For example: opens and If we make these changes, OPTIONS only take effect through the url hledger-web opens or prints. So in the case of For A hand-edited bare url gets stock defaults. This is a behavior change, but I think it is a good one that makes hledger-web permalinks reliable. Implementation plan is to derive the url parameters from the original ReportOpts, then rebuild the app's ReportSpec from stock defaults plus the query arguments. Everything downstream that reads the startup spec then sees stock defaults automatically, so startup options no longer act as hidden server-side state. Journal loading is untouched. Reasonable? |
|
It sounds intuitive and good to me. Using startup arguments as hidden limits rather than adding them to the url is optional, but consistent with past behaviour and seems possibly useful. Not using startup options as hidden limits is a behaviour change, but I guess it's fine; options are mostly display modes, which are best managed at runtime. |
|
On Wed, 14 Oct 2026, Simon Michael wrote:
It sounds intuitive and good to me.
Using startup arguments as hidden limits rather than adding them to the
url is optional, but consistent with past behaviour and seems possibly
useful.
For me, hidden extra queries are pretty counter-intuitive. You cannot see
them in the web interface, you cannot alter them, but they are always
active. I'd prefer if queries passed via cli are shown in the query text
field, as proposed.
|
|
I'd be fine with that too, as it's simpler. If you want to run a restricted web ui, you would probably limit it by file, not by query. |
|
Interesting: When I choose tree mode, I can fold sub-accounts not only in the report page but also in the left side-bar. Hiding sub-accounts seems to be generally useful for the left sidebar, but requires more space. |
|
The links for "Type:" should not be a choice but a set, since showing multiple types of accounts is very useful. |
|
Unfortunately, code will conflict with changes that I have not yet published, because they are blocked by #2768 . |
I don't understand. |
It might depend on the web browser but in my Firefox a triangle is shown left of every parent account. This takes additional space and increases indentation. |
|
|
May I see a screenshot? |
|
On Fri, 16 Oct 2026, Arthur Cinader wrote:
in my Firefox a triangle is shown left of every parent account. This takes additional space and increases
indentation.
May I see a screenshot?
attached the same view in both List Mode and Tree Mode
|
d7e380b to
c6175f7
Compare
The report pages now offer hledger's report-shaping options as rows of links above each report, so reports can be reshaped in the browser and every view has a shareable url. Each control is a validated page parameter mirroring the command line's vocabulary: period, accum (change, historical, or cumulative), value (--value's WHEN[,COMM] syntax: none, cost, end, then, now, or a date), list (flat or tree), total and avg (-T, -A), sort (-S), pct (-%), calc (--valuechange, --gain, --count), infer (--infer-market-prices), date2, and empty (-E). A parameter the page does not know, or a contradictory combination, is explained in an alert. The pages' own links, the report menu, the paging and year rows, and the column headings all carry each parameter that is not at its default. Filter persist on every page including the journal and register: status, real and virtual postings, account type, and depth, each rewriting its own search term. Tree mode gets in-place folding. A tree-mode report is computed at full depth, its account cells carry depth classes (from the shared renderer, so any HTML consumer can fold by indent), and the page folds it to the search's depth limit, with a caret at each group opening it without changing the url. The sidebar is always the account tree; in the page's tree mode it gets the same carets, folded accounts are remembered per browser, and a depth limit folds it to that depth instead of clipping it. The folding runs inline right after the sidebar's markup, like its scroll restore, so the tree never paints unfolded. Amount conversion runs end to end: the sidebar converts with the page and labels its net row by the mode, a report's figures link to registers converting the same way, and the CLI's --base-url reports now write that value parameter into their register links too. The register gains a costs toggle (costs=1), shows its running balance without costs, and converts amounts as its value parameter says. Zero-balance visibility moves from the hideemptyaccts cookie to the empty parameter, so it is part of the url like everything else; the e key now follows the Zero balances row's other link. --debug=1 traces each request's url, search, parsed query, and kept parameters. Docs in the hledger-web manual; tests in the yesod-test suite, the Playwright browser suite, and the balance shelltests. The translation files are untouched for now: the new strings show in English until the template is regenerated and the catalogs updated, a follow-up for when the control set has settled. AI usage: Claude Fable 5, ~300k output tokens.
c6175f7 to
dc0b10d
Compare
conformed |


hledger-web report controls for most of hledger's report options. Report options are expressed in the url.
Example url:
The controls
Validated parameters mirroring the command line, carried by the page's own links, the report menu, paging and year rows, and column headings whenever it is not at its default:
period(as before),accum— now includingcumulativevalue—none,cost,end,then,now, or a date, each with an optional commodity, as--value WHEN[,COMM]list—flatortreetotal,avg,sort,pct,calc—-T,-A,-S,-%,--valuechange/--gain/--countinfer,date2,empty, and on the registercostsA parameter the page does not know, or a contradiction (
calc=gainwithvalue=cost), gets an explanatory alertTree mode folds in place
A tree-mode report is computed at full depth; its rows carry depth classes (written by the shared renderer, so any HTML consumer can fold by indent) and the page folds it to the search's depth limit. Carets open each group in place, without touching the url. The sidebar is the same tree: in tree mode it gets carets. Folds are remembered in the browser (a work in progress). The fold runs inline during parse, like the sidebar's scroll restore, to eliminate flicker by rendering and then mutating.
Behavior changes from main
hideemptyacctscookie is replaced by theemptyparameter, part of the url like everything else. Theekey now reloads the page with the empty parameter--base-urlreports) in tree mode now writesdepth-Naccount cell classes, and register links can carryvalue=.--debug=1on hledger-web traces each request's url, search, parsed query, and the parameters each page keeps.Issues
-V,--tree,--depth, …) become invisible server-side defaults, and page parameters express deviations from them. An alternative: translate startup options into the url that browse mode opens (hledger-web -V --treeopening/journal?value=end&list=tree), leaving the server at stock defaults. That would simplify the handlers and make every view fully described by its url. Startup query arguments seem better left as journal filtering (If nothing else, query arguments can be used to restrict what transactions are available to be further filtered and shaped by the URL).word:in a comment. I couldn't find a useful filter or view of tags, so I removed it.AI usage: Claude Fable 5, ~300k output tokens.