feat(phase-5): migrate .table-wrap to Astryx Table (theme-preserving)
Phase 5 of the 13-phase Astryx migration. Every <div className="table-wrap"><table>...</table></div> in the codebase is now an Astryx <Table> (children mode) with the Amazon platform look preserved via the Phase 1 theme bridge.
| Old | New |
|---|---|
<div className="table-wrap"><table>...</table></div> |
<Table>...</Table> (children mode keeps raw <thead>/<tbody>/<tr>/<th>/<td> JSX intact) |
The existing tables carry a lot of inline content (raw <input> for bid edits, Astryx <Button> for actions, pills, formatted text). The data-driven API would force every row's renderCell to be a closure over local state, which is a much bigger refactor with no functional gain for the look-and-feel migration. Children mode keeps the same DOM output but emits the stable .astryx-table and .astryx-table-scroll-wrapper classes that we can theme through the bridge.
src/app/astryx-theme.css gains a .astryx-table-scroll-wrapper block that gives the new wrapper the same card-in-table look the old .table-wrap had: overflow-x: auto, --radius-lg corner, soft border, surface background, plus a --radius-md override at 900px for mobile. The existing global th/td/tr:hover/.mono/.money rules in globals.css already style the cells (sticky header, padding, hover rows, tabular-nums) and apply unchanged to the <th>/<td> inside the Astryx Table.
The legacy .table-wrap rule is removed (the bridge now provides the equivalent styling under the new class name). The @media (max-width: 900px) responsive override is updated to target .astryx-table-scroll-wrapper.
- All
<th>/<td>elements continue to render with theirhtmlFor/idwiring where applicable. - Inline
<TextInput>/<NumberInput>/<Selector>inside table cells (Phases 4 inputs) remain functional and labelled. - The scroll wrapper exposes
role="group"andaria-label="@astryx.table.label"from Astryx (the default label is fine for plain data tables; it can be overridden per-table later if needed).
.astryx-tableis rendered inside.astryx-table-scroll-wrapper- No leftover
.table-wrapclass in DOM - No leftover
.table-wraprule in globals.css .astryx-table-scroll-wrapperhasoverflow-x: autovia bridge CSS.astryx-table-scroll-wrapperhas border + radius<th>elements exist and are non-empty<th>sticky positioning is still defined<th>uppercase + letter-spacing still defined.monotabular-nums still definedtr:hover tdbackground rule still definedtdpadding rule still definedtr:last-child tdno-border rule still defined
tables.test.tsx (Phase 0) deleted — the pre-migration .table-wrap contract is obsolete.
src/components/AdConsole/__tests__/contracts/tables-astryx.test.tsx(NEW) — 12 contract testssrc/components/AdConsole/Dashboard.tsx— 1 tablesrc/components/AdConsole/PortfolioOverview.tsx— 1 tablesrc/components/AdConsole/details/AdGroupsTab.tsx— 2 tablessrc/components/AdConsole/details/BudgetRulesTab.tsx— 1 tablesrc/components/AdConsole/details/ManagerAdGroupsTab.tsx— 1 tablesrc/components/AdConsole/details/ManagerCampaignsTab.tsx— 1 tablesrc/components/AdConsole/details/ManagerNegativesTab.tsx— 1 tablesrc/components/AdConsole/details/ManagerSearchTermsTab.tsx— 1 tablesrc/components/AdConsole/details/ManagerTargetsTab.tsx— 1 tablesrc/components/AdConsole/details/NegativesTab.tsx— 1 tablesrc/components/AdConsole/details/OverviewTab.tsx— 1 tablesrc/components/AdConsole/details/SearchTermsTab.tsx— 1 tablesrc/components/AdConsole/details/TargetsTab.tsx— 1 tablesrc/components/AdConsole/features/bulk/BulkOpsPage.tsx— 1 tablesrc/components/AdConsole/features/drills/DrillsPage.tsx— 1 tablesrc/components/AdConsole/features/reports/ReportsPage.tsx— 1 tablesrc/components/AdConsole/features/trainer/TrainerPage.tsx— 1 tablesrc/components/AdConsole/wizard/steps/sb/Step3ProductsCreative.tsx— 1 tablesrc/app/astryx-theme.css— added.astryx-table-scroll-wrapperbridge blocksrc/app/globals.css— removed.table-wraprule, updated@mediaoverridesrc/components/AdConsole/__tests__/contracts/tables.test.tsx(DELETED)docs/ASTRYX-MIGRATION-PLAN.md— status bumped to "Phases 0-5 merged"scripts/migrate_tables.py(NEW) — one-shot migration script
- 618 passing (was 615: +12 new tables-astryx tests, -9 from deleted
tables.test.tsx) - 0 TS errors
npm run buildsucceeds — 9 routes prerender cleanly
docs/ASTRYX-MIGRATION-PLAN.md Phase 5 of 13. Next: Phase 6 — Tabs (TabList).