Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cf7ad3a
feat(react): colour the field area by zone
eizedev Nov 25, 2026
c42d20e
feat(react): name each field in the table's header by its zone
eizedev Nov 25, 2026
cfd25c7
fix(react): the sorted header still says what the next click does
eizedev Nov 25, 2026
0d7ab3d
docs: zone colours, the table's header and their tokens
eizedev Nov 25, 2026
f468c15
chore: lower the growth baseline of the table's header
eizedev Nov 25, 2026
7ccab1d
fix(react): type the corner label's axes
eizedev Nov 25, 2026
a8653d7
fix(react): a field's name in the header widens its column by its ico…
eizedev Nov 25, 2026
5a30faf
docs: retake the screenshots with the narrower header fields
eizedev Nov 25, 2026
a6ac917
fix(react): a value's name keeps a whole word on a phone
eizedev Nov 25, 2026
4fcacb7
docs: retake the phone screenshots with whole value names
eizedev Nov 25, 2026
7bdc857
fix(react): the values colour keeps 4.6:1 on the Grand Total header
eizedev Nov 26, 2026
0b5d6a2
feat(react): a type icon's letters as tall as 11 px text
eizedev Nov 26, 2026
0d0589b
refactor(react): one property holds a zone's fill
eizedev Nov 26, 2026
ff64e39
test(react): the sorted header cell carries aria-sort
eizedev Nov 26, 2026
6175be1
docs(react): the values colour, type icons and radius for hosts
eizedev Nov 26, 2026
2b124c8
docs: retake the screenshots with larger type icons and the darker va…
eizedev Nov 26, 2026
32022f0
fix(react): a custom order draws no arrow on its chip
eizedev Nov 26, 2026
5884caa
Merge origin/main into feat/readable-table-header
eizedev Nov 26, 2026
17760ce
docs(react): a custom order shows no arrow, either way round
eizedev Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/assets/screenshots/add-menu-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/add-menu-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/add-to-filters-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/add-to-filters-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-combo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-combo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-display-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-display-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-groups-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-groups-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-lines-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-lines-level-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-lines-level-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-lines-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-points-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-points-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-tooltip-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-tooltip-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-treemap-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-treemap-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-zoom-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-zoom-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/column-subtotals-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/column-subtotals-light.png
Binary file modified docs/assets/screenshots/data-menu-dark.png
Binary file modified docs/assets/screenshots/data-menu-light.png
Binary file modified docs/assets/screenshots/date-context-dark.png
Binary file modified docs/assets/screenshots/date-context-light.png
Binary file modified docs/assets/screenshots/date-years-dark.png
Binary file modified docs/assets/screenshots/date-years-light.png
Binary file modified docs/assets/screenshots/donut-labels-dark.png
Binary file modified docs/assets/screenshots/donut-labels-light.png
Binary file modified docs/assets/screenshots/donut-other-dark.png
Binary file modified docs/assets/screenshots/donut-other-light.png
Binary file modified docs/assets/screenshots/donut-phone-dark.png
Binary file modified docs/assets/screenshots/donut-phone-light.png
Binary file modified docs/assets/screenshots/drill-down-dark.png
Binary file modified docs/assets/screenshots/drill-down-light.png
Binary file modified docs/assets/screenshots/drill-export-dark.png
Binary file modified docs/assets/screenshots/drill-export-light.png
Binary file modified docs/assets/screenshots/enlarged-dark.png
Binary file modified docs/assets/screenshots/enlarged-light.png
Binary file modified docs/assets/screenshots/explanations-dark.png
Binary file modified docs/assets/screenshots/explanations-light.png
Binary file modified docs/assets/screenshots/export-menu-dark.png
Binary file modified docs/assets/screenshots/export-menu-light.png
Binary file modified docs/assets/screenshots/field-info-dark.png
Binary file modified docs/assets/screenshots/field-info-light.png
Binary file modified docs/assets/screenshots/field-menu-dark.png
Binary file modified docs/assets/screenshots/field-menu-light.png
Binary file modified docs/assets/screenshots/field-rail-dark.png
Binary file modified docs/assets/screenshots/field-rail-light.png
Binary file modified docs/assets/screenshots/filter-blanks-dark.png
Binary file modified docs/assets/screenshots/filter-blanks-light.png
Binary file modified docs/assets/screenshots/filter-cyclic-dark.png
Binary file modified docs/assets/screenshots/filter-cyclic-light.png
Binary file modified docs/assets/screenshots/filter-dark.png
Binary file modified docs/assets/screenshots/filter-dates-dark.png
Binary file modified docs/assets/screenshots/filter-dates-light.png
Binary file modified docs/assets/screenshots/filter-light.png
Binary file modified docs/assets/screenshots/filter-more-dark.png
Binary file modified docs/assets/screenshots/filter-more-light.png
Binary file modified docs/assets/screenshots/filter-rules-dark.png
Binary file modified docs/assets/screenshots/filter-rules-light.png
Binary file modified docs/assets/screenshots/filter-state-dark.png
Binary file modified docs/assets/screenshots/filter-state-light.png
Binary file modified docs/assets/screenshots/filter-zone-dark.png
Binary file modified docs/assets/screenshots/filter-zone-light.png
Binary file modified docs/assets/screenshots/german-dark.png
Binary file modified docs/assets/screenshots/german-light.png
Binary file modified docs/assets/screenshots/group-level-dark.png
Binary file modified docs/assets/screenshots/group-level-light.png
Binary file modified docs/assets/screenshots/import-drop-dark.png
Binary file modified docs/assets/screenshots/import-drop-light.png
Binary file modified docs/assets/screenshots/import-empty-dark.png
Binary file modified docs/assets/screenshots/import-empty-light.png
Binary file modified docs/assets/screenshots/import-loaded-dark.png
Binary file modified docs/assets/screenshots/import-loaded-light.png
Binary file modified docs/assets/screenshots/import-phone-dark.png
Binary file modified docs/assets/screenshots/import-phone-light.png
Binary file modified docs/assets/screenshots/import-preview-dark.png
Binary file modified docs/assets/screenshots/import-preview-light.png
Binary file modified docs/assets/screenshots/learn-earthquakes-dark.png
Binary file modified docs/assets/screenshots/learn-earthquakes-light.png
Binary file modified docs/assets/screenshots/learn-endoflife-dark.png
Binary file modified docs/assets/screenshots/learn-endoflife-light.png
Binary file modified docs/assets/screenshots/learn-nobel-dark.png
Binary file modified docs/assets/screenshots/learn-nobel-light.png
Binary file modified docs/assets/screenshots/load-check-dark.png
Binary file modified docs/assets/screenshots/load-check-light.png
Binary file modified docs/assets/screenshots/more-menu-dark.png
Binary file modified docs/assets/screenshots/more-menu-light.png
Binary file modified docs/assets/screenshots/phone-dark.png
Binary file modified docs/assets/screenshots/phone-light.png
Binary file modified docs/assets/screenshots/phone-value-menu-dark.png
Binary file modified docs/assets/screenshots/phone-value-menu-light.png
Binary file modified docs/assets/screenshots/quick-chart-dark.png
Binary file modified docs/assets/screenshots/quick-chart-light.png
Binary file modified docs/assets/screenshots/quick-columns-dark.png
Binary file modified docs/assets/screenshots/quick-columns-light.png
Binary file modified docs/assets/screenshots/quick-empty-dark.png
Binary file modified docs/assets/screenshots/quick-empty-light.png
Binary file modified docs/assets/screenshots/quick-filter-dark.png
Binary file modified docs/assets/screenshots/quick-filter-light.png
Binary file modified docs/assets/screenshots/quick-rows-dark.png
Binary file modified docs/assets/screenshots/quick-rows-light.png
Binary file modified docs/assets/screenshots/quick-values-dark.png
Binary file modified docs/assets/screenshots/quick-values-light.png
Binary file modified docs/assets/screenshots/report-dark.png
Binary file modified docs/assets/screenshots/report-light.png
Binary file modified docs/assets/screenshots/start-over-dark.png
Binary file modified docs/assets/screenshots/start-over-light.png
Binary file modified docs/assets/screenshots/tips-dark.png
Binary file modified docs/assets/screenshots/tips-light.png
Binary file modified docs/assets/screenshots/top-items-dark.png
Binary file modified docs/assets/screenshots/top-items-light.png
Binary file modified docs/assets/screenshots/unused-parts-dark.png
Binary file modified docs/assets/screenshots/unused-parts-light.png
Binary file modified docs/assets/screenshots/value-filter-dark.png
Binary file modified docs/assets/screenshots/value-filter-light.png
Binary file modified docs/assets/screenshots/value-menu-dark.png
Binary file modified docs/assets/screenshots/value-menu-light.png
Binary file modified docs/assets/screenshots/view-name-dark.png
Binary file modified docs/assets/screenshots/view-name-light.png
Binary file modified docs/assets/screenshots/views-menu-dark.png
Binary file modified docs/assets/screenshots/views-menu-light.png
Binary file modified docs/assets/screenshots/views-this-view-dark.png
Binary file modified docs/assets/screenshots/views-this-view-light.png
1 change: 1 addition & 0 deletions docs/getting-started/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ The next release, on `main` now. The table lists the changes that need an action
| --- | --- | --- |
| **Breaking:** a key file that starts with a UTF-8 byte order mark is refused | a key's `{ "file" }` (`output.downloads.key`, `audit.key`, a backend's or the upload store's secret) starts with one, as Windows PowerShell 5.1's `-Encoding UTF8` writes it | save the file as UTF-8 without the mark. `check-config` names the file. Download links made with the old key stop working, and audit hashes change |
| A backend's sign-in and `output.upload`'s headers read `{ "env" }` secrets from the `env` the host passes | a host passes its own `env` to `createContext` or `serve()` without those variables | add the variables to that `env`. The start warns when a backend's sign-in cannot read its secret |
| The report's corners and type icons: `--pk-radius` is 8 px (was 10 px), chips take `--pk-radius-sm`, and `--pk-type-string`, `--pk-type-number`, `--pk-type-date` and `--pk-type-boolean` default to `--pk-muted` (were one colour each) | a host sets `--pk-radius` or relies on coloured type icons, such as a theme that maps its own colours to these tokens | set `--pk-radius` or the `--pk-type-*` tokens yourself. See [theming](../reference/theming.md#tokens) |

### From 0.9 to 0.10 { #from-0-9 }

Expand Down
8 changes: 6 additions & 2 deletions docs/reference/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ size through the element.
| `--pk-shadow-sm`<br>`--pk-scrim`<br>`--pk-scrim-light` | Chip shadow; behind sheets and the drawer; behind the drill-down | see `styles.css` | see `styles.css` |
| `--pk-total`<br>`--pk-total-strong` | Subtotal and grand total rows and columns | `#eef1f5`<br>`#e9edf3` | `#21252d`<br>`#252a33` |
| `--pk-danger`<br>`--pk-danger-soft`<br>`--pk-warn`<br>`--pk-focus` | Remove and errors; the card of a filter that shows nothing; a warning in a line of text (the days of a range without data); the focus ring | `#b42318`<br>`#fdecea`<br>`#8a5a00`<br>`#2b5fd9` | `#ff8b80`<br>`#3a1f1d`<br>`#f3c56b`<br>`#84a3ff` |
| `--pk-radius`<br>`--pk-radius-sm` | Corners of panels and popovers; of buttons, chips and fields | `10px`<br>`7px` | as light |
| `--pk-radius`<br>`--pk-radius-sm` | Corners of panels, zones and popovers; of buttons, chips, fields and a field's name in the table's header | `8px`<br>`7px` | as light |
| `--pk-radius-xs`<br>`--pk-radius-mark`<br>`--pk-radius-icon` | Smaller corners, in step with `--pk-radius-sm` (set that one and these follow): links, a list's options, a column's sort button and keys; small parts inside a chip, a cell or a list (a field's grip, a badge, a filter's value, the fold button of a group in the table); a field's type icon | `calc(var(--pk-radius-sm) * 4 / 7)` (4 px)<br>`calc(var(--pk-radius-sm) * 5 / 7)` (5 px)<br>`calc(var(--pk-radius-sm) * 6 / 7)` (6 px) | as light |
| `--pk-radius-card`<br>`--pk-radius-chart` | The chart's tooltip and the HTML report's chart card; the chart's bars and pie slices (a heatmap's cells three quarters of it) | `8px`<br>`var(--pk-radius-xs)` (4 px) | as light |
| `--pk-font-mono` | The code font of the text field a view's JSON is pasted into | `ui-monospace, SFMono-Regular, Menlo, Consolas, monospace` | as light |
Expand All @@ -119,7 +119,11 @@ size through the element.
| `--pk-primary-bg`<br>`--pk-primary-text`<br>`--pk-primary-hover-bg` | The main action of a dialog (Apply, Save, Load): its fill and frame; its text; its fill on hover | `var(--pk-accent)`<br>`var(--pk-accent-text)`<br>`color-mix(in srgb, var(--pk-accent) 88%, var(--pk-text))` | as light |
| `--pk-tooltip-name-w` | Widest series name in the chart's tooltip; a longer one ends in "…" | `12em` | as light |
| `--pk-duration`<br>`--pk-ease` | Animations; `0ms` with `prefers-reduced-motion: reduce` | `180ms`<br>`cubic-bezier(0.2, 0.8, 0.2, 1)` | as light |
| `--pk-type-string`<br>`--pk-type-number`<br>`--pk-type-date`<br>`--pk-type-boolean` | Field type icons | `#6250d6`<br>`#1a7f5a`<br>`#b5560b`<br>`#a3367a` | `#a99dff`<br>`#5fd3a3`<br>`#f2a65a`<br>`#f08cc6` |
| `--pk-type-string`<br>`--pk-type-number`<br>`--pk-type-date`<br>`--pk-type-boolean` | Field type icons in the field list and on chips. Neutral, so that colour marks the zones only; set one to colour a type | `var(--pk-muted)` each | as light |
| `--pk-zone-rows`<br>`--pk-zone-columns`<br>`--pk-zone-values`<br>`--pk-zone-filters` | Each zone's colour: its title's icon, its mark in the field list, the icon before a field's name in the table's header, and the tint of its chips and of that name. For icons only, never for text: each keeps 4.6:1 on `--pk-surface-2` (the values colour also on the Grand Total header, `--pk-total-strong`) and 3:1 on its own fill | `#1d5fcc`<br>`#a85a00`<br>`#0b785c`<br>`var(--pk-muted)` | `#8db4ff`<br>`#f2b559`<br>`#5fd6ac`<br>`var(--pk-muted)` |
| `--pk-zone-tint`<br>`--pk-zone-tint-base` | The fill of a zone's chips, of its marks in the field list and of a field's name in the table's header: an opaque mix of this share of the zone's colour into this base. A filter's chip has no fill. Where the browser has no `color-mix()`, the fill is `--pk-surface-3`; in forced colours it is a frame | `16%`<br>`var(--pk-surface)` | as light |
| `--pk-control-icon`<br>`--pk-sort-arrow` | A chip's grip, menu arrow and ×; the sort arrow behind the name of the sorted header in the table and on its chip (drawn bold). The controls, a filter's chip and the type icons keep 3:1 on every zone's fill with the default `--pk-muted`: a host that lightens `--pk-muted` or these tokens must check that | `var(--pk-muted)`<br>`var(--pk-text)` | as light |
| `--pk-field-hover` | A field's background in the field list on hover | `var(--pk-surface)` | as light |
| `--pk-chart-1` ... `--pk-chart-8` | Chart series colours, in this order; read by ECharts | `#2a78d6`<br>`#eb6834`<br>`#1baf7a`<br>`#eda100`<br>`#e87ba4`<br>`#008300`<br>`#6250d6`<br>`#e34948` | `#3987e5`<br>`#d95926`<br>`#199e70`<br>`#c98500`<br>`#d55181`<br>`#008300`<br>`#9085e9`<br>`#e66767` |
| `--pk-chart-axis` | The chart's axis line, apart from the table's lines. Not set, it is `--pk-border` | not set | not set |
| `--pk-chart-reference` | The chart's reference lines of no series: a target, the lines of a stack's total. A series' own lines take its colour | `var(--pk-muted)` | `var(--pk-muted)` |
Expand Down
9 changes: 6 additions & 3 deletions docs/use/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ A field in a zone is a **chip**. Its menu changes how the report shows the field

| Part | Where | What it does |
| --- | --- | --- |
| **Fields** | left | Every column of the data, with a search and an icon for its type: text, number, date or yes/no. A mark next to a field shows which zone it is in. When the application describes a field, an **i** next to it says what the field means. A long field name takes two lines and breaks between words only. A word too long for its line ends in "…", and pointing at the name shows it whole. |
| **The zones** | below the toolbar | **Rows**, **Columns**, **Values** and **Filters**, each a shelf: its title, its **i** and **+ Add** on the left, its chips beside them. On a wide report the shelves form a grid of two equal columns: Filters and Columns on top, Rows and Values below. On a narrow one they stand one below the other. A shelf keeps its width when you add a field, and its chips wrap inside it. The **i** next to a zone's title says what the zone does, with an example. More, Help, **Show explanations** switches these off and on. The zones sit under the heading **Fields in the report**, which folds them. **Swap rows and columns** is at the right end of that heading. |
| **Fields** | left | Every column of the data, with a search and an icon for its type: text, number, date or yes/no. A mark in the zone's colour next to a field shows which zone it is in. When the application describes a field, an **i** next to it says what the field means. A long field name takes two lines and breaks between words only. A word too long for its line ends in "…", and pointing at the name shows it whole. |
| **The zones** | below the toolbar | **Rows**, **Columns**, **Values** and **Filters**, each a shelf: its title, its **i** and **+ Add** on the left, its chips beside them. Each zone has a colour and an icon, by default blue for Rows, orange for Columns, green for Values. Their chips take a light tint of it; a filter's chip has none. On a wide report the shelves form a grid of two equal columns: Filters and Columns on top, Rows and Values below. On a narrow one they stand one below the other. A shelf keeps its width when you add a field, and its chips wrap inside it. The **i** next to a zone's title says what the zone does, with an example. More, Help, **Show explanations** switches these off and on. The zones sit under the heading **Fields in the report**, which folds them. **Swap rows and columns** is at the right end of that heading. |
| **The toolbar** | top | Undo, Redo, Start over (Reset, New), the name of the view you loaded, Views, Export and **More**. **More** holds **Help** first, then what does not fit. See [small screens](layout.md#small-screens). |
| **The result** | below | The tabs **Table**, **Chart** and, on a wide report, **Both** on top, with the settings of the view shown, **Enlarge** and **Full screen** beside them. Tips stand above the tabs, a status line below the result. |

Expand Down Expand Up @@ -225,8 +225,11 @@ The menu of a value is on [Values and formats](values.md#the-menu-of-a-value).
- The header and the row labels stay in place while you scroll.
- Fields in Rows without a value show their labels only. They have no empty column, and no
total rows. The arrows still collapse the groups.
- Each field's name in the header carries its zone's icon and tint, the same as its chip: Rows
above the row labels, Columns left of their items, Values under the items.
- You can drag field names and value names from the header into a zone.
- With one value, its name stands once over all of its columns.
- With one value, its name stands once over all of its columns. With two or more, each value's
name repeats under each column with its icon and without the tint.
- The table is as wide as its columns and scrolls sideways when it is wider than the report.
- Long row labels wrap between words when the table is wider than the report, so on a phone
numbers stay in view next to them.
Expand Down
6 changes: 4 additions & 2 deletions docs/use/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ Type numbers the way the report's own language writes them: "1.000,5" in a Germa
| A field's name, such as "Region" | Z to A | back to A to Z, then Z to A again |

The **Grand Total** column's name sorts by the whole row. A value's name does nothing while Rows is
empty. An arrow before the name shows the sort; its tooltip says what the next click does. The keyboard
reaches every name with Tab, then Enter.
empty. An arrow behind the name of the sorted header shows the order, the same arrow as on the
field's chip. A custom order has no arrow, on the header or the chip. On any other header the arrow
shows on hover and on focus, for the order a click gives; the tooltip says what the next click does.
The keyboard reaches every name with Tab, then Enter.

### In the field's menu

Expand Down
6 changes: 4 additions & 2 deletions docs/use/keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ and what changed. In the report itself, **More**, **Help**, **Keyboard shortcuts
changed". A level's title names the field, such as "Month › Group". A level with fields is a group
with that heading. A level of choices is a menu. The Filter level says how many items it keeps as
it changes.
- The header whose sort you chose says its order: "sorted descending". After a click on a header, a
screen reader reads out the new order: "Region sorted: Z to A".
- The header whose sort you chose says its order and what the next click does: "sorted Largest
Sum of Revenue first. Sort by Sum of Revenue: smallest first". A field's name in the header
heads its labels or items, and the empty corner names the fields in Rows and Columns. After a
click on a header, a screen reader reads out the new order: "Region sorted: Z to A".
- The chart has a text alternative: type, values, counts, highest and lowest value.
- A screen reader reads out status messages, such as "Undone: Region removed" or
"View “Sales” saved". See [status messages](behaviour.md#status-messages).
Expand Down
2 changes: 2 additions & 0 deletions packages/pivotkit-element/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ All notable changes to `pivotkit-element` are documented in this file. The forma

### Changed

- The zones' colours and the field names in the table's header (see pivotkit-react) add 0.7 KiB to
the first load: 179.7 KiB gzip on an official Node 24 build, within its budget of 182.5 KiB ([#920](https://github.com/eizedev/pivotkit/issues/920)).
- The first load is 3.3 KiB smaller: 179.0 KiB gzip on an official Node 24 build, in 13 files as
before (was 182.3 KiB). Its budget stays at 182.5 KiB. The code moved loads on demand, and the
budgets of the chart, export and report groups rise with it (260.7, 13.7 and 26.8 KiB):
Expand Down
24 changes: 20 additions & 4 deletions packages/pivotkit-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ All notable changes to `pivotkit-react` are documented in this file. The format

## [Unreleased]

### Changed

- The README says that a minor release of 0.x can break things, with links to Versioning and Upgrading.

### Added

- Each zone has a colour: `--pk-zone-rows`, `--pk-zone-columns`, `--pk-zone-values` and
`--pk-zone-filters` (the values colour is `#0b785c`, so a value's name keeps 4.6:1 on the Grand
Total column's header too). Its chips, its marks in the field list and a field's name in the
table's header take a fill mixed from it (`--pk-zone-tint`, 16 %, into `--pk-zone-tint-base`). New
tokens for a chip's controls (`--pk-control-icon`), the sort arrow (`--pk-sort-arrow`) and a
field's hover in the field list (`--pk-field-hover`)
([#920](https://github.com/eizedev/pivotkit/issues/920)).
- Each field's name in the table's header carries its zone's icon and fill; with two or more values
each value's name carries the icon alone. Header cells name the cells they head (`scope`), and the
empty corner names the fields in Rows and Columns for a screen reader ([#920](https://github.com/eizedev/pivotkit/issues/920)).
- The package exports `TIP_IDS` and `NOTICE_IDS`, the ids of the tips and of the notices. A host
that checks a `tips` list no longer reads them from an internal chunk
([#720](https://github.com/eizedev/pivotkit/issues/720)).
Expand All @@ -24,6 +30,16 @@ All notable changes to `pivotkit-react` are documented in this file. The format

### Changed

- The sort arrow stands behind a header's name, at rest only on the sorted header, in the text
colour and bold, the same arrow as on the sorted chip. A custom order draws no arrow on either.
The sorted header's description says its order and what the next click does
([#920](https://github.com/eizedev/pivotkit/issues/920)).
- Chips of rows, columns and values have the zone's fill and no coloured frame; a filter's chip
stays neutral. The field type icons are neutral: `--pk-type-*` default to `--pk-muted` and stay
overridable. They are drawn at 16px, so their letters stand as tall as 11px text. Chips take
`--pk-radius-sm`, and `--pk-radius` is 8px (was 10px)
([#920](https://github.com/eizedev/pivotkit/issues/920)).
- The README says that a minor release of 0.x can break things, with links to Versioning and Upgrading.
- The chart's ECharts instance, its events and each draw are in `chart-draw.js`, which loads with
ECharts. A report that never shows a chart no longer loads that code
([#772](https://github.com/eizedev/pivotkit/issues/772)).
Expand Down
4 changes: 2 additions & 2 deletions packages/pivotkit-react/src/fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, source
<Icon name="grip" size={18} />
</span>
<span className={`pk-type pk-type-${field.type}`} title={typeLabel}>
<Icon name={/** @type {any} */ (TYPE_ICON[field.type] ?? "text")} size={14} />
<Icon name={/** @type {any} */ (TYPE_ICON[field.type] ?? "text")} size={16} />
<span className="pk-sr">{typeLabel}</span>
</span>
<button
Expand Down Expand Up @@ -91,7 +91,7 @@ function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, source
{zones.length ? (
<span className="pk-badges" aria-hidden="true">
{zones.map((z) => (
<span key={z} className={`pk-badge pk-badge-${z}`} aria-hidden="true" title={fill(labels.inZone, { zone: labels.zones[z] })}>
<span key={z} className={`pk-badge pk-badge-${z} pk-zone-fill`} aria-hidden="true" title={fill(labels.inZone, { zone: labels.zones[z] })}>
<Icon name={/** @type {any} */ (ZONE_ICON[z])} size={12} />
</span>
))}
Expand Down
56 changes: 56 additions & 0 deletions packages/pivotkit-react/src/header-cells.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* What a cell of the table's header names, for its look and for screen readers: a field's name gets
* its zone's icon and fill (a repeated value name the icon alone), and each header cell the scope of
* the cells it heads. The empty corner gets a label that names the fields on each axis.
*/
import { fieldLabel } from "pivotkit-core";

/**
* The field a header cell names, as the table draws it; null for an item, a total or the empty corner.
* `zone`: "rows", "cols" or "values"; `fill`: the zone's fill (a value name repeated over the columns,
* two or more values, has its icon alone); `scope`: a row field's name heads its column of row labels,
* a column field's name (in the corner, left of its items) heads its row of items.
* @param {{ values: unknown[] }} view
* @param {{ kind: string, field?: string, valueIndex?: number }} cell
* @param {boolean} last the cell is in the header's last row
* @returns {{ zone: "rows" | "cols" | "values", fill: boolean, scope: "col" | "row" } | null}
*/
export function headerField(view, cell, last) {
if (cell.kind === "corner" && cell.field) {
return last ? { zone: "rows", fill: true, scope: "col" } : { zone: "cols", fill: true, scope: "row" };
}
if (cell.kind === "colHeader" && cell.valueIndex !== undefined && last) {
return { zone: "values", fill: view.values.length < 2, scope: "col" };
}
return null;
}

/**
* The scope of a header cell: a field's name as headerField gives it, an item's or a value's header
* heads its column.
* @param {{ kind: string }} cell
* @param {{ scope: "col" | "row" } | null} named headerField's
* @returns {"col" | "row" | undefined}
*/
export function scopeOf(cell, named) {
if (named) {
return named.scope;
}
return cell.kind === "colHeader" ? "col" : undefined;
}

/**
* The words of the empty corner for a screen reader: the fields on each axis ("Rows: Team, Category;
* Columns: Priority, Channel"), the zones' names as the report writes them.
* @param {{ rows: string[], cols: string[] }} view
* @param {{ zones: Record<string, string>, core: any }} labels
* @returns {string}
*/
export function cornerLabel(view, labels) {
/** @type {[string, string[]][]} */
const axes = [["rows", view.rows], ["cols", view.cols]];
return axes
.filter(([, fields]) => fields.length > 0)
.map(([zone, fields]) => `${labels.zones[zone]}: ${fields.map((f) => fieldLabel(f, labels.core)).join(", ")}`)
.join("; ");
}
Loading
Loading