Repository navigation
feat(react): zone colours and a readable table header - #962
Merged
Merged
Conversation
Add zone colour tokens (--pk-zone-rows, --pk-zone-columns, --pk-zone-values, --pk-zone-filters) with an opaque fill mixed into --pk-zone-tint-base at --pk-zone-tint (16%). Chips of rows, columns and values take the fill and lose their coloured border; filter chips stay neutral. Zone titles and the field list's badges take the zone colour; type icons, chip controls and the field list's hover take neutral tokens (--pk-control-icon, --pk-field-hover). A sorted chip draws the same arrow as the table's sorted header (--pk-sort-arrow). Chips use the small radius; --pk-radius is 8px. Without color-mix() the fill falls back to --pk-surface-3; in forced colours a fill becomes a system border. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each field name in the header carries its zone's icon and fill; with two
or more values the repeated value names carry the icon alone. The sort
arrow stands behind the name: at rest only on the sorted header, in the
text colour and bold, on others on hover and focus. The sorted header's
button describes the order ("sorted Largest Count of Ticket first").
Header cells get their scope (a column field's name heads its row of
items, a row field's name its column of labels) and the empty corner a
label naming the fields on each axis. headerRows() and the exports are
unchanged.
Refs #920
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The order in use became the sort button's description and replaced the tooltip's, so a screen reader no longer heard what a click does. The description now gives both: "sorted Largest Count of Ticket first. Sort by Count of Ticket: smallest first". Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document the zone tokens, the fill, the neutral type icons and the 8px radius in the theming reference; describe the header's field names, the sort arrow behind the name and what a screen reader hears; retake the documentation's screenshots of the playground. Changelog entries for pivotkit-react and pivotkit-element (first load 179.7 KiB gzip). Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PivotTable is 352 lines (was 355) and the header cell's arrow function 29 in complexity (was 32), with the header's content and the empty corner in components of their own. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n only The fill's padding and the room kept for the arrow widened every column with a field's name, and the caps' least width grew with them: on a phone two row fields left no value in view, and five long row fields no longer fit at 1440 px. The fill now reaches into the cell's padding (negative margin) and on under the arrow as a shadow, so only the icon takes room; where a cap leaves too little for the icon and a word, the icon stands above the name. The test of the faint arrows at rest now checks the rule of #920: no arrow at rest until a sort is chosen. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The value name's icon and fill take room from the name; its least width now adds them back (internal --pk-th-extra), so "Population" no longer breaks inside the word at 360 px. The row labels' caps leave it out. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The light --pk-zone-values was #0b7a5c: its icon measured 4.52:1 on the Grand Total column's darker header (--pk-total-strong). #0b785c is the smallest darkening that measures 4.6:1 there (4.64:1). The browser test asks 4.6:1 on that header again, and the contrast test checks the values colour on --pk-total-strong and the focus ring on each zone's fill (3:1), light and dark. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The type icons in the field list and on chips are 16 px (were 14 and 13): the "A" of the text type now stands 8 px, the cap height of 11 px text is 7.75 px. The icons fit the boxes they had, so chips (33 px) and the field list's rows (36 px) keep their height, wide and narrow. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header pill's shadow tail reads --pk-zone-fill instead of mixing the colour a second time, and the three .pk-th-field rules are one. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reader that skips aria-description still hears the order from the th. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Theming gives the new values hex and says the 3:1 on fills holds for the default --pk-muted. Upgrading names the radius and type icon defaults. Re-wraps the new lines in filters and keyboard, and merges the changelog's duplicate sections. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lues colour Three shots whose only differences were render noise (a native select's arrow, the chart tabs) stay as they were. Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The table's header shows no arrow for a custom order, so the chip draws none either: one glyph for one state. The chip's name still says "sorted Custom order", and the header cell keeps aria-sort="other". Refs #920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comments said a custom order has no direction; the menu offers it both ways. They now say what holds: no arrow, and its name says it. Refs #920 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
Refs #920. This builds the decision in the issue's comment: the zone colours and a readable table header. I keep #920 open for its PowerShell Universal part (the module's theme tokens), which follows in that repository.
!important):--pk-zone-rows,--pk-zone-columns,--pk-zone-values,--pk-zone-filters;--pk-zone-tint(16 %) and--pk-zone-tint-base;--pk-control-icon,--pk-sort-arrowand--pk-field-hover.--pk-type-*now default to the muted colour.--pk-radiusis 8 px (was 10).color-mix()fallback and a system border in forced-colors mode.scope, and the empty corner has a label.aria-sortand a description with the order and the next click.The light default of
--pk-zone-valuesis#0b785cinstead of the#0b7a5cfrom the decision: the decided value measured 4.52:1 on the Grand Total header, below the 4.6:1 the decision asks for. Export output (CSV, XLSX, report HTML) is unchanged.Whole-change check
Docs
I read each page whole, rendered.
docs/use/fields.mddocs/use/filters.mddocs/use/keyboard.mddocs/reference/theming.md--pk-muted.docs/getting-started/upgrading.mdCode
I read each function and file whole.
packages/pivotkit-react/src/header-cells.js(new)packages/pivotkit-react/src/table.jsxHeaderContentandBlankCornerare new, each with one job: the content of a header cell, and the empty corner.PivotTable, so the function is 3 lines shorter, and the arrow function the growth guard tracks in this file drops from complexity 32 to 29.hint, and use it for both.packages/pivotkit-react/src/zones.jsxBadgesdraws the sorted chip's arrow from the same glyph as the header, and no arrow for a custom order.ChipandDragChiponly change a class and the icon size.packages/pivotkit-react/src/fields.jsxFieldItemonly changes the icon size and gives the zone mark its fill class. Its job stays the same.packages/pivotkit-react/src/styles.css--pk-zone-fill. Chips, field marks and header names all reuse that fill.scripts/growth-baseline.jsonPivotTableto 352 lines, and the table's arrow function to complexity 29.Checklist (PRODUCT.md)
CHANGELOG.mdentry (optional)Test plan
npm run growthpasses, or the known baseline entry it fails on is named in the whole-change checknpm run lint,types,test,growth,pack:check: exit 0.npm run test:browser: 2906 passed, 3 failed under load. Each of the three passed 3 of 3 alone. One of them islevels.spec.js:330, which also fails on main (levels.spec Filter level test measures the menu during its opening animation #961).tests/browser/table-header.spec.js(contrast in both themes at 1280 and 390 px, en and de; sort state of chip and header; accessible names; reflow) andpackages/pivotkit-react/test/header-cells.test.js.contrast.test.jshas new pairs for zones, focus ring and the Grand Total header.sort-column.spec.js. The rule "a faint arrow on every header at rest" became "an arrow only on the sorted header", as the decision asks.Neutral review
Three rounds by a separate reviewer, before publishing:
--pk-mutedcondition in theming.md, one property for the fill, changelog and wrapping. The type icon size from the decision was added.🤖 Generated with Claude Code