Skip to content

Add chart tab selection to account report URL params#2254

Open
BenjaminDebeerst wants to merge 1 commit intobeancount:mainfrom
BenjaminDebeerst:chart-selection-from-url
Open

Add chart tab selection to account report URL params#2254
BenjaminDebeerst wants to merge 1 commit intobeancount:mainfrom
BenjaminDebeerst:chart-selection-from-url

Conversation

@BenjaminDebeerst
Copy link
Copy Markdown

@BenjaminDebeerst BenjaminDebeerst commented Mar 7, 2026

In my Fava setup, I have a couple of fixed links to certain account reports. It's nice to be able to pre-select in the link the report shown via the r URL param, but a similar param is so far missing to pre-select the chart shown. This change adds that capability.

Memoize the active chart index via c query parameter in URL, allowing to deep link the chart selection. The default chart 'Account Balance' at index 0 is omitted from the URL analogous to the default report selection.

The values for the selected chart are the chart index in order to provide both a language agnostic solution and allowing to deep link into e.g. the hierarchy chart for the last month (because a label would change depending on the date, while the index does not).

Most of the logic is part of the frontend/template code because it needs to run after the addition of the hierarchy charts, which happens only there.

This purely being frontend changes, I did not add or modify any tests. I tested manually with long-example.beancount using both the English and the German languages.

--

AI usage disclosure: Since I'm not a frontend dev and only occasionally write TS, Claude Sonnet 4.6 was used to explore the code, find the right places to place modifications and suggest code snippets - all edits where made manually though and carefully reviewed.

Memoize the active chart tab via `c` query parameter in URL, allowing to
deep link the chart selection.

The default chart 'Account Balance' is omitted from the URL analogous to
the default report selection.
@BenjaminDebeerst BenjaminDebeerst force-pushed the chart-selection-from-url branch from 733a8ff to 864b2af Compare March 7, 2026 23:05
@BenjaminDebeerst
Copy link
Copy Markdown
Author

This partially reimplements #2191 in a simpler form - it tracks the selected chart but not the chart mode.

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.

1 participant