Repository navigation
fix(plugin-report): a matrix lays out each header dimension on its own — a date axis by bucket key, a select axis in option order - #34380
Merged
Conversation
… a date axis by bucket key, a select by its options A dimension the report's order names keeps the server's order; an unnamed select takes its declared option order and an unnamed date its bucket keys ascending, so a measure order or a date order no longer scrambles either axis. Claude-Session: https://claude.ai/code/session_01ADHkmSDShXaoKYWNqiKtAC Co-authored-by: Claude <noreply@anthropic.com>
…imension matrix layout Claude-Session: https://claude.ai/code/session_01ADHkmSDShXaoKYWNqiKtAC Co-authored-by: Claude <noreply@anthropic.com>
… fixture Claude-Session: https://claude.ai/code/session_01ADHkmSDShXaoKYWNqiKtAC Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见从「整张报表有没有写 order」改成「每个维度有没有被 order 点名」,就从根上解决了两条轴互相牵连的问题。重排表头不算行级重排,所以头部文档里「不在客户端重排」的约束依然成立,文档也已按这个说法改写。作者在同一个日期维度上显式写的降序会保留(钉子 d)。同意落地。 席位核对 — ACCEPT · domain:ui#2 · head 4c7d73b · 2026-11-16T11:24Z |
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.
Requested by Steve · project thread
Fixes #34364
Clause-②: no
Metadata-protocol: none
维护者速读
order点名的维度保持服务端顺序;没点名的选项字段按声明的选项顺序;没点名的日期维度按桶键(原始值)升序,空桶排最后;其余维度保持到达顺序。compareTo、超 2000 格),日期列按首次出现顺序排成一段段;而只要报表带任何order,两条轴的选项顺序就都失效,按日期排序会把优先级行打乱成 Critical / High / Low / Medium。应用侧无法自救。@object-ui/plugin-report的矩阵表头排列,单元格仍按桶 id 定位、下钻负载不变;平铺表和内嵌图表不变;无服务端或契约改动。回滚即 revert 本 PR。ui/packages/plugin-report/src/DatasetReportRenderer.tsx的matrixAxisComparators与compareDateBucketKeys,以及矩阵pivot里调用arrangeGroups的两行;其次DatasetReportRenderer.selectOptionOrder-12243.test.tsx末尾 objectstack#34364 一组。pnpm --dir ui exec vitest run packages/plugin-report/src/__tests__/DatasetReportRenderer.selectOptionOrder-12243.test.tsx,预期 15 个测试全过。What changes
order.matrixAxisComparatorsdecides each header dimension on its own:order→ kept in the server's order;compareDateBucketKeys): the raw key inh.key, compared by code unit, never the localized label; two numbers compare numerically; the empty bucket last, asdeclaredOptionPositiondoes;AnalyticsResult.fields[]descriptor saystype: 'time', which the analytics compiler sets for every datasetdatedimension at anydateGranularity. Bucket keys are minted sort-stable by the server (2026-03,2026-Q1,2026-W03,2026-03-07).desc) is the author's and is kept; only an axis the order does not name is re-laid. Pinned by case (d).arrangeByDeclaredOptionsis now a thin wrapper over a genericarrangeGroups(same level-by-level, stable bucket sort, comparator supplied per dimension). The matrix permutes onlyrowHeaders/colHeaders; every cell is still looked up by bucket id and each header carries its own drillkey, so drill payloads stay index-aligned. The flat table and the embedded chart keep their existing rule.AGENTS.mdchore: version packages #10)..changeset/34364-matrix-date-axis-order.md(@object-ui/plugin-report: patch).Tests
New top-level
describein the existing ordering harnessDatasetReportRenderer.selectOptionOrder-12243.test.tsx(reuses itscrm_casepriority options, metadata stub and dataset source). Matrix: rowspriority(Low / Medium / High / Critical), columnscreated_attypedtime, valuescase_count, rows arriving grouped by stored priority with days out of order and a null day (declarednullLabel"No date"):2026-11-03, 2026-11-12, 2026-11-14, 2026-11-16, No date; rows Low, Medium, High, Critical with every cell under its own headers; a click on the first cell drills{ priority: 'Low', created_at: '2026-11-03' }.order [{ by: case_count, desc }]→ the same layout.order [{ by: created_at, asc }]→ columns ascend, rows STILL in option order.order [{ by: created_at, desc }]→ columns descend (No datefirst, as the server sent), rows in option order.order [{ by: priority }]→ rows keep the server's order, day columns still ascend.The existing objectui#12243 cases and the framework#3916 matrix-order cases in
DatasetReportRenderer.test.tsxpass unchanged. No forced edits to existing tests.Acceptance notes
order; the card asks only about the matrix, and a flat table's row order under a measure order is the author's.Verification
Tests (head 4c7d73b)
pnpm --dir ui exec vitest run packages/plugin-report/src/__tests__/DatasetReportRenderer.selectOptionOrder-12243.test.tsx→ Test Files 1 passed, Tests 15 passed (on 2fc9d9d and again on 4c7d73b).4c7d73b7changes only the test fixture: thecreated_atsort helper ordered the empty day with a raw U+FFFF sentinel character, now replaced by an explicit null branch (same order).pnpm --dir ui exec vitest run packages/plugin-report/ --maxWorkers=2 && pnpm --filter @object-ui/plugin-report run type-check→ Test Files 33 passed (33), Tests 329 passed / 7 skipped; type-check done; lock VERDICT command-exit 0.pnpm --dir ui exec eslinton the two changed files → exit 0 (0 errors; 5 pre-existingreact-refresh/only-export-componentswarnings on existing exports).pnpm --dir ui run check:new-line-citations→ 0 new citations.Ablations (scripts/ablation-replace.mjs, mutation proven on disk, each restored to HEAD blob add203e300cf)
Directions were written into the test file before the runs.
null→ (a), (b) and CONTROL red (3 failed / 12 passed); (c), (d) green as predicted. Re-run on 4c7d73b with the same result.if (ordered.has(dim)) return null;→if (ordered.size > 0) return null;(the old all-or-nothing rule) → (b), (c), (d) and CONTROL red (4 failed / 11 passed); (a) green.Derived gate families
Head
4c7d73b7(re-run after the fixture commit; the list and every exit code match the run on 2fc9d9d),node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 38 commands, all exit 0.--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.Every family CI runs is read from this PR's check-runs, not re-run here.
Generated by Claude Code