Repository navigation
fix(dashboard-library): cards keep their state across a refetch, and filters show the value their $variable holds - #1624
Draft
Aditya-thesys wants to merge 7 commits into
Draft
Aditya-thesys wants to merge 7 commits into
Aditya-thesys wants to merge 7 commits into
Conversation
A card's content was a fragment normally and sat inside a wrapper element while its data refetched, so React remounted it each time a filter reloaded a Query: a Table lost its sort and page, a Leaderboard its sort, a Heatmap, Funnel or GeoMap its view. The refresh shimmer and loader are now siblings of the content inside one fragment, so the content keeps its place in every state that shows data. Both still anchor to the card.
…'s value With options, the button named the first choice whenever the $variable held anything but "off": undeclared, it read "Compare: Previous 30 days" while the program's prev[$compare] lookup was empty and nothing was overlaid. The control now shows the variable's own value, and anything that is not one of the options, unset included, reads as None. Nothing is written to the variable on mount. defaultOn applies to the form without options, as before. With options the starting choice is the one the program declares ($compare = "prev"), and the description now says so.
The toggle only shows or hides the previous-period overlays on charts. Change
figures on Kpi, Stat and Leaderboard are drawn whenever previous is given,
whatever the toggle says. With options the program keys its previous data by
the variable, so under None ("off") the lookup was empty and the figures
went away with the overlays. The CompareToggle description and the
previous-values note now state the split, and that data keyed by the choice
needs an "off" entry to keep the figures under None.
…ult of their own
A filter bound to a $variable with no value drew its first option as chosen
(DateRangeFilter its second, "Last 30 days") while the Queries received
nothing. Each control now shows what the variable holds and writes nothing on
mount:
- ChipFilter and PeriodPicker select no option. The first one takes the Tab
stop whenever none is selected, so the group stays reachable by keyboard;
before, a value that matched no option left every chip at tabIndex -1.
- SelectFilter and DateRangeFilter show their label alone ("Date range" when
a DateRangeFilter has none) with nothing ticked in the menu.
- MultiSelectFilter counts stored values that are not among its options: they
still filter the data, so the button names them instead of reading "All".
… lines With type "line" and stacked "percent" the axis became 0 to 100% while the lines kept their raw values, so they were drawn far above the plot. Lines don't stack, so a chart whose series are all lines now ignores stacked and draws as a plain line chart. Charts with bars or areas stack as before. The description says stacked is ignored for "line".
…e and Section - A rule said only the first FilterBar is drawn. Every FilterBar is drawn, so the rule now asks for one and says a second shows as a second bar. - Table: totals draws a row only when a Column also sets total; the description says it takes both. - Table: groupBy names a column by its label, and now matches it whatever its case or outer spaces. "plan" used to miss a column labelled "Plan" and the rows were left ungrouped. - Section: a description was dropped when the title was "". It now shows on its own.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
Five fixes to
@openuidev/dashboard-library1.0.0, found by rendering each component's documented behaviour and comparing it with what the description promises, plus four corrections to the prompt text. One commit per fix.Fixes
StateFramerendered a fragment normally and a wrapper<div>while refreshing, so React replaced the children.CompareTogglewithoptionsfell back to its first option for any value that was not "off".$variablenot declared, the button read "Compare: Previous 30 days" while nothing was overlaid.defaultOnapplies only without options, and the description says so.DateRangeFiltershowed "Last 30 days" while the Query receivednull;PeriodPicker,ChipFilterandSelectFilterhighlighted their first option the same way.MultiSelectFiltershowed "All" for a stored value that was not an option, while that value still filtered.MultiSelectFilternames the stored value. Nothing is written to the variable on mount.TimeSerieswithstacked: "percent"and only linesstackedis ignored when every series is a line; the description says so. Area and bar stacking is unchanged.previousis given. With data keyed by the choice, an "off" entry keeps figures under None.Prompt text and two small behaviours
FilterBarsaid it is never drawn; both are drawn. It now says so and still asks for one.Table:totalsonly does something together with a Columntotal; the description says that.TablegroupBymatches a column's label trimmed and without regard to case.Sectionrenders itsdescriptionwhen the title is empty.Checked
CompareToggle(12 of 12 cases), filters with no value (13 of 25 cases failed before, 25 of 25 pass after), the line chart's y-coordinates (off the plot before, identical to a plain line chart after).To know
$variablevalues are set after mount. Before, it showed each filter's own default, which could differ from the declared value.mark: "line"inside a percent-stacked bar chart is still drawn off the plot, as before.data-state="refreshing"andaria-busyare gone with the wrapper; the dashboard root keepsaria-busy, and each card's loader keeps itsrole="status".🤖 Generated with Claude Code