Skip to content

finding(plugin-charts/core/types): series variant carries three different unions across its declarations and readers — current is an undocumented synonym of primary that core's seriesPresentation drops #7682

Description

@os-sam

Found while measuring per-key liveness for #7546 (branch claude/issue-7546-chart-series-silent-strip); out of that card's scope — its ruling fences the change to ChartDataSeriesSchema and its readers, and this is a drift across readers, not a strip. Filed unassigned as an observation for triage. Not fixed in that PR (which declares variant as the three values the normalizer honours, and says so in its docblock).

The drift, measured against origin/main a472b07

site union for variant
@objectstack/spec ChartSeriesSchema.variant (ui/chart.zod.ts:270) primary / comparison, default primary
plugin-charts/src/normalizeChartSchema.ts:246-247 (normalizeSeries) comparison / current / primary
core/src/utils/chart-presentation.ts:129 (seriesPresentation, dataset path) primary / comparisoncurrent is dropped
plugin-charts/src/ChartRenderer.tsx:65 (internal dataKey arm prop type) current / comparison — no primary
plugin-charts/src/ChartRenderer.tsx:66 (spec name arm prop type) current / comparison / primary
plugin-charts/src/AdvancedChartImpl.tsx:2010, 2012, 2033 (the consumer) only === 'comparison' is ever tested

Producers of current: plugin-charts/src/ObjectChart.tsx:852 (variant: s.variant || 'current') and plugin-dashboard/src/DatasetWidget.tsx:1450 (variant: s.variant ?? 'current'). Neither the spec nor any document teaches current.

Effect today

None visible: the only downstream distinction is comparison vs not-comparison, so current, primary and absent all draw the same. On the dataset path, seriesPresentation silently drops an authored variant: 'current' — harmless now, for the same reason. The finding is the drift itself: four declarations of one enum with three different member sets, and one spelling produced in two places that the contract of record does not know.

Possible dispositions (triage's call)

  • Retire current under ADR-0049 — rewrite the two producers to primary (or to omit it), narrow normalizeSeries and the prop arms to the spec's pair, and narrow the objectui#7546 declaration with it (its docblock already names this as the one place it is wider than the spec).
  • Or declare current on the spec as a synonym and align the other three sites to the widened union.

Related: objectui#7546, objectui#7495 (the comparison-series exclusion list drift on the dashboard side).

Filed by the objectui#7546 dev seat, Claude Code session session_01KbJQ1y1J12nZxYzFWhP8Q3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpm:queuepriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions