Status: In flight (initiative active). 2026-07-21.
Context
Across PaidHR, table columns are currently hardcoded per page in the frontend — every list/report screen carries its own bespoke column definitions, rendering, filtering, and pagination code. Reports, being the most table-heavy surface, feel this most: 26 report endpoints, a custom builder, dozens of pre-built reports, each needing table plumbing.
Decision / direction
The server-driven-tables initiative defines one JSON envelope — { schema, rows, totals, pagination } — where the backend describes columns (incl. grouped headers), cell types, badge/status colors, actions, totals, and per-user customization, so the frontend renders any table with no page-specific code. Reporting is its flagship consumer:
- Report endpoints already emit the
Paginator<T> envelope (Shared/Helpers/Paginator.cs — docs/totalDocs/nextPage), the seed the full format extends.
- The custom report builder is the initiative's "custom table builder" — its saved templates map to the initiative's per-user saved views.
- The frontend render engine to reuse is
EnhancedReportTable.tsx (grouped headers, freeze, show/hide, resize, virtualization); the fetch seam is useBackendTableQuery.ts.
- First target surface named in the initiative: the payroll-details report.
Consequences
Good:
- One render engine for every table/report — no per-page column code; consistency in sorting, pagination, status pills, actions.
- Reporting's needs (grouped headers, totals, wide columns, saved views) directly shape the shared format, so it fits reporting well.
- New reports become backend-only — define the schema+rows, get a full table for free.
Bad / costs:
- Migration overhead. Existing hardcoded report tables must move to the format; until then, two patterns coexist.
- Coupling. Reporting and the generic table format co-evolve — a change to the envelope affects every report.
- The format must be expressive enough for reporting's edge cases (grouped headers, per-cell overrides, totals) without becoming unwieldy for simple lists — a live design tension (the initiative chose a hybrid cell model: raw scalars + optional cell-object overrides).
Guidance
- New report/table work should target the server-driven format, not add bespoke column code. (onboarding)