Repository navigation
feat(react): Default order, and say what unclear chart choices do - #965
Merged
Merged
Conversation
A field's menu on Rows or Columns gets Default order in a group named "Sort order". It removes the field's sort entry, so the field returns to the order of a new view: A to Z, oldest first, or the host's order. It is disabled with a reason while the field already sorts this way (#917). Chart settings gets a line under each choice whose name alone does not say what it does: Automatic under Value labels, Legend and Axis labels follows what the chart draws, plus Every n-th and Share in the tooltip. The Tooltip's explanation mentions the share. A heatmap no longer lists Legend, whose choices changed nothing there. A test walks every choice of every chart type in English and German (#916). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions of their own axisTopics and chartTopics grew with the last change. Default order and the lines under Chart settings' choices are jobs beside theirs, as is the Tooltip topic, so each is a function of its own now. chartTopics is back within the length limit; its complexity baseline goes down from 68 to 62. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs look The menu-entry table, the feature list and the chart page's list of left-out topics now say what the last two commits changed. The element changelog names the growth of its menus and texts groups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Share in the tooltip: the note, the Tooltip's i and the docs say that only sums and counts get a share, which total it is, and when none shows. - Heatmap Automatic: up to 200 filled cells, when the cells are large enough. - Axis Automatic: every n-th labels are still slanted. - Horizontal bars name the axis choice All, not All (slanted), with a line that says it writes every name straight (#963). - Trend gets a line: a straight line that best fits the values. - A test fails when a chart type has no Value labels note. - The menu search keeps a choice's disabled state, reason and note, so a greyed-out Default order or Reset filter no longer looks clickable. - The line under a menu choice is its description only, not part of its name (MenuItem and Option share the item role helper). - Default order: German reason "Bereits die Standardreihenfolge.", search words reset and unsorted, its own undo text, and the docs say it is the field's own order, not the report's start view. Fixes #963 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field menu's screenshots conflicted: retaken on the merged code, with main's zone colours and Default order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew sizes The element's changelog names the menus and texts groups as an official Node 24 build measures them after the review round: 60.3 KiB and 8.7 KiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s undo text The change to Option had no test and also moved every hint, such as a point menu's field name, out of the name. Option keeps its line in the name as before; MenuItem's notes and reasons stay descriptions. The browser test checks the undo text "Undone: default order of Region". The charts page names the line under All on horizontal bars too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Default order choice and the chart notes grow the menus group to 60.3 KiB and the texts group to 8.7 KiB on an official Node 24 build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
A field's menu gets Default order (Reihenfolge › Standardreihenfolge): it removes the field's sort entry, so the field goes back to its own order, or the order the host gives it. Chart settings now says what its unclear choices do: a short line under Automatic, Every n-th, Trend and Share in the tooltip, per chart type, in English and German. A heatmap no longer offers a Legend that did nothing, and horizontal bars name their axis choice All, because they never slant. A menu's search shows a greyed-out choice greyed out, with its reason.
Fixes #916
Fixes #917
Fixes #963
Whole-change check
Docs
docs/use/charts.md (read whole). Its reader sets up a chart and wants to know what each choice in Chart settings does.
sharesOfin chart-tooltip.js; it was right, so it stays as it is.docs/use/fields.md (read whole). Its reader wants to know what a field's menu offers.
docs/use/filters.md, section Sort (read whole). Its reader wants to change or undo a sort.
docs/concepts/filters.md, the table of menu entries and sort entries (read whole). Its reader writes views by hand and wants to know what each menu entry writes.
docs/features.md, Totals and sorting. Its reader scans what pivotkit can do.
docs/reference/react-layout.md, the menu table (read whole). Its reader is a developer who checks what each menu's first level holds.
Code
packages/pivotkit-react/src/menu-topics.js (read whole).
defaultOrderTopicis new. Its one job is the Default order topic: whether the field already sorts as in a new view, and the change that removes the field's sort entry. I took it out ofaxisTopicsbecause it is a job beside listing the topics.setSortfrom view-ops.js. Removing the entry brings the host's order back throughwithHostOrders, so it needs no second path for hosted fields.chartNotesis new. Its one job is to say which line goes under Automatic and Every n-th for the chart that is drawn. It follows pivotkit-core's chart.js:heatmapCellLabelshides all of them otherwise);categoryLabelLayout).axisLabelNamesis new. Horizontal bars never slant their labels, so their choice is named All, not All (slanted), in the choice and in the Axis topic's state (Axis labels: "All (slanted)" on horizontal bars does not slant #963).tooltipTopicmoved out ofchartTopicsunchanged, apart from the line under Share in the tooltip. The Tooltip topic is a job of its own, like the Reference lines and Series topics that already live beside it.chartTopicsnow only lists the topics. A heatmap no longer gets Legend: its colour scale replaces the legend, so the four choices did nothing.axisTopicskeeps its job (the field menu's topics) and callsdefaultOrderTopic.packages/pivotkit-react/src/levels.jsx and popover.jsx (read MenuItem, SearchHits and Option whole).
aria-hiddenand stays only as the description (aria-describedby), for notes and reasons alike. Option, the one-line entry of the other menus, keeps its second line in its name: there it can be a field's name that the entry needs, so that is a change of its own.menuItemRolefrom popover.jsx. That also brings MenuItem's complexity under the limit.packages/pivotkit-react/src/menu-labels.js and menu-labels-de.js (read the chart and sort parts whole).
sortOrder,sortDefault,sortIsDefault,sortDefaultKeywords,axisLabelAllStraightandchartNotes, in English and German. labels.js and labels-de.js get the undo textsteps.sortDefault.scripts/growth-baseline.json
chartTopicsshrank: it is back under the 120-line limit, and its complexity goes from 68 to 62, so I lowered the baseline.MenuItemin levels.jsx is now within the complexity limit, so its entry is gone.totalLinesstays as main has it.Tests
test/chart/topics.test.jsgoes through every choice of every chart type in English and German. It fails when a choice is unclear and has no line, and when a German line repeats the English one. A list of the choices that need no line gives each its reason; All on horizontal bars is not on it.test/menu-topics.test.jscovers Default order on a text field, a date and a field with the host's order, including items that took the field's type.tests/browser/sort-default.spec.jschecks that the header shows no arrow after Default order and that Undo brings the sort back. A new test finds Default order in the search by "reset" and "unsorted": greyed out with its reason, Enter does nothing, and after a sort it can be picked. The first test checks the undo text "Undone: default order of Region". It also checks that the reason is the description, not part of the name. Without the fix in levels.jsx it fails, and it fails too with only the search part of the fix taken out.Changelogs
Size budgets
Growth guards
chartTopicsgrew to 129 lines and complexity 72;axisTopicsgrew to complexity 35;docs/use/charts.mdgrew by two lines.defaultOrderTopic,chartNotesandtooltipTopic, and the page as described above.chartTopicsgrew by one (the name of All on horizontal bars),Optionby one, and charts.md by one line. I moved the name intoaxisLabelNames, shared the role inmenuItemRole, and kept the All fact in the settings table only, not again in the box "Axis labels".Checklist (PRODUCT.md)
CHANGELOG.mdentryTest plan
npm run lint,npm run types,npm test("tests 2677, pass 2674, fail 0, skipped 3"),npm run growth,npm run pack:checknpm run growthpassesnpm run test:browser: 2916 passed, 2 failed.levels.spec.js:330also fails on main (levels.spec Filter level test measures the menu during its opening animation #961).view-tabs.spec.js:443passed 9 of 9 when run alone; it is flaky under load.Neutral review
A separate AI session reviewed the branch before it was pushed, in two rounds.
CHART_TYPES.🤖 Generated with Claude Code