Skip to content

Tier 1 (#2901): spec values that render silently WRONG output #2941

Description

@os-zhuang

From the #2901 audit (doc). These are the worst class found, and a class the bug that started this (#2897) did not belong to.

A blank cell is detectable — someone eventually asks why it's empty. A plausible wrong number is not. Every row here produces output that looks correct and isn't.

Finding Location What happens
Pivot aggregation falls back to sum plugin-dashboard/src/PivotTable.tsx:114 count_distinct, array_agg, string_agg each return a sum. Wrong total, no signal.
Report chart falls back to bar plugin-report/src/DatasetReportRenderer.tsx:370 10 of 19 ChartTypeSchema values silently draw a bar chart.
selection.type: 'single' renders multi-select plugin-grid/src/ObjectGrid.tsx:1610components/src/renderers/complex/data-table.tsx:1284 selectable is treated as a bare truthy. Per-row checkboxes and select-all; single is never distinguished from multiple.
Filter type: 'select' renders multi-check plugin-list/src/UserFilters.tsx:227 A single-choice filter accepts many values.
addRecord.position: 'both' collapses to top plugin-list/src/ListView.tsx:389 (position === 'bottom' ? 'bottom' : 'top') — the bottom button never renders.
tabular vs summary resolved from data, not type plugin-report/src/DatasetReportRenderer.tsx:779 Identical branch; the difference is read from whether report.rows is non-empty. A tabular report that declares rows renders grouped.

Needs a semantic decision first

  • selection.type: 'single' — radio-style single selection, or "cap the selection at 1"? The renderer does neither today.
  • filter type: 'select' vs 'multi-select' — same question.

Both are Direction-A gaps only if we decide the spec meant something the renderer doesn't do. Worth answering before implementing.

Guard

Each fix should land with a parity test on the pair, per plugin-grid/src/__tests__/summary-spec-parity.test.ts. Note plugin-list, plugin-charts, plugin-dashboard, plugin-report and components lack the @objectstack/spec devDependency and need it added first.

Refs #2901

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions