Skip to content

feat(pivot): Rest export inputs, migration guide and pivotkit's zone tokens - #242

Merged
eizedev merged 11 commits into
mainfrom
feat/pivot-render-inputs-and-zone-tokens
Nov 26, 2026
Merged

eizedev merged 11 commits into
mainfrom
feat/pivot-render-inputs-and-zone-tokens

Conversation

@eizedev

@eizedev eizedev commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

Four changes to the pivot module, part of the work for pivotkit 0.11.0. The pinned pivotkit versions stay as they are.

  • Invoke-UDPivotReport -Engine Rest takes -Locale, -Numbers and -FlatHeader and sends them to pivotkit-server as locale, numbers and flatHeader. With the same -Locale and server settings, both engines now write the same CSV and JSON. A server older than 0.3.0 gets an error that names the version. Fixes pivot: pass numbers, locale and flatHeader to the REST engine (pivotkit 0.8.0) #135
  • -Parameter against a current pivotkit-server without sources that take params ("this server has no source that takes params") now gets its own hint: leave -Parameter out, or use a source that declares them. The older answer no key "params" still names pivotkit-server 0.2.0. Fixes pivot: recognise pivotkit-server's clearer data/params errors (pivotkit#516) #132
  • A new page, "Coming from UniversalDashboard.Pivot", maps every New-UDPivot parameter, aggregator and renderer to New-UDPivotReport, names the ones without a counterpart, states the PowerShell and PSU versions, and shows one report before and after on the same rows. The pivot overview and the module README link it. Fixes Pivot docs: Coming from UniversalDashboard.Pivot #121
  • The theme bridge maps pivotkit's new zone tokens (--pk-zone-rows, -columns, -values, -filters, -tint, -tint-base) and --pk-control-icon, --pk-sort-arrow, --pk-field-hover and --pk-chart-reference. Each has a --psu-pivot-* property per light and dark mode. Without an app's value, the report keeps pivotkit's colours or derives them the way pivotkit does. The field type icons follow pivotkit's new neutral default (the muted text); the themes page and the CHANGELOG show how to get the coloured icons back with --psu-pivot-type-*. Refs react: make the table header readable - field names, value name and the top-left corner pivotkit#920

What takes effect when:

  • The zone colours, chip controls, sort arrow and field hover take effect once the module moves to pivotkit 0.11.0. The new Theme properties page says so where these rows start.
  • The reference lines and the neutral type icons take effect now: pivotkit 0.10 already reads --pk-chart-reference. On the current pivotkit, the neutral icons also turn the empty report's field pills and a value chip's border grey.

Whole-change check

Docs:

  • docs/pivot/themes.md (app authors who theme the report). I read the whole page. It was at its 200-line limit, so the property table moved to a reference page of its own, and themes.md links it. The paragraph on type colours now says that colour marks the zones, which contrast a corporate zone colour needs, and how to get coloured type icons back, with the light and dark values. "A property set only in :root applies to both modes" now lives only in "Light and dark".
  • docs/pivot/theme-properties.md (new, Reference). Every --psu-pivot-* property with its fallback and its light and dark default. The four type rows are one row; the zone and control rows follow it, with one sentence on the pivotkit version they need. The --psu-pivot-radius-sm row says that 4px is PSU's own corner and what it covers: buttons, chips, the field list and its hover, a field's name in the table, and pivotkit's smaller corners derived from it.
  • docs/pivot/reports.md (authors of endpoints and schedules). The engine table no longer says Numbers and the header are "the server's" for REST. The paragraph on -Numbers, -FlatHeader and -Locale now sits after "Both take -View" and covers both engines, with their minimum versions. Before, it was in the Node section.
  • docs/pivot/reports-server.md: the minimum server version for the three parameters.
  • docs/pivot/coming-from-ud-pivot.md (new, Start; someone moving an app from UniversalDashboard.Pivot). Requirements, the before/after pair, then one table each for the parameters, the aggregators and the renderers, one row per group. It links Views, Filters, Data and Compatibility for the details instead of repeating them. I built the tables from the code of both modules.
  • docs/pivot/index.md: one row in the "You want | Where" table links the new page.
  • The module README has one line in "Where to read on".

