S3: TableViz gets individual props instead of spread #8

Open
opened 2026-06-05 10:22:07 +00:00 by sebse · 0 comments
Owner

Code Smell

File: web/components/ChartCard/index.tsx:29-32

Inconsistent prop passing:

return <UpsChart {...props} />;       // spread
return <SignalsChart {...props} />;   // spread
<TableViz                               // manual
  config={props.config}
  rows={props.rows}
  onEdit={props.onEdit}
  onDelete={props.onDelete}
/>

TableViz gets individual props while others get spread. Currently works because TableViz doesnt need timeMode/sessions/alerts, but misleading.

Why it matters

If TableViz later needs timeMode or sessions, theres no TypeScript error — it just wont receive them. Inconsistent patterns confuse maintainers.

Suggestion

Spread uniformly: <TableViz {...props} /> and let TableViz ignore unused props.

## Code Smell **File:** `web/components/ChartCard/index.tsx:29-32` Inconsistent prop passing: ```tsx return <UpsChart {...props} />; // spread return <SignalsChart {...props} />; // spread <TableViz // manual config={props.config} rows={props.rows} onEdit={props.onEdit} onDelete={props.onDelete} /> ``` `TableViz` gets individual props while others get spread. Currently works because TableViz doesnt need timeMode/sessions/alerts, but misleading. ### Why it matters If TableViz later needs timeMode or sessions, theres no TypeScript error — it just wont receive them. Inconsistent patterns confuse maintainers. ### Suggestion Spread uniformly: `<TableViz {...props} />` and let TableViz ignore unused props.
sebse added the code-smell label 2026-06-05 10:22:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sebse/factorio-signal-exporter#8