This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(plugin-dashboard): pin the chart x LOCAL-select cell — objectui#7696's premise is measured false - #8192
Merged
os-justin merged 1 commit intoSep 7, 2026
Conversation
…ui#7696's own fixture objectui#7696 modelled the analytics option-label coverage as a 2x2 and reported the chart / local-select cell as left open by both objectui#4030 (PR #4324) and objectui#4330 (PR #4388). Measured on origin/main, that cell was never open: - PR #4324 already resolved EVERY dimension on a chart. The `dottedOnly = isTable` gate it left behind was on the TABLE path, and PR #4388 is what removed it — the chart arm of that expression was always `false`. - `buildDimensionLabelMap` carries the AUTHORED label as a second key beside the stored value, which is exactly what re-translates a row the server already resolved (ADR-0021) — the card's measured shape. This adds the card's own fixture as a pin: `duly_duty_register`, one local `form` select dimension, a pie with `showLegend`, rows arriving server-resolved to the object's authored English labels, asserted to plot the zh-CN labels on a zh console and the authored ones under `en`. The middle case is a control that FIRES: the same fixture with the option LIST removed from the object document plots English, so the first assertion is a reading rather than a coincidence. Ablation confirmed the pin's direction — dropping `relabelDimensions` from DatasetWidget's chart branch reddens the zh case alone (1 failed | 2 passed) and leaves the control and the `en` boundary green. No production code changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-justin
marked this pull request as ready for review
September 7, 2026 00:22
os-justin
deleted the
claude/issue-7696-analytics-local-select-dimension-i18n
branch
September 7, 2026 00:38
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Part of #7696 — deliberately not
Fixes. This PR changes no production code and does not explain the downstream symptom #7696 reports, so merging it must not close that card. What it leaves open: why the reporter'sdulyconsole renders English (see "What is still open" below). What it closes: the coverage question the card asked, answered as a measurement and pinned.The card's premise, and the measurement that falsifies it
#7696 models the analytics option-label coverage as a 2x2 and reports the chart x LOCAL-select cell as left open by both #4030 (PR #4324) and #4330 (PR #4388). Measured on
origin/main=a915064, that cell was never open.PR #4324 already resolved EVERY dimension on a chart. The
dottedOnlygate it left behind reads, in its own diff:The chart arm of that ternary is the
falsearm — every dimension, dotted or local. PR #4388 removed the gate, and its own commit message says which half it was widening ("Table, pivot andDatasetReportRenderernow take that one read"). So #4388 widened the table path; the chart path did not need widening.buildDimensionLabelMapis what re-translates a server-resolved row, which is the card's measured shape (rows[].formbyte-identical across locales, carrying the object's authored English label):The second key is the authored label. A row arriving as
Recurringtherefore lands on the same translated display as a row arriving asrecurring.The cell is already pinned, too, under a name that does not mention it — which is plausibly how the card came to be written.
packages/plugin-dashboard/src/__tests__/DatasetWidget.optionLabelI18n.test.tsxcarriesre-translates a chart the SERVER already resolved to the English label: a LOCALcompetitor_namedimension (dimensionFields: { competitor_name: 'competitor_name' }, no dot), rows carryingOrion Engineered Carbons, asserted to plot欧励隆. That is the card's cell, green since PR #4324.What this PR adds
One test file,
DatasetWidget.chartLocalSelectI18n.test.tsx, restating the measurement in the card's own fixture so the next reader of the 2x2 gets an answer fromgit grep 7696:zhduly_duty_register, localformselect, pie +showLegend, rows server-resolved toOne-off / Recurring / Standing, plots['一次性','周期性','常设'], one metadata read['One-off','Recurring','Standing']en, the authored labels surviveThe control is what makes the first case a reading rather than a coincidence:
resolveDimensionFieldMetayields an entry only for a terminal field carryingoptions, so removing them is the one change that starves the seam with every other input held identical — same rows, same bundle, same widget, same locale, same read.The pie's categories are read off the schema handed to the chart renderer, and that is the legend:
AdvancedChartImpl's pie branch buildspieConfig[String(row[xAxisKey])] = { label: String(row[xAxisKey]) }and hands it toChartLegendContent nameKey={xAxisKey}, so the painted legend text IS the category string in those rows.Ablation
Mutation and restore both proven by state, never by an exit code:
Replacing
const chartRows = relabelDimensions(state.rows, dimensionLabels)withstate.rowsreddens thezhcase alone; the control and theenboundary stay green, which is the direction a pin on this seam should have.What is still open (for #7696's re-triage)
The reporter's console really does render English, and nothing here explains that. All three analytics chart producers relabel — enumerated as every non-test
buildChartSeriescall site rather than grepped for the seam's spelling:plugin-dashboard/src/DatasetWidget.tsx:1407:1388plugin-report/src/DatasetReportRenderer.tsx:1026:1027plugin-charts/src/ObjectChart.tsx:891:892So the English must come from one of the five ways this best-effort net starves, each of which is one step to measure in the live app:
object—useDatasetDimensionMetabails before reading;GET /api/v1/meta/object/duly_dutyfails or is unauthorized — the catch sets meta null (DatasetWidget's option-color / dimension-label probe reads the globalfetch, bypassing the host'sapiFetchchannel (the plugin-dashboard twin of #4114) #4121's shape: a bearer-token console whoseapiFetchnever reached the context);duly_duty.fields.formcarries no inlineoptionson the metadata document (options behind a shared option set);fieldOptionLabelreturns the authored label and no map key is emitted;I18nProviderin scope, souseSafeFieldLabeldegrades to authored labels.(3) and (2) fit the report best: both leave the list view beside the dashboard correct, since it resolves options through a different path.
Checks
pnpm exec turbo run type-check --filter=@object-ui/plugin-dashboard— 14/14 tasks successful. Its second leg istsc -p tsconfig.test.json, so the new file is inside the typechecked set, not excluded with the rest of the tests.pnpm exec vitest run --maxWorkers=2 packages/plugin-dashboard/— 95 files, 849 tests, all passing, at1738297c7.check:control-bytes,check:vi-mock-specifiers,check:vi-mock-inherit,check:unreferenced-sources— all exit 0.check-governed-queue-guard.mjs --teston both changed paths:NOT GOVERNED — 2 path(s) checked against 5 governed surface(s); none matched.turbo ls --affectednames 7 packages, six of them downstream consumers ofplugin-dashboard. The diff adds one file underplugin-dashboard/src/__tests__/that nothing imports and that ships in no bundle, so no consumer can observe it; their suites are left to CI.needs:contract-review.skip-changesetlabel is deliberately not applied.Out of scope, filed separately
#8187 — the metadata-admin dataset PREVIEW chart (
app-shell/src/views/metadata-admin/previews/DatasetPreview.tsx) is a fourth analytics chart that never callsbuildChartSeriesand handsstate.rowstoChartRendererunrelabeled, so a dotted dimension plots raw stored values there. Measured while enumerating the producers above; not touched here.Generated by Claude Code