Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(plugin-charts): honour series[].type override on a dataKey-shaped series too - #8080

Merged
os-justin merged 2 commits into
mainfrom
claude/issue-7681-chart-series-type-override
Sep 6, 2026
Merged

os-justin merged 2 commits into
mainfrom
claude/issue-7681-chart-series-type-override

Conversation

@os-justin

@os-justin os-justin commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #7681

What changed

ChartRenderer's isInternalShaped fast path (added by #2945 to fix a different bug —
a name-shaped author series shadowing the normalized dataKey-shaped one) took the
raw authored series array untouched whenever every entry already carried dataKey. That
bypassed normalizeSeries entirely — the ONE place str(raw.chartType) ?? str(raw.type)
translates the declared per-series override (ChartDataSeries.type, objectui#6121) to
the renderer-internal chartType. So an author who wrote the documented dataKey
binding and the documented type override together — both independently valid on
ChartDataSeriesSchema — got neither the override nor a derived combo chart, silently.

ChartRenderer now always takes the series array through the one normalization layer
(objectui#2880 S1) instead of special-casing the dataKey shape around it:

const authored = Array.isArray(schema.series) ? schema.series : undefined;
let series: any[] | undefined = spec.series ?? authored;

normalizeSeries is a no-op on a well-formed internal-shaped entry — it round-trips
every key the internal arm of ChartRendererProps.series declares (dataKey/label/
chartType/variant/opacity/dashArray/stack/yAxis/color) unchanged — so this
is not a second read site for type (AGENTS.md #0.1); it routes every entry, of either
shape, through the same translation normalizeChartSchema already applies to a
name-shaped series.

The ChartRendererProps.series TS union is left as declared (no type on the dataKey
arm) — widening it is a separate, public-face decision this fix does not make (see the
updated docblock in the diff).

This is a minor, user-visible change (see Changeset below): it changes rendered
output on unmodified documents (two bars become a bar and a line — the card's own
regression case), and it changes the delivered key set for a dataKey-shaped series
array in two more ways — an i18n label record is now resolved to a string, and an
entry with no resolvable dataKey is now dropped rather than forwarded as-is. Precedent:
#2945 shipped minor (f1c04b6) for the identical sentence on the name dialect.

Why

  • The declared ChartDataSeries.type (objectui#6121 ruling: "declared because the
    renderer already READS it") was enforced on one binding dialect and silently dropped
    on the other — declared !== enforced on a published member.
  • Triage (issue comment 5548858850) ruled Option A: route the fast path through the one
    normalization layer, rather than Option B (a second type read site in
    AdvancedChartImpl — the AGENTS.md #0.1 fallback pattern) or Option C (narrowing the
    declaration, which contradicts the declared "both shapes" series contract).

Verification

  • Re-verified every line number and the probe table against current main at the time
    (0caacca373f). PR fix(plugin-charts): pie / donut / radar / scatter render as the family they name #8034 (ed4a2f1, merged 12:36Z that day) moved chart-family
    resolution for the CHART-LEVEL chartType/type (objectui#7401's surface) — a
    different key on a different surface from this card's per-SERIES type. It does not
    change this bug's premise: normalizeChartSchema.ts's str(raw.chartType) ?? str(raw.type) (now at line 361, was line 244 in triage's reading) remains the only
    read of raw.type in the package, and AdvancedChartImpl.tsx still has zero reads of
    s.type (only s.chartType).
  • Reused the card's probe table verbatim as the regression pin in
    ChartRenderer.specSeries.test.tsx, plus the name-dialect control (already present
    in that file). All 3 probe-table rows, plus the pre-existing mixed-shape and
    Tremor-adapter cases, pass.
  • Reverse-verified: reinstated the old isInternalShaped fast path in place, re-ran —
    exactly the new probe test went red at {bars: 2, lines: 0} (matching the card's
    pre-registered prediction), the other 5 cases in the file stayed green. Restored the
    fix (confirmed byte-identical to the pre-mutation version) and re-confirmed green.
  • Checked Vocabulary consolidation (#2901): what shipped, and why Track C items 1–3 are not planned #2945's shadowing defect cannot reintroduce: the fix routes name-shaped and
    mixed-shape series through spec.series exactly as Vocabulary consolidation (#2901): what shipped, and why Track C items 1–3 are not planned #2945 already did (unchanged
    behaviour for those two cases, still pinned by the existing tests in the same file);
    only the dataKey-only case changes, and only in that it now honours type too.
  • pnpm --filter @object-ui/plugin-charts test: 47 files / 434 tests green. Two
    container-load flakes were hit along the way in files this PR does not touch
    (ObjectChart.elementDataSource.test.tsx, ChartRenderer.catalogRender-6939.test.tsx,
    ObjectChart.datasetMeasureLabel.test.tsx — a different subset each run) — all three
    reproduce the documented pattern in AGENTS.md "测试纪律" (Suspense-fallback-stuck under
    parallel transform load) and pass cleanly in isolation. The new test's own file
    (ChartRenderer.specSeries.test.tsx) hit the same pattern once before this PR added an
    eager import './AdvancedChartImpl' to it (matching the file's own lazy-load
    specifier), after which it was green across every full-suite rerun.
  • pnpm --filter @object-ui/plugin-charts type-check: clean, after building the
    package's dependency closure (pnpm --filter '@object-ui/plugin-charts^...' build).
  • check:control-bytes, check:published-tsconfig-exclude, changeset:check: all
    green. check:sdui-registration-pins and check:published-dist need a full
    console / near-full-monorepo build respectively (unrelated packages this diff does not
    touch) — not run locally given the cost; this diff adds no export, no registration
    entry, and no package.json field change, so the regression risk on either is null.
    Left for CI.

Review round

Contract review flagged two issues, both fixed, mechanism unchanged:

  1. Changeset bump patch → minor, with the two undisclosed delivered-key-set
    effects (i18n label resolution, dropped-unresolvable-dataKey filtering) added to
    the changeset body — see "Why" above.
  2. Stale docblock — packages/core/src/utils/chart-presentation.ts:108-115 gave, as
    the reason for seriesPresentation's own type narrowing, "ChartRenderer forwards
    a dataKey-shaped array untouched, so normalizeChartSchema's own identical
    narrowing never sees it" — false after this PR. Corrected the docblock; seriesPresentation's logic is untouched (comment-only change), the double narrowing
    stays and is idempotent (verified: rebuilt @object-ui/core clean, reran the full
    plugin-charts suite green).

Confirmed still correct and unchanged: #2945 cannot regress (the new form prefers the
normalized array strictly more often); normalizeSeries is a no-op on every
well-formed internal entry; declining to widen the dataKey TS arm (Clause-② stays
no) — routing through normalizeSeries only filters/narrows, never accepts more.

Changeset

.changeset/7681-chart-series-type-override-dataKey.md — @object-ui/plugin-charts: minor.


Generated by Claude Code

… series too

`ChartRenderer`'s `isInternalShaped` fast path (introduced by #2945 to fix a
different bug) took the raw authored series array untouched whenever every
entry already carried `dataKey`, bypassing `normalizeSeries` entirely — the
only place `type` is translated to the renderer-internal `chartType`. An
author who wrote the documented `dataKey` binding and the documented `type`
override together (both independently valid on `ChartDataSeriesSchema`) got
neither the override nor a derived combo chart, silently (objectui#7681).

`ChartRenderer` now always routes the series array through the one
normalization layer (objectui#2880 S1) instead of special-casing the
`dataKey` shape around it. `normalizeSeries` is a no-op on a well-formed
internal-shaped entry, so no existing internal caller changes behaviour.

Adds the card's probe-table regression pin to ChartRenderer.specSeries.test.tsx,
plus an eager `./AdvancedChartImpl` import in that file to avoid a documented
flaky-under-parallel-load failure mode (AGENTS.md "测试纪律") that the new
assertion made visible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3186.1 KB 3191.4 KB
Main entry chunk (gzip) 143.5 KB 350 KB
Entry file index-Cl-fm-uy.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.67KB 5.75KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 497.06KB 113.79KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 182.08KB 50.62KB
fields (index.js) 242.43KB 61.25KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 6.57KB 2.76KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.84KB 10.94KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.16KB 3.68KB
plugin-calendar (index.js) 47.29KB 13.18KB
plugin-charts (index.js) 70.35KB 19.68KB
plugin-chatbot (index.js) 193.53KB 46.05KB
plugin-dashboard (index.js) 131.41KB 34.43KB
plugin-designer (index.js) 211.51KB 43.01KB
plugin-detail (index.js) 247.59KB 63.48KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 131.01KB 32.32KB
plugin-gantt (index.js) 167.16KB 40.99KB
plugin-grid (index.js) 208.56KB 56.63KB
plugin-kanban (index.js) 52.30KB 14.49KB
plugin-list (index.js) 113.24KB 27.66KB
plugin-map (index.js) 20.35KB 6.77KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.42KB 11.92KB
plugin-timeline (index.js) 29.95KB 8.67KB
plugin-tree (index.js) 9.19KB 3.19KB
plugin-view (index.js) 84.33KB 20.75KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Contract review on #7681 caught two issues, mechanism unchanged:

- Changeset bump patch -> minor. This changes rendered output on unmodified
  documents (the card's own regression case: two bars become a bar and a
  line) and changes the delivered key set for a dataKey-shaped series array
  (i18n label objects are now resolved to strings; entries with no resolvable
  dataKey are now filtered out) -- both now disclosed in the changeset body,
  matching #2945's precedent (f1c04b6, shipped minor for the same sentence on
  the other dialect).
- packages/core/src/utils/chart-presentation.ts:108-115's docblock asserted,
  as the reason for seriesPresentation's own type narrowing, that
  "ChartRenderer forwards a dataKey-shaped array untouched, so
  normalizeChartSchema's own identical narrowing never sees it" -- false
  after this PR's fix. Corrected the docblock; seriesPresentation's logic is
  untouched, the double narrowing stays and is idempotent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3186.1 KB 3191.4 KB
Main entry chunk (gzip) 143.5 KB 350 KB
Entry file index-Cl-fm-uy.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.67KB 5.75KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 497.06KB 113.79KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 182.08KB 50.62KB
fields (index.js) 242.43KB 61.25KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 6.57KB 2.76KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.84KB 10.94KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.16KB 3.68KB
plugin-calendar (index.js) 47.29KB 13.18KB
plugin-charts (index.js) 70.35KB 19.68KB
plugin-chatbot (index.js) 193.53KB 46.05KB
plugin-dashboard (index.js) 131.41KB 34.43KB
plugin-designer (index.js) 211.51KB 43.01KB
plugin-detail (index.js) 247.59KB 63.48KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 131.01KB 32.32KB
plugin-gantt (index.js) 167.16KB 40.99KB
plugin-grid (index.js) 208.56KB 56.63KB
plugin-kanban (index.js) 52.30KB 14.49KB
plugin-list (index.js) 113.24KB 27.66KB
plugin-map (index.js) 20.35KB 6.77KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.42KB 11.92KB
plugin-timeline (index.js) 29.95KB 8.67KB
plugin-tree (index.js) 9.19KB 3.19KB
plugin-view (index.js) 84.33KB 20.75KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Landing — patch round verified, contract review satisfied, standing down on one red that is not this PR's

By the dispatching seat (session_01YBWFb5YgMU5dw8p2VKj16S, os-justin), 15:4xZ.

Both FAIL points verified ON THE TREE, ⛔ not from the report

Commit 8208c4df7, read directly:

  • patch → minor ✅ — .changeset/7681-chart-series-type-override-dataKey.md now declares '@object-ui/plugin-charts': minor, and the body discloses the three user-visible effects that were previously undeclared (rendered output changes on unmodified documents; i18n label records on a dataKey entry now resolve to strings; entries with no resolvable dataKey are dropped rather than forwarded).
  • Stale docblock ✅ — packages/core/src/utils/chart-presentation.ts fixed. I checked this the way it needed checking: filtering the diff for lines that are not comments returns nothing, so the edit is provably comment-only and seriesPresentation's logic is untouched. The double narrowing stays idempotent.

Changeset Bump Policy is green on the new bump, which is the gate's own confirmation that minor is admissible here.

⭐ Why the review that caught these was worth its cost

Neither defect was reachable by any gate. No check enforces the bump level — Changeset Bump Policy accepts patch and minor alike here — and no check reads code comments, so a docblock asserting the very invariant this PR deletes would have shipped silently. The precedent that settled the bump was not merely near, it was the same line and the same key: objectui#2945 shipped as f1c04b6 under ### Minor Changes for the identical sentence on the other binding dialect.

CI and tier

32 of 32 check runs enumerated (returned count equals totalCount), 31 green — all four Test shards, Build & E2E, Type Check, Lint, Bundle Analysis, Governed Surface Queue Guard.

⛔ Standing down on Live E2E (informational). Advisory, and red on main itself — run 33950494089 job 101264218858 (09-05) has step 7 green in 76s; run 34017174769 job 101442890465 (09-06) has it failing after ~6 min with everything downstream skipped. ⚠️ The 09-06 run reports conclusion: success at the run level while its job fails; ⛔ never read a run conclusion as evidence here. No fix to port; carded objectui#8084. ⛔ No re-run spent — a reproducible base-red is not a flake.

⚠️ Tier note, corrected. CONTRACT_REVIEW_TIER is claude-fable-5-1 (objectstack:scripts/pm/dispatch-gates.mjs:10023) and is measured unavailable today (rate_limit, HTTP 429). The review that examined this PR ran at opus = TIER_DEFAULT, which is exactly what the quota-exhaustion exemption permits, with needs:contract-review carried as the compensating control. ⛔ My earlier description of that review as "at CONTRACT_REVIEW_TIER" was wrong and is corrected in seat post #5560 §1.

Stripping needs:contract-review, flipping ready, enqueuing.


Generated by Claude Code

@os-justin
os-justin marked this pull request as ready for review September 6, 2026 15:43
@os-justin
os-justin added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 01c27c4 Sep 6, 2026
33 of 34 checks passed
@os-justin
os-justin deleted the claude/issue-7681-chart-series-type-override branch September 6, 2026 15:59
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
… declares `type` (objectui#8086) (objectstack-ai#10554)

Fixes objectstack-ai#8086

Clause-②: yes

A published TS union widens to what `ChartDataSeriesSchema` and the
renderer already accept. This executes ruling `5809905710` (align) on
objectui#8086, dispatched by the `domain:ui` seat 2 (claim comment
`5828875764`).

## What changed

- `packages/plugin-charts/src/ChartRenderer.tsx`: the `dataKey` arm of
`ChartRendererProps.schema.series` gains `type?: string`, the same
member type the `name` arm declares. No other member of either arm
changes. The docblock that PR objectstack-ai#8080 added ("This TS union stays as
declared …") is replaced by the aligned statement. The component-body
comment said `normalizeSeries` round-trips "every key the internal arm
declares" unchanged. That comment is updated for the new member, because
`type` is translated to `chartType` and not passed through.
- `ChartRenderer.specSeries.test.tsx`: the `as any` on the `{ dataKey,
type }` case is removed. The one other `as any`, on the `categories`
case, stays, and a comment now gives the reason: it covers `categories`,
which `ChartRendererProps.schema` does not declare. Leg B below measures
this.
- `ChartRenderer.seriesTypeArm-8086.test.ts` (new, in the same folder):
compile-time pins against each arm.
- `packages/types/src/objectql.ts`: a prose-only change. The
`ObjectChartSchema.series` docblock said its element type is the
internal arm "VERBATIM". After this change that arm carries `type` and
the copy does not, so the sentence is rewritten. The type itself is
unchanged. See Deviations.
- `.changeset/8086-chart-series-type-arm.md`:
`'@object-ui/plugin-charts': minor`.

## Premise measurement: the old `as any` was not needed

`series` is a union with no literal discriminant. TypeScript's
excess-property check on an object literal therefore only asks whether
each key is known to at least one arm. On the base declaration, the
specSeries literal with `{ dataKey: 'margin', type: 'line' }` compiles
without the cast, because `type` is known to the `name` arm. Leg A shows
this: with the cast already removed, `ChartRenderer.specSeries.test.tsx`
reports zero errors. For the same reason, a `{ name, chartType }`
literal compiles against the whole union on both base and head, because
`chartType` is known to the `dataKey` arm.

The gap the card names is real, but it is in the arm, not the union. On
base, a value typed as the `dataKey` arm cannot carry `type` (TS2353),
and an entry narrowed with `'dataKey' in entry` cannot read it (TS2339).
So each new pin is written against a single arm, the `Extract` of the
union on its binding key. Pins written against the whole union would
pass on both sides of the change.

## Evidence (HEAD `ff726c28c`)

**Red on base (leg A).** This leg removes only the new member from
`ChartRenderer.tsx`, which restores the base declaration, and keeps
every test at HEAD. The edit went through `node
../objectstack/scripts/ablation-replace.mjs`: the anchor went from 1 hit
to 0, the blob changed from `e0dac80c6e03` to `ad7bb3165aac`, and after
restore the blob matched HEAD and `git diff HEAD` was empty. It then ran
`tsc -p tsconfig.test.json --listFiles` in `packages/plugin-charts`. The
file list includes `ChartRenderer.tsx`,
`ChartRenderer.seriesTypeArm-8086.test.ts` and
`ChartRenderer.specSeries.test.tsx`. Line and column numbers are removed
from the output below:

```text
ChartRenderer.seriesTypeArm-8086.test.ts  TS2339  Property 'type' does not exist on type '{ dataKey: string; ... }'          (the Equal pin)
ChartRenderer.seriesTypeArm-8086.test.ts  TS2353  'type' does not exist in type '{ dataKey: string; ... }'                      (value typed as the dataKey arm)
ChartRenderer.seriesTypeArm-8086.test.ts  TS2339  Property 'type' does not exist on type '{ dataKey: string; ... }'          (reading it back)
ChartRenderer.seriesTypeArm-8086.test.ts  TS2339  Property 'type' does not exist on type '{ dataKey: string; ... }'          (read after narrowing with 'dataKey' in e)
TSC_EXIT=2
```

Leg A also reports no error in `ChartRenderer.specSeries.test.tsx`,
which is the premise measurement above. The control `@ts-expect-error`
raised no TS2578, so a `{ name, chartType }` value typed as the `name`
arm is refused on base, as it is on head.

**Green on head.** `pnpm run type-check` in `packages/plugin-charts`
(`tsc --noEmit && tsc -p tsconfig.test.json`) printed `VERDICT
command-exit 0`.

**Kept cast (leg B).** With the `as any` removed from the `categories`
case at HEAD, tsc reports `ChartRenderer.specSeries.test.tsx TS2353:
Object literal may only specify known properties, and 'categories' does
not exist in type '{ type: string; ... }'` and `TSC_EXIT=2`. After
restore, the blob matched HEAD.

**Tests** (repo-root form, through the shared verify lock):

- `pnpm exec vitest run --maxWorkers=2 packages/plugin-charts/`: `Test
Files 73 passed (73)`, `Tests 831 passed (831)`.
- `pnpm exec vitest run --reporter=verbose` on the two touched test
files: 2 files, 9 tests passed, 3 of them in the new pin file.
- `pnpm run type-check` in `packages/types`: exit 0.
- `pnpm exec vitest run --maxWorkers=2 packages/types/`: `Test Files 233
passed (233)`, `Tests 5184 passed (5184)`.

**Gates** (verdict lines as printed):

- `node scripts/check-changeset-presence.mjs`: `✅ 4 source file(s) of 2
released package(s) changed, and this change declares 1 changeset(s)`.
- `check-changeset-no-major` ✅, `check-changeset-overwrite` ✅,
`check-changeset-fixed` ✅, `check-changeset-claims`: both sections PASS.
- `pnpm check:new-line-citations`: `VERDICT
new-cross-file-line-citations: 0 new citation(s)`.
- `pnpm check:control-bytes`: `✅ check-control-bytes: OK`.
- `check:pending-changeset-literals`, `check:test-path-roots`,
`check-vi-mock-specifiers` / `-inherit` / `-override-shape`,
`check-type-check-coverage` (43/43), `check:published-tsconfig-exclude`
and `check:unreferenced-sources`: all OK.
- `node scripts/check-governed-queue-guard.mjs --test` on the five
paths: `NOT GOVERNED`.
- Lint was scoped to the four touched source files, with three pieces of
evidence that the scoping skips nothing. First, `eslint --print-config`
finds the root `eslint.config.js` for each file (117 to 118 rules), so
none is ignored. Second, `--format json` shows 4 files and 0 errors; the
only warnings are the existing `no-explicit-any` ones, and the
specSeries file has one fewer than on base. Third, `eslint.config.js`
has no `parserOptions.project` or `projectService`, so type-aware
linting is off, and no local rule under `eslint-rules/` reads the
filesystem. This diff therefore cannot change the lint result of any
file it does not touch. The full `pnpm lint` runs in CI.
- Doc and README gates: not reached. The diff touches no doc, README or
doc fence, and the charts doc already lists `type` as a per-series key
for either binding.

## Deviations

1. **File surface.** The claim listed `ChartRenderer.tsx` (only the
`dataKey` arm and the docblock), the specSeries test with a pin next to
it, and the changeset. Two edits fall outside that list. Both are prose
that this change would otherwise leave false:
- the component-body comment in `ChartRenderer.tsx` (same file, but not
the docblock);
- the `ObjectChartSchema.series` docblock in
`packages/types/src/objectql.ts` (the "VERBATIM" claim).

The dispatch order says to stop on a breach. The os-dev role file says
published text that the change makes false must be fixed, and that the
role file wins when the two conflict. So both edits are made and listed
here. The claim's file surface needs the seat to add them. If the seat
wants them out, removing those two hunks is enough, and the type change
does not depend on them.
2. **Commit trailer.** Commit `ff726c28c` ends with the harness-supplied
`Co-Authored-By` trailer, which names the model, instead of the
model-free pair. History is not rewritten, because force-push is banned
here.

## Acceptance notes

- `ChartRendererProps` is not re-exported by name from the
`@object-ui/plugin-charts` entry. Consumers reach it as the props type
of the exported `ChartRenderer`. In the published 17.6.0 dist it is
declared in `dist/ChartRenderer.d.ts` and used by the registry map type
in `dist/index.d.ts`, and its `dataKey` arm has no `type`. The runtime
half, objectui#7681, is still a pending changeset, so the declaration
and the behaviour ship in the same release.
- `ObjectChartSchema.series` in `@object-ui/types` (the TS interface and
its zod mirror) is a copy of the internal arm and does not have `type`.
Whether that published copy should follow is a separate Clause-②
decision that this PR does not take. Carrier: none.
- A comment in `widget-schema-anchors-7946.test.ts` says `series`'
element type "is" the internal arm. Its assertion only pins `dataKey:
string`, which still holds. The comment is test-only and not published,
so it is left unchanged.
- The `series` union has no literal discriminant, so object literals get
union-wide excess-property checks, and a `{ name, chartType }` literal
type-checks against the union. This PR leaves that as it is, because the
ruling allows no other arm change.

---
_Generated by [Claude
Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants