Skip to content

feat(pivot): rows from a pivotkit-server for the signed-in person, pivotkit 0.9 - #152

Merged
eizedev merged 12 commits into
mainfrom
feat/pivot-0.9.0
Nov 22, 2026
Merged

eizedev merged 12 commits into
mainfrom
feat/pivot-0.9.0

Conversation

@eizedev

@eizedev eizedev commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

TL;DR: the Pivot module's part of pivotkit 0.9. A page shows a pivotkit-server source for the signed-in person, also from a create_link link with parameters. Draft until pivotkit 0.9 is on npm.

TODO before merge: refresh the lock file once pivotkit 0.9 is on npm. The committed package.json pins pivotkit's release (eizedev/pivotkit#704): pivotkit-core 0.9.0, pivotkit-react 0.9.0, pivotkit-report 0.5.0 and pivotkit-xlsx 0.6.0. The lock file still holds the 0.8 versions, so npm ci fails in CI until then. I built and tested against tarballs packed from pivotkit's main at f8205ed8, installed locally only. ModuleVersion is 0.9.0 and the CHANGELOG heading 0.9.0 - 2026-11-21.

Fixes #144
Fixes #146
Fixes #153

What changes

Rows from a server (#144)

  • New-UDPivotReport -Uri -Source -Token fetches the rows from POST /sources/records with the person's token ($AccessToken).
  • The answer goes to the report as JSON text (records prop). PowerShell never turns it into objects. The report parses it and hands pivotkit-react the columnar data.
  • Link parameters come from $Query (or -Query), filtered by the source's linkParams from GET /sources. -Parameter replaces them. The issue calls it -Params; I kept the name Invoke-UDPivotReport uses and added -Params as an alias.
  • -View <name> sends a named view to the server.
  • -MaxBytes (default 32 MB, at most 64 MB) caps the answer. It is read in pieces; a cut-off answer is an error, never part of the rows. Error answers are read with a cap and a time limit too.
  • Server answers map to typed errors as the issue's table says. PivotRowsNotAllowed, PivotNoData and PivotServerBusy are new, for the rows route only. A 400 shows the reader "this link does not fit", a 403 INSUFFICIENT_SCOPE "not set up for your sign-in". A page without a token asks the reader to sign in and names SaveTokens in the log.
  • The reader sees a plain message in English or German. The operator's message always goes to the warning stream. PSU shows an error of a page to the reader as a toast, with the server's address (I saw it on the test instance), so it is no error by default. -ErrorAction or -ErrorVariable get the error record as well; -ErrorAction Stop throws.
  • A link's view that needs a field the server held back (withheld) says which field above the report.
  • Get-UDPivotSource adds Records, LinkParams, Views, Rows and DataAsOf.
  • Docs: a page of its own, docs/pivot/server-rows.md: setup on PSU and pivotkit-server with the server's limits, what leaves the server, links, errors, what stays on the PSU server, sizing with DOTNET_GCHeapHardLimit. The issue asked for this in reports.md; that page is about files without a browser, so the new page sits next to it and reports.md links it from its errors section.

Network requests (#146)

docs/pivot/events.md links pivotkit's security.md#network and lists the module's own requests.

pivotkit 0.9

Merge of main (#156) and #153

  • main is merged in (no rebase), with fix(pivot): -ErrorVariable holds only the error, -Tips refuses unknown ids, chart settings table #156: -ErrorVariable holds only the error, -Tips refuses unknown ids, a table of the chart settings. The views page's table has 'both', combo, treemap and extremes; -Tips knows stackedTotal.
  • New-UDPivotReport -Uri: -ErrorVariable holds the error once. -ErrorAction Stop throws it with its own id, as the module's other commands do; after the merge it gave PipelineStopped. The tests expect the plain id there now.
  • Invoke-UDPivotReport -Engine Node -Numbers Full|Shown and -FlatHeader: pivotkit-cli 0.5.0's --numbers and --flat-header, refused for other formats and for -Engine Rest. Checked with the real pivotkit-cli 0.5.0 from pivotkit's main.

"Done when" of #144

  • An app shows a server source plain and from a create_link link with a parameter: on both test instances, with a test issuer's token instead of $AccessToken (see "Tested").
  • Tests for each typed error against a stand-in server (Pester).
  • A copied link keeps the allowed query parameters: tests/browser/psu-pivot-rows.spec.mjs, run by hand on both instances (it needs a PSU instance and a server, so CI skips it).
  • Text pass-through at the server's default row limit, with numbers: 50,000 rows of 20 columns.
  • Memory for 10,000, 100,000 and the row limit, both processes, compared with -Data: measured below, except -Data at 100,000 rows.
  • The largest text prop PSU passes, named in the docs: 64 MiB.
  • Sizing section with DOTNET_GCHeapHardLimit.
  • Docs on server mode, SaveTokens, rest.audience, the scope, where the token works, what stays on PSU.
  • The stage 2 threshold: the issue sets it after this measurement. That is your decision.

Memory measurement

Both PSU test instances (2026.2.5 and 2026.3.4, containers with a 2 GiB limit), an app in a PowerShell 7 environment, so the page's host process and PSU's server process are apart. pivotkit-server from pivotkit main next to PSU on loopback, 20 columns, 3 page loads per row. Growth of RSS at the peak, sampled every 0.25 s. The rows of the server ran one after another in the same host process; -Data (Import-Csv objects) in a new one.

Rows Answer Host process (2026.2.5 / 2026.3.4) PSU server process Page load
10,000 1.6 MiB +22 / +5 MB +15 / +0 MB 0.5 to 1.5 s
50,000 (default row limit) 8.2 MiB +145 / +162 MB +53 / +105 MB 0.9 to 3 s
100,000 16.3 MiB +161 / +284 MB +12 / +87 MB 1.4 to 4.6 s
10,000 as -Data - +116 / +73 MB +1 / +35 MB 2.9 to 4.5 s
50,000 as -Data - +509 / +467 MB +4 / +0 MB 14.5 to 17.8 s
  • At the default row limit, PSU's server process grew by 53 to 105 MB. That is the number for the stage 2 threshold of the issue.
  • The largest text prop PSU passed to the browser: 64 MiB on both instances. 128 MiB crashed the browser tab, not PSU.
  • -Data at 100,000 rows was not measured: it risked an out-of-memory kill of a shared test instance.
  • The PSU server process was already at about 1 GB before, and .NET frees at its own time, so single numbers vary.

Tested

  • Pester: 341 passed, 1 failed (after the merge of main). The failure is the built module carries pivotkit-core's view-file and view schemas of the version the bundle uses: it compares the installed pivotkit-core with the lock file and passes once the lock file is refreshed.
  • npm test: 153 passed (with a test per reader message kind).
  • PSScriptAnalyzer as CI: clean.
  • Playwright, Chromium only, 2 workers: site.spec.mjs 29 passed (the new "Bars and lines" test failed with the 0.8 bundle, which drew bars and dropped combo and extremes). The new psu-pivot-rows.spec.mjs 3 passed on both instances (on the server rows commits; not run again on the last build).
  • On the last build, against pivotkit's main: psu-pivot.spec.mjs 36 passed on both instances (4 skipped: the sign-in role tests), with two new tests. The view file test failed before the file was on the instance. psu-pivot-demo.spec.mjs 4 passed on both.
  • By hand on both instances: a German and an English report at first load, the touch targets at 390 px with touch emulation (no button or tab under 44 x 44 px), the view with all four new keys.
  • By hand on both instances: a server source opened plain and from a create_link link with ?customer=acme, the withheld-field notice, every reader message in light and dark at 390 px.

The person's token in these tests was a token of a test issuer that pivotkit-server trusts (auth.externalIssuers). PSU's own OpenID Connect sign-in with $AccessToken is not set up on the test instances, so that path is not tested end to end yet.

Reviews

An independent general review and an operator/developer role review ran on the local commit before the push, and a follow-up review on the fixes. The second commit holds the fixes.

For the pivotkit 0.9 part, an independent general, operator and developer review ran on the local commit, and a follow-up review on its fixes. The commits after feat(pivot): pivotkit 0.9's view keys hold the fixes.

Places checked

docs/pivot/server-rows.md (new, in the navigation), reports.md, events.md, views.md, index.md, themes.md, docs/site/examples.ps1, the module CHANGELOG, AGENTS.md, the help of New-UDPivotReport, Get-UDPivotSource and Invoke-UDPivotReport. The module README stays as it is. The Demo module needs no new minimum version.

🤖 Generated with Claude Code

eizedev and others added 8 commits November 21, 2026 14:16
…votkit 0.9

New-UDPivotReport -Uri -Source -Token fetches a source's rows from
pivotkit-server's rows route with the person's token and hands the answer
to the report as JSON text. Link parameters come from the page's query
string, filtered by the source's linkParams. Server answers map to typed
errors; the reader gets a plain message, the operator a warning.

Also: Get-UDPivotSource lists records, linkParams, views, rows and
dataAsOf; pivotkit 0.9's chart types combo and treemap and
referenceLines.extremes; theme properties for --pk-chart-axis and
--pk-chart-other; docs for sizing, DOTNET_GCHeapHardLimit and the
module's own network requests.

Fixes #144
Fixes #146

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- read an error answer of the rows route with a cap and a time limit
- an empty token asks the reader to sign in and names SaveTokens in the log
- 403 INSUFFICIENT_SCOPE tells the reader the service is not set up
- the operator's message always goes to the warning stream
- leave out parameters without a value; say when an answer is no JSON
- -MaxBytes at most 64 MB, -Params as an alias of -Parameter
- the slice "Other (n)" keeps pivotkit's grey in the dark theme
- a page of its own for the server rows, with the server's limits,
  what leaves the server and a config example; the errors table lists
  the rows route's ids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the slice "Other (n)" follows the muted text again in the light theme
- error bodies cut by the cap leave no record in $Error
- the empty-token check reuses the token conversion for the rest
- reports.md: the -Scope advice applies to client credentials only
- server-rows.md: how to choose DOTNET_GCHeapHardLimit, -Params,
  concurrency below compute.workers; index links the new page
- CHANGELOG names the 64 MB cap, -Params and the new reader messages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ConvertFrom-UDPivotView, view files, -Templates and the template stores keep
  fieldLabels, display "both", sort[].column and conditional.colors.
- -OnCellClick docs: a chart point runs it at Show the rows or a double click.
- Docs for the Both tab, Name, colour scale presets, sort by one column,
  grouping in Filters, the stackedTotal tip and touch targets.
- A Playwright test for the chart point menu on PSU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An empty fieldLabels passes; an empty or blank name is refused.
- A showcase view file with fieldLabels, both, a colour preset and a sort by
  one column, and a Playwright test that opens it on PSU.
- Docs: -NoDrillDown with the chart point menu, pie and treemap clicks,
  fieldLabels over -FieldDefaults labels, the colour scale row names,
  bundle size; CHANGELOG notes for older module versions and display case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The colour scale rows by their names on screen, the label length after
trimming as pivotkit counts it, and the CHANGELOG on older modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins of pivotkit's release: core 0.9.0, react 0.9.0, report 0.5.0,
xlsx 0.6.0. The docs name pivotkit-server 0.4.0 and pivotkit-cli 0.5.0.
ModuleVersion 0.9.0. The lock file follows once npm has them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eizedev and others added 4 commits November 22, 2026 02:29
Brings in #156 (-ErrorVariable, -Tips validation, chart settings table).
- views.md: display takes 'both'; the chart table has combo, treemap and
  referenceLines.extremes.
- CHANGELOG: main's Fixed entries go into 0.9.0.
- $Script:TipIds has stackedTotal (pivotkit-react 0.9).
- New-UDPivotReport -Uri: -ErrorVariable holds the error once, and
  -ErrorAction Stop throws it with its own id, as the module's other
  commands do. After the merge, Stop gave PipelineStopped there.

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

pivotkit-cli 0.5.0's --numbers and --flat-header: CSV and JSON numbers
rounded to the decimals the view shows, and one CSV header row. Refused
for other formats and for -Engine Rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lock file takes pivotkit-core 0.9.0, pivotkit-react 0.9.0,
pivotkit-report 0.5.0 and pivotkit-xlsx 0.6.0 as published on npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eizedev
eizedev marked this pull request as ready for review November 22, 2026 12:20
@eizedev
eizedev merged commit d9b8ca2 into main Nov 22, 2026
11 checks passed
@eizedev
eizedev deleted the feat/pivot-0.9.0 branch November 22, 2026 12:26
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