fix(ui): migrate the timesheet grid onto the shared Table kit #483
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-415-timesheet-grid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)TableAlignenum (Left default / Center / Right).TableHeadergains analignprop that drives both the celltext-alignand the inner flexjustify-*(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.TableHeaderandTableCellgain acompact: bool(default false) forpx-4 py-3instead ofpx-6 py-4, so narrow fixed-width columns (thew-20day columns) are not over-padded.TableCellgainscolspan: Option<usize>for the full-width loading/error/empty state rows.Timesheet grid migration (
time.rsTimesheetsPage)The raw
div.overflow-x-auto > table > thead/tbody > th/tdis replaced withTable/TableHead/TableRow/TableHeader/TableBody/TableCell. The sharedTablealready renders the identical wrapper (overflow-x-auto,min-w-full divide-y divide-line,bg-surface-2head,bg-surface divide-ybody), so the frame is byte-identical. Day headers/cells usealign: Center, compact: true, class: "w-20"; the state rows usecolspan: Some(9); the "Daily Total" footer is aTableRow { class: "bg-surface-2 font-medium" }(TableRow already carries aclassprop). The state/footer/work-item cells pick up the sharedpy-4(frompy-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/tdremains in time.rs;TableEmptyRowis still used (no orphaned import); thecolspan/align/compactprops are additive with behavior-preserving defaults;Some(9)for theOption<usize>colspan matches the compiledtitle/aria_labelOption-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). 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-415rustfmt 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