Skip to content

Run 3: Organism Port

Move callil organisms and their supporting molecules into the main clone with import rewrites only (no behavioral changes). Validates that the foundation from Runs 1-2 supports the organisms correctly.

Working directory: /Users/jmp/code/arda/ux-prototype/ (main clone, branch jmpicnic/component-consolidation) Reference directory: /Users/jmp/code/arda/callil-consolidation-worktree/ (read-only, branch jmpicnic/callil-consolidation)

#CriterionVerification CommandExpected Output
1Run 2 exit gate passedbash validate-exit.sh (Run 2)ALL CHECKS PASSED
2Branch jmpicnic/component-consolidation is checked outgit -C /Users/jmp/code/arda/ux-prototype branch --show-currentjmpicnic/component-consolidation
3Working tree is cleangit -C /Users/jmp/code/arda/ux-prototype status --porcelain(empty)
4DataGrid molecule uses themeQuartz (Run 2 deliverable)grep -l 'themeQuartz' /Users/jmp/code/arda/ux-prototype/src/components/canary/molecules/data-grid/data-grid.tsxFile listed
5Primitives directory exists (Run 1 deliverable)test -d /Users/jmp/code/arda/ux-prototype/src/components/canary/primitives && echo EXISTSEXISTS
6Worktree is available and readabletest -f /Users/jmp/code/arda/callil-consolidation-worktree/src/components/canary/organisms/sidebar/sidebar.tsx && echo EXISTSEXISTS
ArtifactPath (relative to ux-prototype/src/)FormatDescription
Sidebar moleculescomponents/canary/molecules/sidebar/TSX + stories + tests5 sub-components: sidebar-header, sidebar-nav, sidebar-nav-item, sidebar-nav-group, sidebar-user-menu
Item-grid moleculescomponents/canary/molecules/item-grid/TSX + storiesColumns, fixtures, typeahead-cell-editor, select-cell-editor, drag-header
Item-details moleculescomponents/canary/molecules/item-details/TSX + stories + testsitem-details-header, item-details-card-preview
Action-toolbar moleculecomponents/canary/molecules/action-toolbar/TSX + stories + testsAction toolbar with overflow dropdown
Field-list moleculecomponents/canary/molecules/field-list/TSX + stories + testsField list display component
Overflow-toolbar moleculecomponents/canary/molecules/overflow-toolbar/TSX + storiesResponsive toolbar with overflow menu
Sidebar organismcomponents/canary/organisms/sidebar/TSX + stories + tests + MDXArdaSidebar with context, provider, rail
App-header organismcomponents/canary/organisms/app-header/TSX + stories + tests + MDXArdaAppHeader with search and actions
Item-details organismcomponents/canary/organisms/item-details/TSX + stories + testsArdaItemDetails drawer with tabs
Item-grid organismcomponents/canary/organisms/item-grid/TSX + stories + tests + MDXItemGrid with editing, search, pagination
Assets../public/canary/images/, ../public/canary/ilustrationsColors/SVG, JPG, PNGBrand logos, avatars, illustrations referenced by organisms

All files copied from the worktree must have their imports rewritten per these rules:

Original importTarget importAffected files
@/components/ui/sidebar@/components/canary/primitives/sidebarorganism/sidebar, mol/sidebar-header, mol/sidebar-nav, mol/sidebar-nav-item, mol/sidebar-nav-group, mol/sidebar-user-menu
@/components/ui/dropdown-menu@/components/canary/primitives/dropdown-menumol/sidebar-user-menu, mol/sidebar-header, mol/item-details-header, mol/action-toolbar, mol/overflow-toolbar
@/components/ui/button@/components/canary/atoms/buttonorganism/app-header, mol/action-toolbar, mol/overflow-toolbar
@/components/ui/separator@/components/canary/primitives/separatororganism/app-header
@/components/ui/input@/components/canary/primitives/inputorganism/item-grid
@/components/ui/tabs@/components/canary/primitives/tabsmol/item-details-header
@/components/ui/collapsible@/components/canary/primitives/collapsiblemol/sidebar-nav-group
@/components/ui/avatar@/components/canary/atoms/avatarmol/sidebar-user-menu
@/utils (cn import)@/types/canary/utilsAny file importing cn from @/utils
@/hooks/use-mobile@/types/canary/hooks/use-mobileAny file importing the use-mobile hook
#TaskPersonaDepends OnStatusAcceptance Criteria
3.1Copy sidebar molecules with import rewritesfront-end-engineerPending5 sidebar molecule files + stories + tests + index.ts in molecules/sidebar/; all @/components/ui/* imports rewritten; npx tsc --noEmit passes
3.2Copy item-grid molecules with import rewritesfront-end-engineerPendingitem-grid-columns, item-grid-fixtures, typeahead-cell-editor, select-cell-editor, drag-header, stories in molecules/item-grid/; all imports rewritten; npx tsc --noEmit passes
3.3Copy item-details molecules with import rewritesfront-end-engineerPendingitem-details-header, item-details-card-preview + stories + tests + index.ts in molecules/item-details/; all imports rewritten; npx tsc --noEmit passes
3.4Copy action-toolbar and field-list molecules with import rewritesfront-end-engineerPendingaction-toolbar/ and field-list/ directories with all files + index.ts; all imports rewritten; npx tsc --noEmit passes
3.5Copy overflow-toolbar molecule with import rewritesfront-end-engineerPendingoverflow-toolbar.tsx + overflow-toolbar.stories.tsx in molecules/overflow-toolbar/; all imports rewritten; npx tsc --noEmit passes
3.6Copy sidebar organism with import rewritesfront-end-engineer3.1Pendingsidebar.tsx, sidebar-context.tsx, stories, tests, MDX, index.ts in organisms/sidebar/; all imports rewritten; npx tsc --noEmit passes
3.7Copy app-header organism with import rewritesfront-end-engineerPendingapp-header.tsx, stories, tests, MDX, index.ts in organisms/app-header/; all imports rewritten; npx tsc --noEmit passes
3.8Copy item-details organism with import rewritesfront-end-engineer3.3, 3.4Pendingitem-details.tsx, stories, tests, index.ts in organisms/item-details/; all imports rewritten; npx tsc --noEmit passes
3.9Copy item-grid organism with import rewritesfront-end-engineer3.2Pendingitem-grid.tsx, use-item-grid-editing.ts, stories, tests, MDX, index.ts in organisms/item-grid/; all imports rewritten; npx tsc --noEmit passes
3.10Copy assets from worktree public/canary/ to main clonefront-end-engineerPendingAll missing assets copied; diff shows only new files added (arda-logo-*.svg, avatar-placeholder.jpg, etc.); no existing assets overwritten
3.11Full verification gatefront-end-engineer3.1-3.10Pendingnpm run lint + npx tsc --noEmit + npm run test + npm run build-storybook all pass; zero @/components/ui/* references in canary code
3.12Playwright MCP visual verification of all organism storiesfront-end-engineer3.11PendingNavigate to each organism story in Storybook and verify rendering: sidebar (nav items, dark theme, collapse/expand), app-header (action buttons, search input), item-grid (grid renders with data, search filters), item-details (drawer opens, fields display, tabs work)

Source: callil-consolidation-worktree/src/components/canary/molecules/sidebar/ Target: ux-prototype/src/components/canary/molecules/sidebar/

Copy all 16 files (5 components x {.tsx, .stories.tsx, .test.tsx} + index.ts):

  • sidebar-header.tsx, sidebar-header.stories.tsx, sidebar-header.test.tsx
  • sidebar-nav.tsx, sidebar-nav.stories.tsx, sidebar-nav.test.tsx
  • sidebar-nav-item.tsx, sidebar-nav-item.stories.tsx, sidebar-nav-item.test.tsx
  • sidebar-nav-group.tsx, sidebar-nav-group.stories.tsx, sidebar-nav-group.test.tsx
  • sidebar-user-menu.tsx, sidebar-user-menu.stories.tsx, sidebar-user-menu.test.tsx
  • index.ts

Import rewrites per the mapping table:

  • @/components/ui/sidebar -> @/components/canary/primitives/sidebar
  • @/components/ui/collapsible -> @/components/canary/primitives/collapsible
  • @/components/ui/dropdown-menu -> @/components/canary/primitives/dropdown-menu
  • @/components/ui/avatar -> @/components/canary/atoms/avatar
  • @/utils -> @/types/canary/utils

Intermediate gate: npx tsc --noEmit after all sidebar molecules are in place.

Source: callil-consolidation-worktree/src/components/canary/molecules/item-grid/ Target: ux-prototype/src/components/canary/molecules/item-grid/

Copy all 6 files:

  • item-grid-columns.tsx
  • item-grid-fixtures.ts
  • typeahead-cell-editor.tsx
  • select-cell-editor.tsx
  • drag-header.tsx
  • item-grid-molecules.stories.tsx

Import rewrites:

  • @/utils -> @/types/canary/utils
  • Any @/components/ui/* imports per the mapping table

Intermediate gate: npx tsc --noEmit.

Source: callil-consolidation-worktree/src/components/canary/molecules/item-details/ Target: ux-prototype/src/components/canary/molecules/item-details/

Copy all 7 files:

  • item-details-header.tsx, item-details-header.stories.tsx, item-details-header.test.tsx
  • item-details-card-preview.tsx, item-details-card-preview.stories.tsx, item-details-card-preview.test.tsx
  • index.ts

Import rewrites:

  • @/components/ui/tabs -> @/components/canary/primitives/tabs
  • @/components/ui/dropdown-menu -> @/components/canary/primitives/dropdown-menu
  • @/utils -> @/types/canary/utils

Intermediate gate: npx tsc --noEmit.

Task 3.4: Copy Action-Toolbar and Field-List Molecules

Section titled “Task 3.4: Copy Action-Toolbar and Field-List Molecules”

Source: callil-consolidation-worktree/src/components/canary/molecules/action-toolbar/ and field-list/ Target: ux-prototype/src/components/canary/molecules/action-toolbar/ and field-list/

Action-toolbar files (4):

  • action-toolbar.tsx, action-toolbar.stories.tsx, action-toolbar.test.tsx, index.ts

Field-list files (4):

  • field-list.tsx, field-list.stories.tsx, field-list.test.tsx, index.ts

Import rewrites:

  • @/components/ui/button -> @/components/canary/atoms/button
  • @/components/ui/dropdown-menu -> @/components/canary/primitives/dropdown-menu
  • @/utils -> @/types/canary/utils

Intermediate gate: npx tsc --noEmit.

Source: callil-consolidation-worktree/src/components/canary/molecules/overflow-toolbar/ Target: ux-prototype/src/components/canary/molecules/overflow-toolbar/

Copy 2 files:

  • overflow-toolbar.tsx
  • overflow-toolbar.stories.tsx

Import rewrites:

  • @/components/ui/button -> @/components/canary/atoms/button
  • @/components/ui/dropdown-menu -> @/components/canary/primitives/dropdown-menu
  • @/utils -> @/types/canary/utils

Intermediate gate: npx tsc --noEmit.

Source: callil-consolidation-worktree/src/components/canary/organisms/sidebar/ Target: ux-prototype/src/components/canary/organisms/sidebar/

Copy 6 files:

  • sidebar.tsx, sidebar-context.tsx, sidebar.stories.tsx, sidebar.test.tsx, sidebar.mdx, index.ts

Import rewrites:

  • @/components/ui/sidebar -> @/components/canary/primitives/sidebar
  • @/utils -> @/types/canary/utils

Depends on Task 3.1 because the sidebar organism composes sidebar molecules.

Intermediate gate: npx tsc --noEmit + npm run test -- --run organisms/sidebar.

Source: callil-consolidation-worktree/src/components/canary/organisms/app-header/ Target: ux-prototype/src/components/canary/organisms/app-header/

Copy 5 files:

  • app-header.tsx, app-header.stories.tsx, app-header.test.tsx, app-header.mdx, index.ts

Import rewrites:

  • @/components/ui/button -> @/components/canary/atoms/button
  • @/components/ui/separator -> @/components/canary/primitives/separator
  • @/utils -> @/types/canary/utils

Intermediate gate: npx tsc --noEmit + npm run test -- --run organisms/app-header.

Source: callil-consolidation-worktree/src/components/canary/organisms/item-details/ Target: ux-prototype/src/components/canary/organisms/item-details/

Copy 4 files:

  • item-details.tsx, item-details.stories.tsx, item-details.test.tsx, index.ts

Import rewrites:

  • Any @/components/ui/* imports per mapping (item-details.tsx has no direct ui imports per the analysis, but verify)
  • @/utils -> @/types/canary/utils

Depends on Tasks 3.3 and 3.4 because item-details organism composes item-details molecules, field-list, and action-toolbar.

Intermediate gate: npx tsc --noEmit + npm run test -- --run organisms/item-details.

Source: callil-consolidation-worktree/src/components/canary/organisms/item-grid/ Target: ux-prototype/src/components/canary/organisms/item-grid/

Copy 6 files:

  • item-grid.tsx, use-item-grid-editing.ts, item-grid.stories.tsx, item-grid.test.tsx, item-grid.mdx, index.ts

Import rewrites:

  • @/components/ui/input -> @/components/canary/primitives/input
  • @/utils -> @/types/canary/utils

Depends on Task 3.2 because item-grid organism composes item-grid molecules.

Intermediate gate: npx tsc --noEmit + npm run test -- --run organisms/item-grid.

Source: callil-consolidation-worktree/public/canary/ Target: ux-prototype/public/canary/

Assets in the worktree not yet in the main clone (delta):

  • images/arda-logo-default.svg
  • images/arda-logo-inverted.svg
  • images/arda-logo-mono-inverted.svg
  • images/arda-logo-mono.svg
  • images/arda-logo-small-default.svg
  • images/arda-logo-small-inverted.svg
  • images/arda-logo-small-mono-inverted.svg
  • images/arda-logo-small-mono.svg
  • images/avatar-placeholder.jpg

These are referenced by the brand-logo atom and sidebar-header molecule. Copy only files that do not already exist in the main clone (do not overwrite existing assets).

Run all checks in sequence:

  1. npm run lint — pass
  2. npx tsc --noEmit — pass
  3. npm run test — pass (existing + new tests)
  4. npm run build-storybook — pass
  5. Verify no @/components/ui/* references remain in canary code:
    Terminal window
    grep -r '@/components/ui/' src/components/canary/ --include='*.ts' --include='*.tsx' | grep -v node_modules
    Expected: zero matches.

Task 3.12: Playwright MCP Visual Verification

Section titled “Task 3.12: Playwright MCP Visual Verification”

Start Storybook (npm run dev in ux-prototype/) and use Playwright MCP to navigate to each organism’s stories:

  • Sidebar: Default, WithBadges, Composition — check nav items render, dark theme applies, collapse/expand works
  • AppHeader: Default, WithSearch — check action buttons visible, search input functional
  • ItemGrid: Default, WithSearch, Editable — check grid renders with data, search filters rows, editable cells respond
  • ItemDetails: Default — check drawer opens, fields display correctly, tabs work

Screenshot each story for visual record.

3.1 (sidebar molecules) ──────────────────┐
3.2 (item-grid molecules) ────────────────┤
3.3 (item-details molecules) ─────────────┤
3.4 (action-toolbar + field-list) ─────────┤
3.5 (overflow-toolbar) ───────────────────┤
3.7 (app-header organism) ────────────────┤
3.10 (assets) ────────────────────────────┤
3.1 ──→ 3.6 (sidebar organism) ──────────┤
3.3, 3.4 ──→ 3.8 (item-details organism) ┤
3.2 ──→ 3.9 (item-grid organism) ────────┤
└──→ 3.11 (verification gate)
└──→ 3.12 (Playwright MCP)

Tasks 3.1-3.5, 3.7, and 3.10 can run in parallel (no interdependencies). Tasks 3.6, 3.8, 3.9 depend on their respective molecule tasks. Task 3.11 waits for all copy tasks. Task 3.12 waits for the verification gate.

#CriterionVerification CommandExpected Output
1Lint passesnpm run lint (in ux-prototype/)Exit 0
2TypeScript compilesnpx tsc --noEmit (in ux-prototype/)Exit 0
3All tests passnpm run test (in ux-prototype/)Exit 0, all tests pass
4Storybook buildsnpm run build-storybook (in ux-prototype/)Exit 0
5No @/components/ui/* in canary codegrep -r '@/components/ui/' src/components/canary/ --include='*.ts' --include='*.tsx'Zero matches
6Sidebar molecules existtest -f src/components/canary/molecules/sidebar/sidebar-header.tsx && echo EXISTSEXISTS
7Item-grid molecules existtest -f src/components/canary/molecules/item-grid/item-grid-columns.tsx && echo EXISTSEXISTS
8Item-details molecules existtest -f src/components/canary/molecules/item-details/item-details-header.tsx && echo EXISTSEXISTS
9Action-toolbar molecule existstest -f src/components/canary/molecules/action-toolbar/action-toolbar.tsx && echo EXISTSEXISTS
10Field-list molecule existstest -f src/components/canary/molecules/field-list/field-list.tsx && echo EXISTSEXISTS
11Overflow-toolbar molecule existstest -f src/components/canary/molecules/overflow-toolbar/overflow-toolbar.tsx && echo EXISTSEXISTS
12All 4 organisms existls src/components/canary/organisms/{sidebar,app-header,item-details,item-grid}/index.ts | wc -l4
13Brand logo assets copiedtest -f public/canary/images/arda-logo-default.svg && echo EXISTSEXISTS

You are porting callil organisms and molecules from a read-only worktree into the main clone. Your job is mechanical copy + import rewrite. Do NOT change component behavior, APIs, or styling.

Copy direction: ALWAYS from worktree (/Users/jmp/code/arda/callil-consolidation-worktree/) to main clone (/Users/jmp/code/arda/ux-prototype/). The worktree is read-only — never modify it.

Import rewrite rules (apply to EVERY copied file):

  • @/components/ui/sidebar -> @/components/canary/primitives/sidebar
  • @/components/ui/dropdown-menu -> @/components/canary/primitives/dropdown-menu
  • @/components/ui/button -> @/components/canary/atoms/button
  • @/components/ui/separator -> @/components/canary/primitives/separator
  • @/components/ui/input -> @/components/canary/primitives/input
  • @/components/ui/tabs -> @/components/canary/primitives/tabs
  • @/components/ui/collapsible -> @/components/canary/primitives/collapsible
  • @/components/ui/avatar -> @/components/canary/atoms/avatar
  • @/utils (cn import) -> @/types/canary/utils
  • @/hooks/use-mobile -> @/types/canary/hooks/use-mobile

After copying each group, run npx tsc --noEmit as an intermediate gate. Stop and fix any import errors before proceeding.

After all copies are complete, run the full verification gate: npm run lint, npx tsc --noEmit, npm run test, npm run build-storybook.

Verify zero @/components/ui/* references remain in canary code with: grep -r '@/components/ui/' src/components/canary/ --include='*.ts' --include='*.tsx'

At run completion, write the following to implementation/run-3-organism-port/:

ArtifactFileDescription
Run summarysummary.mdWhat was done, decisions made during implementation, deviations from plan
Byproducts logbyproducts.mdDiscovered issues, TODOs, observations for later runs
Validation outputvalidation-output.txtStdout from validate-exit.sh execution
Session logsession-log.mdAgent session IDs, timestamps, notable events

Path: documentation/src/content/docs/roadmap/backlog/requested/callil-consolidation/implementation/run-3-organism-port/

ArtifactSource RunPath/Location
canary/primitives/ directory (13 shadcn files)Run 1src/components/canary/primitives/
Custom atoms (avatar, badge, button, card, dialog, etc.)Run 1src/components/canary/atoms/
cn utility at canonical pathRun 1src/types/canary/utils.ts
use-mobile hook at canonical pathRun 1src/types/canary/hooks/use-mobile.ts
Updated tokens.css and globals.cssRun 1src/styles/
DataGrid molecule with themeQuartzRun 2src/components/canary/molecules/data-grid/
ArtifactConsumer RunPath/Location
Sidebar molecules (5 sub-components)Run 4+, Run 8src/components/canary/molecules/sidebar/
Item-grid molecules (columns, fixtures, editors)Run 4, Run 5, Run 6src/components/canary/molecules/item-grid/
Item-details molecules (header, card-preview)Run 8src/components/canary/molecules/item-details/
Action-toolbar moleculeRun 8src/components/canary/molecules/action-toolbar/
Field-list moleculeRun 8src/components/canary/molecules/field-list/
Overflow-toolbar moleculeRun 8src/components/canary/molecules/overflow-toolbar/
Sidebar organismRun 8src/components/canary/organisms/sidebar/
App-header organismRun 8src/components/canary/organisms/app-header/
Item-details organismRun 8src/components/canary/organisms/item-details/
Item-grid organismRun 4, Run 6src/components/canary/organisms/item-grid/
select-cell-editor.tsx moleculeRun 4 (promoted to atom)src/components/canary/molecules/item-grid/select-cell-editor.tsx
Brand logo assetsRun 8public/canary/images/arda-logo-*.svg