Skip to content

Web headinglink: use date queries instead of period parameter - #2768

Draft
thielema wants to merge 2 commits into
hledgerorg:mainfrom
thielema:web-headinglink
Draft

thielema wants to merge 2 commits into
hledgerorg:mainfrom
thielema:web-headinglink

Conversation

@thielema

@thielema thielema commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

I want to leave the period parameter for multi-period intervals and use date query for choosing the overall time range.

I am in the midst of adding more report options but need to perform some refactoring first.

  • There is a lot of code duplicated between StatementR and BalanceR.
  • Widgets.Common contains code that is specific to StatementR and BalanceR. I would prefer to move it to the ReportPage module.
  • Both BalanceR and StatementR build sub-list of parameters like periodParams, accumParams, menuParams, but they build the parameter list from ground up. When adding more options I prefer to establish the general pattern to start with the list of all parameters, remove one parameter and replace it with an updated one.
  • I planned to add an option for the account depth but found that it is easier to simply use "depth:" queries for that purpose. When playing around, I found that RecordOpts.depth_ seems to be unused. Can we remove it?

This avoids duplicate code between BalanceR und StatementR
and scales better for more parameters to come.
…selecting date span

This makes the date span visible and editable in the search field
and leaves the period parameter for further subdivision into smaller intervals.

ReportPage.headingParams: avoid duplicate definition of headinglink in BalanceR and StatementR
@acinader

acinader commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Your date:-for-the-span direction looks right to me. The CLI-side pieces are in #2770.

I think we have a similar idea (screenshots in https://groups.google.com/g/hledger/c/gnY4EQOR5Dc).

My current prototype uses the parameter pattern you describe and depth: queries for depth.

17fc249

Re depth_: it can't be removed — queryFromFlags turns it into the Depth/DepthAcct query terms (that is how --depth reaches reports), and hledger-ui reads it directly. Report calculations never read it.

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.

2 participants