Add chart tab selection to account report URL params#2254
Open
BenjaminDebeerst wants to merge 1 commit intobeancount:mainfrom
Open
Add chart tab selection to account report URL params#2254BenjaminDebeerst wants to merge 1 commit intobeancount:mainfrom
BenjaminDebeerst wants to merge 1 commit intobeancount:mainfrom
Conversation
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.
733a8ff to
864b2af
Compare
Author
|
This partially reimplements #2191 in a simpler form - it tracks the selected chart but not the chart mode. |
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.
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
rURL 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
cquery 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.beancountusing 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.