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

Analytics: the dataset widget's client-side dimension-label resolution is disabled for table / pivot / metric widgets, so a dotted dimension there still renders raw stored values #4263

Closed

Description

@yinlianghui

Found while implementing objectui#4053 (PR #4261). Filed rather than fixed there: the fix belongs to a different resolution owner and would change behaviour for every table widget, which is outside that card's scope.

What #4053 fixed, and where it stops

objectui#4053 fixed the client-side label safety net in DatasetWidget so a dotted dimension path (crm_account.industry) resolves its select options against the relationship's target object instead of the dataset's base object.

That safety net does not run for every widget type. packages/plugin-dashboard/src/DatasetWidget.tsx:

useEffect(() => {
  if (isMetric || isTable) { setCategoryColors(null); setDimensionLabels(null); setCategoryOrder(null); return; }

with isTable = widgetType === 'table' || widgetType === 'pivot'. The relabeling it feeds is applied only on the chart branch (const chartRows = relabelDimensions(state.rows, dimensionLabels)); the table/pivot branch renders state.rows as they arrived.

Why that leaves a gap

For a local dimension this is fine — the server resolves dimension display labels (ADR-0021), which is exactly why issue #4053's widget B (a table) rendered Education / Finance correctly. The client net is only a fallback for the case the server cannot resolve.

For a dotted dimension the server does not resolve the label either — that is the premise of #4053. So on a table or pivot dataset widget, a dotted dimension has neither resolution available and still renders the raw stored enum (education, finance), the same symptom #4053 reports for charts. #4053's fix does not reach it, because the effect returns before the lookup runs.

Not the same as the chart fix

Extending the net to tables is not "apply the resolution the local path uses" — for tables the local path's resolution is the server's, not this client-side one. Turning the client net on for table/pivot would add a resolution those widgets have never had, affecting every table dataset widget, not only dotted ones. That is a deliberate design call rather than a mechanical extension, which is why it is filed here instead of being ridden into PR #4261.

Suggested direction (for triage, not a decision)

Two shapes worth weighing:

  1. Run the existing client-side net for table/pivot as well, limited to dimensions whose resolution the server demonstrably skipped. Keeps one resolver; needs a rule for "demonstrably skipped" that does not double-translate an already-resolved label. Note relabelDimensions is documented as idempotent and value-keyed, which may make this cheaper than it looks.
  2. Resolve it at the producer instead — have the analytics layer resolve dotted-path dimension labels server-side, which would fix charts, tables and pivots at once and let the client net go back to being a pure fallback. This is the contract-first shape and likely belongs in the framework repo.

Option 2 also subsumes the chart-side workaround over time.

Related

Activity

  1. self-assigned this
    on Aug 11, 2026
  2. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    ContributorAuthor

    CLAIM + delegated direction ruling (objectui whole-repo seat PM, session session_017Qqyix2QcnpUC9XeYVDzx3; veto window open) — dispatching now.

    Ruling: dotted-only gap-fill. The isMetric || isTable early-return stays for LOCAL dimensions (the server resolves those there — adding the client net for them would double-resolve and change widgets that work today); it opens ONLY for dimensions the server is silent on — the dotted ones — reusing #4261's resolveDimensionFieldOptions unchanged. The acceptance boundary: a local dimension on a table renders byte-identically to today (server's labels, pinned); a dotted dimension on a table/pivot/metric renders resolved labels (the gap, red-first); the non-dataset widget paths untouched.


    Generated by Claude Code

  3. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    ContributorAuthor

    ACCEPT — PM review of record (session session_017Qqyix2QcnpUC9XeYVDzx3).

    PR #4273 fills exactly the gap the dotted-only ruling scoped: the label net's early return now opens for DOTTED dimension paths on table/pivot, reusing #4261's resolveDimensionFieldOptions unchanged, with one relabelDimensions at the top of the table branch feeding all four consumers (flat body, buildPivot input, CSV, marginal totals).

    Points verified in review:

    • Local stays byte-identical, proven two ways: a same-render local+dotted fixture (an "open the net for everything" implementation fails it — a dotted-only fixture couldn't detect that) and an array-identity pin on the local-only path with an asserted-empty metadata request list. That is the strongest form of the ruling's "local untouched" requirement.
    • Pivot totals trap measured, not assumed: header labels and the totals lookup derive from the same row values on different code paths; relabeling one side would have shown Education headers over — cells. Both sides take the relabel, pinned with server totals.
    • Metric ruled a measured non-gap: the metric branch renders no dimension value in any spelling, so there is nothing to resolve — it keeps its early return, pinned. The card's presumed dotted-on-metric criterion was vacuous; showing dimension context on a KPI would be new rendering and needs its own card if ever wanted.
    • Lane discipline vs objectui: pivot bucket id 把 null 维度值编码成占位符 U+2205,与「值恰好等于该占位符」的行仍会撞 #4056 held: buildPivot's bucket-id region untouched — only the argument at the call site changed; worst case is a one-line rebase whichever lands second.
    • Red-first (4 red / 2 green controls before the fix), reverse verification exact-match, drill-through index alignment preserved, CI converged: 18 success / 2 skipped / 0 failures.

    Flipping ready + auto-merge.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions