Skip to content

web: dev: call Link generators with Report qualification in Handlers - #2821

Closed
thielema wants to merge 1 commit into
hledgerorg:mainfrom
thielema:web-common-qualified-import
Closed

thielema wants to merge 1 commit into
hledgerorg:mainfrom
thielema:web-common-qualified-import

Conversation

@thielema

Copy link
Copy Markdown
Contributor

This shortens the import list from Widget.Common.

Eventually I'd like to move all link generators to ReportPage.

This shortens the import list from Widget.Common.

Eventually I'd like to move all link generators to ReportPage.
@simonmichael

Copy link
Copy Markdown
Member

As it stands, this seems to complicate the module namespace for code readers, and make some code more verbose, in exchange for simplifying a few import lines, which I think could be achieved in another way ?

@simonmichael

Copy link
Copy Markdown
Member

Of course I support the goal of grouping things together that belong together. Would this be helpful - a new module, eg Hledger.Web.Widget.Controls, holding the link rows and their helpers, the mode types, and each parameter's encoder and parser ? Common would shrink, ReportPage and Handlers would import Controls.

@simonmichael simonmichael added the web The hledger-web tool. label Oct 26, 2026
@thielema

thielema commented Oct 27, 2026 via email

Copy link
Copy Markdown
Contributor Author

@simonmichael

Copy link
Copy Markdown
Member

Reminding myself of the context here. This PR is a small cosmetic one and can't be used as it stands. Let's continue this discussion over on #2807, which is about reducing duplication, and influences module layout.

@simonmichael simonmichael added the needs-discussion To unblock: needs more discussion/review/exploration label Oct 28, 2026
@simonmichael simonmichael added needs-code To unblock: needs code/code updates and removed needs-discussion To unblock: needs more discussion/review/exploration labels Nov 3, 2026
@simonmichael simonmichael self-assigned this Nov 3, 2026
@simonmichael simonmichael removed the needs-code To unblock: needs code/code updates label Nov 13, 2026
simonmichael added a commit that referenced this pull request Nov 15, 2026
…r; calc uses it

A multiple-choice URL parameter such as calc was described in several
places that nothing kept in agreement: its parser, its encoder, its row
of links, the options summary's names for it, and its name as a string
literal across the handlers (#2798). Now a Param value holds its name,
its modes in display order, each mode's URL word, and its labels, and
the parser (parseParam, readParam, lookupParam), the row of links
(paramLinks), the URL settings (paramSetting, paramSettings) and the
options summary's names (paramPhrase) are made from it.

The new Hledger.Web.Param module also takes the generic links row
renderer (linksRow, linksRowClass, linksRowGroups) from Widget.Common,
which now imports it, avoiding an import cycle.

calc is the first parameter converted, replacing parseCalc, calcWord and
calcLinks. Its labels and translator comments are unchanged, so its
translations are too. The journal and register pages now carry only a
valid calc value on their links, rather than any value given.

Supersedes #2807 and #2821, following the design discussed in #2807.

AI usage: Claude Fable 5.1/Opus 5.5, ~51k output tokens
@simonmichael

Copy link
Copy Markdown
Member

Closed in favour of #2851.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web The hledger-web tool.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants