# IPZ Tabs lifecycle

- **ID:** IPZ-TABS-LIFECYCLE-2026-08-15
- **Status:** IDLE
- **Task ID:** D5-TABS-01
- **Source request:** Deliver the smallest complete Delivery 5 lifecycle convergence for `admin/src/components/Tabs.js` from current `origin/master`, directly and without delegation, skills, or external models. Preserve all public API and caller behavior, including event callback precedence, selected state, keyboard/accessibility behavior, and DOM identity. Add lifecycle methods only to stateful returned elements, add focused compatibility/lifecycle/accessibility regression coverage, run every named gate, commit locally, and do not land.

## Outcome and acceptance criteria

Stateful `Tabs` and `TabbedPanel` returned elements retain their existing exports, markup, callback ordering, selected state, roving tabindex, keyboard navigation, accessibility relationships, and node identity when no reconciliation is required. Their lifecycle methods are idempotent: `mount()` optionally appends the same root and restores listeners after destroy; `update(next)` is a no-op for unchanged state and updates only supported state in place; `destroy()` removes owned listeners and DOM attachment without duplicate effects. Remount restores exactly one listener binding. Focused tests cover factory compatibility, callback precedence, repeated lifecycle calls, no-op identity, cleanup/remount, and keyboard accessibility. Inventory/report and build outputs are regenerated only when tools establish they require changes.

## Preserved WIP/ref/path

- Clean isolated worktree `/home/user/Projects/Press.zone/wordpress/wp-content/.claude/worktrees/agent-abcaa3c4ac523c453` at fetched `origin/master` `794864683`.
- Only `admin/src/components/Tabs.js`, a focused Tabs lifecycle test, required truthful inventory/report/build outputs, and this registry may change.

## Constraints

Do not change callers, public APIs, unrelated components/pages, styles, or generated files unless required by the production build. Do not land. Preserve current callback behavior: direction callback precedes standard callback in Tabs; TabbedPanel owns the standard callback after content replacement.

## Execution steps

1. Read the Delivery 5 contract and recently landed Toggle and SortableList lifecycle patterns.
2. Inspect Tabs callers and current test/tooling conventions.
3. Add minimal lifecycle ownership and focused regression coverage.
4. Run focused tests, full admin suite, lint, production build, inventory/UI gate, and full factory gate.
5. Commit the scoped result locally and update this receipt plus the plan index truthfully.

## Current receipt

Both confirmed blockers are repaired. `TabbedPanel` removes the correctly prefixed content wrapper, so click transitions and `update({ activeTab })` each leave exactly one content wrapper and tabpanel. `Tabs.update()` now applies the constructor's non-empty accessible-name validation before changing the tablist label. Focused Tabs lifecycle coverage passes (4 tests), including both regressions. The full admin suite and lint pass; production build, inventory regeneration, UI gate, and UI architecture tests pass. The first full factory attempt exposed missing actual-worktree admin dependencies (`mini-css-extract-plugin`), so locked admin dependencies were installed in the factory's working directory and the complete factory gate then passed. Generated bundle and inventory outputs are current. The local `HEAD` repair commit is retained for review; landing remains excluded. The commit hook did not run root-level JavaScript or Composer checks because the relevant manifests are nested, and did not run Trivy because it is unavailable; the applicable nested admin checks and complete factory gate passed.

## Next executable action

No worker is active. Retain the local `HEAD` repair commit for review or later landing; do not land it.
