Phase 5: Integration
Objective
Section titled “Objective”Swap vendored grid components for canary equivalents in the canary-refactor stories, update barrel exports, remove placeholders, and validate with VRT.
Corresponds to General Workflow steps 5-8.
Entry Criteria
Section titled “Entry Criteria”Phase 4 must be complete. Verify by checking artifacts — do NOT re-run tests.
Verify before starting:
- Tier 3a factory present:
ls src/components/canary/organisms/shared/entity-data-grid/showscreate-entity-data-grid.tsx,use-dirty-tracking.ts,index.ts, test and story files - Tier 3b shim present:
ls src/components/canary/organisms/shared/entity-data-grid-shim/showscreate-entity-data-grid-shim.tsx,index.ts, test and story files - ActionCellRenderer present:
ls src/components/canary/atoms/grid/action/showsaction-cell-renderer.tsx - Factory exports compile:
grep 'createEntityDataGrid' src/components/canary/organisms/shared/entity-data-grid/index.tsconfirms the export - Shim exports compile:
grep 'createEntityDataGridShim' src/components/canary/organisms/shared/entity-data-grid-shim/index.tsconfirms the export - Canary-refactor stories still exist (from Phase 0):
ls src/canary-refactor/reference/items/shows both story files - Phase 4 exit gate passed: check for
npm run lint+npm run testsuccess in the Phase 4 terminal output (do not re-run)
T5.1 — Fork Column Definitions
Section titled “T5.1 — Fork Column Definitions”Fork vendored/arda-frontend/components/table/columnPresets.tsx into canary-refactor/components/columnPresets.tsx.
Update the forked file per the Column Definition Migration Map:
- Replace with canary atoms (~15 columns): SKU, GL Code, Sub-location, Sub-Type, Use Case, Department, Facility, Supplier SKU →
TextCellDisplay. Min Qty Amount, Order Amount →NumberCellDisplay. Taxable →BooleanCellDisplay. Order Method, Card Size, Label Size, Breadcrumb Size →EnumCellDisplay/EnumCellEditor. - Replace with new canary types (~3 columns): Notes, Card Notes →
MemoButtonCell+createMemoButtonCellEditor()(vendored-compatible icon + modal pattern). Color →ColorCellDisplay/ColorCellEditor. - Hybrid (~1 column): Supplier → canary
TextCellDisplayfor display, vendoredSupplierCellEditorfor editing. - Retain vendored (~10 columns): Item name, Image, Unit Price, Order Cost, Created, Lead Time, Classification, Location, Quick Actions, Card Count.
- Remove: Select column (replaced by AG Grid native
rowSelectioninDataGrid<T>).
T5.2 — Fork ItemTableAGGrid
Section titled “T5.2 — Fork ItemTableAGGrid”Fork vendored/arda-frontend/app/items/ItemTableAGGrid.tsx into canary-refactor/components/ItemTableAGGrid.tsx.
- Replace
ArdaGridimport with canarycreateEntityDataGridShim<T>()(orDataGrid<T>directly if the shim isn’t needed for this context) - Replace
itemsColumnDefs/itemsDefaultColDefimports with the forked column definitions from T5.1 - Retain vendored imports for: all 9 typeahead cell editors,
useItemCardscontext, API calls (createDraftItem,updateItem), constants (orderMethodOptions, etc.) - Retain domain-specific draft lifecycle logic (this is the hybrid approach per Completeness #8)
T5.3 — Fork ItemsPage
Section titled “T5.3 — Fork ItemsPage”Fork vendored/arda-frontend/app/items/page.tsx into canary-refactor/components/ItemsPage.tsx.
- Replace
ItemTableAGGridimport with the forked version from T5.2 - Retain ALL other vendored imports:
AppSidebar,AppHeader,SidebarProvider,ItemFormPanel,ItemDetailsPanel,CardsPreviewModal,ImportItemsModal,DeleteConfirmationModal, UI components, API calls, context hooks - This is the page-level integration point
T5.4 — Fork ItemDetailPage
Section titled “T5.4 — Fork ItemDetailPage”Fork vendored/arda-frontend/app/item/[itemId]/page.tsx into canary-refactor/components/ItemDetailPage.tsx.
- Replace
ItemsPageimport with the forked version from T5.3 - This is a thin wrapper — minimal changes
T5.5 — Update Canary-Refactor Stories
Section titled “T5.5 — Update Canary-Refactor Stories”Update the canary-refactor stories (created in Phase 0) to import the forked page components:
canary-refactor/reference/items/items-grid.stories.tsx— importItemsPagefrom../../components/ItemsPage(forked) instead of@frontend/app/items/pagecanary-refactor/reference/items/item-detail.stories.tsx— importItemDetailPagefrom../../components/ItemDetailPage(forked) instead of@frontend/app/item/[itemId]/page- Update CSS import if needed:
@/styles/vendored/globals.css→ verify if canary styles need separate import
T5.6 — Run Lint, Build, Test (Workflow Step 5)
Section titled “T5.6 — Run Lint, Build, Test (Workflow Step 5)”npm run lint— verify no ESLint errors (canary imports only from canary + vendored via@frontend)npm run build:lib— verify library buildsnpm run test— verify all unit tests pass
T5.7 — Update Barrel Exports (Workflow Step 5, cont.)
Section titled “T5.7 — Update Barrel Exports (Workflow Step 5, cont.)”Per Planning Q3 decision: update barrel at the end, remove placeholders.
Update src/canary.ts:
- Remove
CanaryAtomPlaceholder,CanaryMoleculePlaceholder,CanaryOrganismPlaceholderexports - Remove the placeholder component files themselves (
components/canary/atoms/canary-placeholder/,components/canary/molecules/canary-placeholder/,components/canary/organisms/canary-placeholder/) - Keep
ArdaDetailFieldexport (existing canary component) - Add exports for all new canary components:
- Cell atoms:
TextCellDisplay,TextCellEditor,NumberCellDisplay,NumberCellEditor,BooleanCellDisplay,BooleanCellEditor,DateCellDisplay,DateCellEditor,EnumCellDisplay,EnumCellEditor,MemoCellDisplay,MemoCellEditor,MemoButtonCell,createMemoButtonCellEditor,ColorCellDisplay,ColorCellEditor - Molecule:
DataGrid,DataGridRef, config types,PaginationData - Organisms:
createEntityDataGrid, config/props/ref types,createEntityDataGridShim, shim types,ActionCellRenderer,RowAction - Hooks:
useDirtyTracking
- Cell atoms:
Update src/types/canary.ts:
- Add
PaginationDataexport
T5.8 — VRT Comparison (Workflow Steps 7-8)
Section titled “T5.8 — VRT Comparison (Workflow Steps 7-8)”- Run VRT:
npm run test:vrt - Compare canary-refactor stories against dev-witness stories
- Expected: identical visual output (the canary grid infrastructure is a port, not a redesign)
- If VRT fails: document the differences, report to user for instructions per Workflow step 8
Acceptance Criteria
Section titled “Acceptance Criteria”- Canary-refactor stories render the full Items page using canary grid infrastructure
- No vendored grid imports remain in canary-refactor stories (only vendored page chrome, panels, modals, domain editors retained via
@frontend/paths) - ~15 columns use canary cell atoms, ~3 use new cell types (memo, color), ~10 retain vendored renderers
canary.tsbarrel exports all new components; placeholder components removednpm run lint+npm run build:lib+npm run testpass- VRT comparison against dev-witness passes
Copyright: © Arda Systems 2025-2026, All rights reserved