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.

plugin-view: Record<ViewType, …> is missing the chart key — chart view has no label or icon #2916

Closed

Description

@os-zhuang

Found by the full type-check sweep in #2911 / #2915. @object-ui/plugin-view had no type-check script, so this was invisible to CI.

The errors

packages/plugin-view/src/ViewSwitcher.tsx(57,7): error TS2741:
  Property 'chart' is missing in type '{ list: string; detail: string; grid: string;
  kanban: string; calendar: string; timeline: string; map: string; gallery: string;
  gantt: string; tree: string; }' but required in type 'Record<ViewType, string>'.

packages/plugin-view/src/ViewSwitcher.tsx(70,7): error TS2741:
  Property 'chart' is missing in type '{ list: ...; ... 7 more ...; tree: ... }'
  but required in type 'Record<ViewType, LucideIcon>'.

Two exhaustive maps keyed by ViewType — one of labels, one of Lucide icons — are each missing the chart entry. chart is a member of ViewType, and plugin-charts is a registered view, so this is a user-visible gap: the chart view renders in the switcher with no label and no icon.

There is also a third, separate error in the same package:

packages/plugin-view/src/ViewTabBar.tsx(234,43): error TS2322:
  Type 'SyntheticListenerMap | undefined' is not assignable to
  type 'Record<string, (...args: any[]) => void> | undefined'.

(dnd-kit listener type, unrelated to the chart gap.)

Why it needs a decision, not just a compile fix

Silencing the type error is one line, but picking the label and icon is a product call — what the chart view is called in each locale, and which Lucide glyph represents it. Worth confirming against whatever plugin-charts already shows elsewhere so the switcher does not disagree with the rest of the UI.

Reproducing

plugin-view has no type-check script yet, so add the paths override its type-checked peers carry, then:

cd packages/plugin-view && ../../node_modules/.bin/tsc --noEmit

Without the paths override you also get ~104 TS6059 rootDir errors, which are tsconfig shape rather than source bugs — see #2915 for the mechanism.

Closing this out

@object-ui/plugin-view is listed in DEBT in scripts/check-type-check-coverage.mjs with errors: 3. When these are fixed, add "type-check": "tsc --noEmit" and delete the DEBT entry — the guard fails if an entry outlives its gap.

Refs #2911, #2915

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