Code:

Growth guard:

  • tests/powershell/PivotReport.Tests.ps1 grew from 1391 to 1408 code lines. I read the whole file. The version-hint test had a copied answer, call and catch for each case; one helper now serves the version hints, and the "nothing sent without them" check moved into the first REST test, which makes that call already. The rest is the new test for the body of -Locale, -Numbers and -FlatHeader, next to the other REST body tests that use this file's stand-in server, and one assertion for the "takes params" hint. The file was far over the 300-line limit before. The fix for that is a shared helper for the stand-in server and a split by command, a change of its own.
  • The docs total grows by 111 lines, from 5202 to 5313: the two new pages (coming-from-ud-pivot.md 89, theme-properties.md 79) because the migration guide and the property table need room of their own, less the 61 lines the table took out of themes.md, plus 4 lines for links and the engines paragraph on the overview, reports.md and the README. main already measures 5204, 2 lines over its baseline; the new baseline does not take those 2.

Checklist

  • Linked issue
  • A fix comes with a test that fails without it; no test weakened, skipped or deleted
  • The pages in docs/ and the module's CHANGELOG.md describe the new state
  • A visible change: checked on a PSU test instance in light and dark theme, in a wide window, with pivotkit's next version packed into the module. A narrow window was not checked.

Test plan

  • The checks of Check your change: lint, unit tests, Pester, PSScriptAnalyzer and the module build pass; the growth guard passes after its baseline accepts the test file and the docs total above
  • What I ran and saw:
    • Unit tests: 236 passed, 0 failed.
    • Pester: 379 passed, 0 failed.
    • PSScriptAnalyzer: no findings.
    • Growth: the two entries above.
    • The theme unit tests pass against both the pinned pivotkit styles and the next version's.
    • The before/after pair gives the same table in react-pivottable and pivotkit.
  • On a PSU test instance, with pivotkit's next version packed into the module: the browser specs "--psu-pivot-type-* and --psu-pivot-tab-* ... (Pivot: theme properties for the field type colours in psu.css #137)" (updated for the neutral icons) and "--psu-pivot-zone-* and the chip controls ... (pivotkit#920)" (new) pass. The full run: 42 passed, 5 failed. The 5 also fail on main with the pinned packages (Five pivot browser tests fail against a main build #240). The commits after that run change docs and the server error hint, not the stylesheet.
  • The before/after example on the migration page on a PSU instance: not run, because it needs UniversalDashboard.Pivot installed there.

Neutral review

A separate AI session reviewed the branch before it was pushed, in two rounds.

  • Round 1 found four medium points, all fixed:
  • Its low points are fixed too: the migration guide on its own page, the wording of -Data, Stacked and the two engines, the radius row, and the help line.
  • Round 2 found nothing medium or worse. Its four low points are fixed in the last commit:
    • the 0.11-only rows are marked;
    • the CHANGELOG points to both modes' type colours;
    • the baseline note on main's 2 lines.

🤖 Generated with Claude Code

eizedev and others added 11 commits November 26, 2026 03:39
…rams answer

pivotkit-server answers params where no source takes any with
NO_PARAMS_TEXT ("this server has no source that takes params"). The
hint matched only the older "no key \"params\"", so the new answer
got none. A test covers both texts.

Refs #132

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and -FlatHeader

pivotkit-server 0.3.0's render routes take locale, numbers and flatHeader.
The REST engine refused all three; it now writes them into the body when
they are given, so both engines write the same CSV and JSON. Without them
nothing is sent, so older servers still render; their answer to the new
keys names the version they need. -TimeZone stays with -Engine Node: the
server has no such input.

Refs #135

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntrols

The bridge maps pivotkit's zone tokens (--pk-zone-rows, -columns, -values,
-filters, -tint, -tint-base), --pk-control-icon, --pk-sort-arrow,
--pk-field-hover and --pk-chart-reference, each with a --psu-pivot-*
property per light and dark mode. Without an app's value they keep
pivotkit's colours (repeated as --psu-default-zone-*) or its derivation.

The field type icons follow pivotkit's new neutral default, the muted
text; --psu-pivot-type-* still sets them. The themes page lists every new
property; a unit test checks the mapping and the zone colours' contrast
on PSU's surfaces, a live spec reads the tokens per PSU mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the new options in the first

The version hints for -Data, -Parameter and -Locale/-Numbers/-FlatHeader
share one helper instead of a copied answer, call and catch per case. The
check that a call without -Locale, -Numbers and -FlatHeader sends none of
them moves into the first REST test, which makes that call already.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pivot overview maps every parameter of New-UDPivot to New-UDPivotReport:
the start view moves into -View, each aggregator and renderer name has
its pivotkit counterpart or is named as having none. One report on the
same rows, before and after; the module README links the section.

Refs #121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owth baseline

PivotReport.Tests.ps1 grows by 16 code lines for the #132 and #135 tests,
after folding the version hints into one helper. The file was over its
limit before; splitting it is a change of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not a version

A current pivotkit-server answers -Parameter with "this server has no
source that takes params" when none of its sources declares parameters.
That server is new enough, so the hint now says to leave -Parameter out
or use a source that declares them (Get-UDPivotSource lists them). The
older "no key \"params\"" keeps the 0.2.0 hint. The test asserts each
text's hint and that the new one names no version; that assertion is
the one code line the baseline takes in.

Refs #132

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pivotkit minimum

- The property table moves from the themes page (200 lines, its limit) to
  docs/pivot/theme-properties.md, listed under Pivot > Reference. Its intro
  says that the rows from --psu-pivot-zone-rows to --psu-pivot-field-hover
  take effect with pivotkit 0.11.0 or later; the chart reference already
  works with 0.10.
- The themes page and the CHANGELOG show how to get the coloured type icons
  back: set the four --psu-pivot-type-* properties per mode.
- The --psu-pivot-radius-sm row says that 4px is PSU's own corner and what it
  covers: buttons, chips, the field list and its hover, a field's name in the
  table, and pivotkit's smaller corners derived from it.
- The CHANGELOG's #135 entry says "with the same -Locale and server settings".
- The docs test and the browser spec read the rows from the new page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The section moves from the pivot overview to
  docs/pivot/coming-from-ud-pivot.md, listed under Pivot > Start. The
  overview's "You want | Where" row and the module README link the page.
- The page states the requirements: PowerShell 7.4 or later (the old module
  also ran on Windows PowerShell 5.1) and PSU 2026.2 or 2026.3, as
  Compatibility lists them.
- The aggregators and renderers get one row per group instead of one long
  cell each; -Data says "also a DataTable", and the stacked charts read
  chart = @{ type = 'bar'; stacked = $true }.
- reports.md and the CHANGELOG say that both engines write the same file with
  the same -Locale and server settings.
- New-UDPivotRenderBody's help description is wrapped.

Refs #121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge's pages

The baseline had 5202 lines; this change adds 111 (measured page by page
against the base commit): the new pages coming-from-ud-pivot.md (89) and
theme-properties.md (79), the "Coming from" row and two report lines on the
overview and reports.md (+3), and the README link (+1), less the 61 lines the
property table took out of themes.md. 5202 + 111 = 5313. The 2 lines main
already had over its baseline stay outside it; the measured total is 5315.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ype colours

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eizedev
eizedev merged commit 790e802 into main Nov 26, 2026
12 checks passed
@eizedev
eizedev deleted the feat/pivot-render-inputs-and-zone-tokens branch November 26, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant