# TileSelect lifecycle

Audience: AI coding agents first.

## Outcome
Give the stateful `TileSelect` component an idempotent in-place lifecycle without changing its public API, interaction semantics, selection state, accessibility, or element identity.

## Status
IDLE — the repaired local-only slice is committed; no worker is executing and landing is excluded.

## Task IDs
- IPZ-TILESELECT-LIFECYCLE-1 — lifecycle implementation and compatibility coverage
- IPZ-TILESELECT-LIFECYCLE-2 — inventory, production assets, and gates

## Source Request
2026-08-15: Delivery 5 TileSelect lifecycle slice. Work from current `origin/master`; implement only the smallest complete lifecycle convergence for `admin/src/components/TileSelect.js`. Preserve APIs/caller behavior, callback precedence, selection state, keyboard/accessibility, and stable identity. Test compatibility, repeated lifecycle calls, no-op identity, cleanup/remount, and accessibility. Keep inventory/report and a durable per-slice receipt truthful. Run focused tests, applicable full admin suite/lint/build/inventory/UI gate, full factory gate, and commit locally only.

## Acceptance Criteria
- `TileSelect` exposes idempotent `mount()`, `update(next)`, and `destroy()` only because it owns mutable DOM event lifecycle state.
- Existing positional API, generated markup, event callback order, state mutation, selection behavior, keyboard use, ARIA attributes, and node identity remain compatible.
- Focused tests cover baseline compatibility, repeated lifecycle calls, no-op update identity, cleanup/remount, selection, and accessibility.
- Inventory/report and generated assets truthfully reflect the source.
- Focused and requested suite, lint, build, inventory/UI, and factory gates pass cleanly.
- A local commit is created and not landed.

## Preserved WIP / Ref / Path
Worktree `/home/user/Projects/Press.zone/wordpress/wp-content/.claude/worktrees/agent-ad20e85785f922cb5`; initial `origin/master` and `HEAD` are both `e2c1198603550cd9ee7513a68cc7af5325243c83`. Existing repository work outside this slice remains untouched.

## Constraints
No delegation, skills, or external models. No unrelated changes or landing. Preserve caller behavior and stable DOM identity.

## Execution Steps
1. Read TileSelect and lifecycle reference components/tests.
2. Add the smallest lifecycle implementation and focused coverage.
3. Regenerate the required inventory/report and production assets.
4. Run required verification and local commit.

## Current Receipt
`TileSelect` attaches idempotent `mount()`, `update(next)`, and `destroy()` methods to its returned root without replacing root or tile nodes. Event listeners are removed and reattached safely; selection remains state-first, then callback, then visual synchronization. The component explicitly writes `aria-pressed` because the shared DOM helper does not support that ARIA attribute. The prior keyboard repair changed native Space timing and was removed. Browser verification now uses an isolated static fixture and real Playwright keyboard input through `e2e-remote`: Enter activates the focused native button on keydown, its keyup produces no second callback, Space keydown leaves the state and callback unchanged, and Space keyup activates it. No custom keyboard handler remains. The focused lifecycle suite passed (4 tests), the browser keyboard check passed, and the final `COMPOSER_PROCESS_TIMEOUT=1200 bash tools/factory-gate.sh all` gate passed. The local `Add TileSelect lifecycle` commit is committed locally and remains unlanded.

## Next Executable Action
No implementation worker is active. Retain the repaired local `Add TileSelect lifecycle` commit for review; do not land it.
