fix(ui): migrate the timesheet grid onto the shared Table kit #483

Merged
nrupard merged 2 commits from fix/MAPPS-415-timesheet-grid into main 2026-08-05 20:23:18 +02:00
Owner

Implements MAPPS-415 (durable follow-up to MAPPS-407 F12): the last raw <table>, the weekly timesheet grid, now uses the shared Table kit. To make the shared components express the grid's needs, three additive extensions were added (all defaults preserve every existing table's current rendering):

Shared Table extensions (components/table.rs)

  • TableAlign enum (Left default / Center / Right). TableHeader gains an align prop that drives both the cell text-align and the inner flex justify-* (the header wraps its label in a flex row, so centering needs justification, not just text-align) - this fixes the "numeric column header is left-packed even with text-right" limitation the audit noted.
  • TableHeader and TableCell gain a compact: bool (default false) for px-4 py-3 instead of px-6 py-4, so narrow fixed-width columns (the w-20 day columns) are not over-padded.
  • TableCell gains colspan: Option<usize> for the full-width loading/error/empty state rows.

Timesheet grid migration (time.rs TimesheetsPage)

The raw div.overflow-x-auto > table > thead/tbody > th/td is replaced with Table/TableHead/TableRow/TableHeader/TableBody/TableCell. The shared Table already renders the identical wrapper (overflow-x-auto, min-w-full divide-y divide-line, bg-surface-2 head, bg-surface divide-y body), so the frame is byte-identical. Day headers/cells use align: Center, compact: true, class: "w-20"; the state rows use colspan: Some(9); the "Daily Total" footer is a TableRow { class: "bg-surface-2 font-medium" } (TableRow already carries a class prop). The state/footer/work-item cells pick up the shared py-4 (from py-8/py-3), a small cosmetic normalization; the critical layout (w-20 centered day columns, colspan state rows, footer tint) is preserved.

Verification

Diff-reviewed (no local cargo): no raw <table>/th/td remains in time.rs; TableEmptyRow is still used (no orphaned import); the colspan/align/compact props are additive with behavior-preserving defaults; Some(9) for the Option<usize> colspan matches the compiled title/aria_label Option-prop precedent. No em-dash. CI runs fmt/clippy(-D warnings)/wasm-build/tests.

#MAPPS-415

Implements MAPPS-415 (durable follow-up to MAPPS-407 F12): the last raw `<table>`, the weekly timesheet grid, now uses the shared Table kit. To make the shared components express the grid's needs, three additive extensions were added (all defaults preserve every existing table's current rendering): ## Shared Table extensions (`components/table.rs`) - `TableAlign` enum (Left default / Center / Right). `TableHeader` gains an `align` prop that drives both the cell `text-align` and the inner flex `justify-*` (the header wraps its label in a flex row, so centering needs justification, not just text-align) - this fixes the "numeric column header is left-packed even with text-right" limitation the audit noted. - `TableHeader` and `TableCell` gain a `compact: bool` (default false) for `px-4 py-3` instead of `px-6 py-4`, so narrow fixed-width columns (the `w-20` day columns) are not over-padded. - `TableCell` gains `colspan: Option<usize>` for the full-width loading/error/empty state rows. ## Timesheet grid migration (`time.rs` `TimesheetsPage`) The raw `div.overflow-x-auto > table > thead/tbody > th/td` is replaced with `Table`/`TableHead`/`TableRow`/`TableHeader`/`TableBody`/`TableCell`. The shared `Table` already renders the identical wrapper (`overflow-x-auto`, `min-w-full divide-y divide-line`, `bg-surface-2` head, `bg-surface divide-y` body), so the frame is byte-identical. Day headers/cells use `align: Center, compact: true, class: "w-20"`; the state rows use `colspan: Some(9)`; the "Daily Total" footer is a `TableRow { class: "bg-surface-2 font-medium" }` (TableRow already carries a `class` prop). The state/footer/work-item cells pick up the shared `py-4` (from `py-8`/`py-3`), a small cosmetic normalization; the critical layout (w-20 centered day columns, colspan state rows, footer tint) is preserved. ## Verification Diff-reviewed (no local cargo): no raw `<table>`/`th`/`td` remains in time.rs; `TableEmptyRow` is still used (no orphaned import); the `colspan`/`align`/`compact` props are additive with behavior-preserving defaults; `Some(9)` for the `Option<usize>` colspan matches the compiled `title`/`aria_label` Option-prop precedent. No em-dash. CI runs fmt/clippy(-D warnings)/wasm-build/tests. #MAPPS-415
fix(ui): migrate the timesheet grid onto the shared Table kit
Some checks failed
Check / fmt + clippy + tests (pull_request) Failing after 11s
6d9e5d0006
Implements MAPPS-415 (durable follow-up to MAPPS-407 F12). Extends the shared Table with a TableAlign enum + align/compact props on TableHeader (align drives text-align and the inner flex justify), a compact prop on TableCell, and a colspan prop on TableCell for full-width state rows. Migrates the weekly timesheet grid in TimesheetsPage off its raw table/thead/tbody/th/td onto Table/TableHead/TableRow/TableHeader/TableBody/TableCell, with the Daily Total footer as a TableRow{class}. The shared Table renders the identical frame, so the only change is a small cosmetic padding normalization on the state/footer cells; the w-20 centered day columns, colspan state rows, and footer tint are preserved. All extensions are additive with behavior-preserving defaults, so existing tables are unaffected.

#MAPPS-415
style(ui): block-form the compact padding let-if in table
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m34s
Create release / Create release from merged PR (pull_request) Has been skipped
47bc1f0800
rustfmt expands let-bindings of an if/else expression to block form (matching the existing TableRow/TableHeader style); apply it to the two new `let pad = if props.compact {...}` bindings.

#MAPPS-415
nrupard deleted branch fix/MAPPS-415-timesheet-grid 2026-08-05 20:23:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!483
No description provided.