Ir al contenido

Migration Plan — Styles & Components to receive Coveris-e

Migration Plan — Styles & Components to receive Coveris-e

Sección titulada «Migration Plan — Styles & Components to receive Coveris-e»

How -main is made ready to receive Coveris-e (../cotton-coveris-mvp) at the component/style level. Summarized map of Coveris-e’s out-of-component code → the kdx-* component that must exist here. Keep [[components|docs/stack/components.md]] as the live catalog; this file is the forward plan only.

[!info] Verdict Shared-component layer is essentially covered. All 33 reusable Coveris-e selectors already exist in -main (base 30 + imported staffing + scheduling chrome). cv-tag/emp-tag are deliberately superseded by #kdx-tag (variant="requirement" / variant="category"). The real gaps are 3 feature subtrees -main does not have + the org-chart manager pair — listed in §1.

Status legend: ✅ already in -main · 🔄 building now (Wave 4) · ⏳ must be created to receive Coveris-e.

1. ⏳ Components to CREATE (inferred from Coveris-e code blocks)

Sección titulada «1. ⏳ Components to CREATE (inferred from Coveris-e code blocks)»

1A — Scheduling subtree (features/scheduling/** — absent from -main)

Sección titulada «1A — Scheduling subtree (features/scheduling/** — absent from -main)»
CreateInferred from (Coveris-e)Why a component
#kdx-month-covering-cardscheduling/components/month-covering-card.component.ts (whole, ~1–408)Monthly grid mini-card (source stripe, avatar/dot reps, SWAP/conflict flags, draggable); sibling of #kdx-assigned-worker-card. Lift verbatim.
#kdx-scheduling-month-gridscheduling/components/scheduling-month-grid.component.ts (~115–2007)The month-grid shell (sticky puesto col, ISO bands, day headers, drag-drop cells). Cohesive black-box container.
#kdx-slot-taggrid tpl ~L733–737 / 916–919 + styles ~L496–506M/T/N shift badge (colored square). Pure atom, reused in grid + cell-drawer. Tokenize its hex (§2).
#kdx-schedule-chipgrid tpl ~L757–783 + styles ~L306–392Inline horario chip (HH:MM–HH:MM) + + horario add-button + rotation toggle (ADR-030/032).
#kdx-time-range-popovergrid styles ~L399–484 + handlersFixed time-range editor (two time inputs, validate, save/clear). Isolate for testability.
#kdx-scheduling-cell-drawerscheduling/components/scheduling-cell-drawer.component.ts (whole, ~1–859)Per-cell drawer (gap actions, ranked candidates, swap/absence undo, exception editor); sibling of node-detail-drawer.
#kdx-candidate-rowcell-drawer ~L334–365 / 393–406Candidate/assigned row (avatar + name + reason/score + action). Reconcile with -main’s candidate-assign-panel into one atom.

1B — Org-chart manager / jefatura (org-chart/components, Coveris-e-only)

Sección titulada «1B — Org-chart manager / jefatura (org-chart/components, Coveris-e-only)»
CreateInferred from (Coveris-e)Why a component
#kdx-manager-badgeorg-chart/components/manager-badge.component.ts (whole, ~1–100)Jefatura slot chip on an OrgUnit card (ADR-027). Already a clean kdx-*-main dropped it; lift verbatim. Requires re-opening the kdx-org-node-footer slot (§2).
#kdx-manager-dialogorg-chart/components/manager-dialog.component.ts (~38–214)Assign/clear a unit’s jefe (badge’s click target). Reconcile UX with -main’s assign-drawer.

1C — Weekly-structure / staffing-plan board (subtrees absent; promote only the reusable cards)

Sección titulada «1C — Weekly-structure / staffing-plan board (subtrees absent; promote only the reusable cards)»
CreateInferred from (Coveris-e)Why a component
#kdx-placement-cardstructure/weekly-structure/components/placement-card.component.ts (whole, ~1–472)Draggable placement card (accent stripe, coverage ratio, qty stepper, drop-target). Promote app-*kdx-*.
#kdx-template-chipstructure/weekly-structure/components/template-chip.component.ts (whole, ~1–131)Draggable template-library chip (hours badge, edit/delete). Promote.
#kdx-plan-line-cardstructure/staffing-plan/plan-line-card.component.ts (whole, ~1–140)Plan-demand line card (title, hours, required-tags, 3-metric grid). Promote; swap cv-tag#kdx-tag [variant="requirement"].

The rest of the weekly-structure board (board, tier-row, day-cell, template-sidebar, week-navigator, etc.) is store-coupled app-* chrome — lift with the feature, do not promote to kdx-*.

2. ⚠️ Hard prerequisites (must land BEFORE §1A/1C compile)

Sección titulada «2. ⚠️ Hard prerequisites (must land BEFORE §1A/1C compile)»
  • Core deps into -main/core (compile gate — nothing in §1A builds without them): core/models/scheduling.model.ts, core/data/hours-source-colors.config.ts, core/models/template-hours-label.ts.
  • Re-open kdx-org-node-footer projection slot on #kdx-org-node so #kdx-manager-badge can project into the card footer (currently no footer slot). Re-validate org carousel spacing after.
  • Tokenize one hex set — M/T/N kdx-slot-tag colors (#d97706/#2563eb/#6d28d9, grid ~L504–506) → @theme tokens (ADR-012-c). Everything else already uses PrimeNG tokens — no new design tokens or fonts required.

3. ✅/🔄 Already covered (scope reference — do NOT recreate)

Sección titulada «3. ✅/🔄 Already covered (scope reference — do NOT recreate)»
  • Imports ✅#kdx-beta-badge + staffing 7 (employee-capacity-bar, employee-chip, assigned-worker-card, position-card, position-day-grid, employee-sidebar, assign-drop-popup).
  • Scheduling host chrome ✅scheduling-month L519–598 → #kdx-focus-header; L633–711 → #kdx-coverage-strip; L715–796 → #kdx-scheduling-toolbar.
  • Page-pieces 🔄 (Wave 4) — dashboard KPIs → #kdx-stat; section headers → #kdx-card-section; alerts → #kdx-alert-list; module grid → #kdx-module-grid; roster-detail balance → #kdx-hours-balance-card; tag grid → #kdx-tag-grid; assignment row → #kdx-assignment-row; hours table → #kdx-data-table; org tree → #kdx-org-tree-table.
  • Fully componentized pages ✅coverage, audit-log (already pure kdx-* composition in both repos).
Sección titulada «4. Recommended build order (lowest-risk, keeps the tree green)»
  1. Core deps (§2) — the compile gate for scheduling.
  2. Manager pair (§1B) — smallest, self-contained, already kdx-; re-open the footer slot.
  3. Scheduling leaf atoms (§1A: slot-tag, schedule-chip, time-range-popover, month-covering-card) — each showcase-able first (ADR-012-a).
  4. Scheduling containers (scheduling-month-grid, scheduling-cell-drawer + reconciled candidate-row).
  5. Board cards (§1C) — lift weekly-structure + staffing-plan as features; promote only the 3 cards.

§1A is the only large surface (~4.9k LOC across 3 scheduling files) but additive — no -main feature consumes scheduling today, so lifting it cannot regress current pages. The one cross-cutting change is re-opening kdx-org-node-footer (touches every org-node consumer’s layout). The weekly-structure board (§1C) must move as a unit (store + components together) — do not cherry-pick its app-* pieces.