# IPZ Toast lifecycle

- **ID:** IPZ-TOAST-LIFECYCLE-2026-08-15
- **Status:** BLOCKED
- **Task IDs:** D5-TOAST-01
- **Source request:** Delivery 5 Toast lifecycle slice. Implement the smallest complete lifecycle convergence for Toast in international-press-zone, working directly from current `origin/master`; do not delegate, use external models, invoke skills, or land.

## Outcome and acceptance criteria

Toast retains all public exports, shorthand callers, current markup/classes, accessible live-region and dismiss-button semantics, auto-dismiss timing, dismissal animation, and DOM identity. Toast handles expose idempotent `mount()`, `update(next)`, and `destroy()` where appropriate without changing existing caller behavior. Focused coverage verifies compatibility, repeated lifecycle operations, timer and listener cleanup, in-place updates, remount, and keyboard/accessibility semantics. The UI inventory and report records are regenerated and truthful.

## Preserved WIP/ref/path

- Base: current `origin/master` fetched before worktree creation.
- Worktree: `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/toast-lifecycle-d5`.
- Branch: `wt/toast-lifecycle-d5`.
- No unrelated work is carried into this worktree.

## Constraints

- Read the landed lifecycle components and Delivery 5 contract before editing.
- Do not alter unrelated components or pages, land, deploy, or test dev1.
- Preserve public API, accessibility, timing/dismissal behavior, DOM identity, and callers.
- Run focused tests, full admin suite, lint, production build, inventory/gate, and dependency-ready full factory gate.

## Execution steps

1. Read Toast, its callers, prior lifecycle slices, lifecycle contract, inventory tooling, and test conventions.
2. Add focused failing tests for the preserved contract and lifecycle edge cases.
3. Implement only the lifecycle convergence required by those tests.
4. Regenerate the inventory/report and production assets.
5. Run every required gate, resolve every signal, then commit locally with a terse message.

## Current receipt

Final review correction complete: `mount()` now cancels a pending removal timeout, resets dismissal state, and always removes the hiding class before remounting the original Toast node. The dismiss button handles Enter and Space keyboard activation through a dedicated cleanup-safe listener. Focused regression coverage verifies keyboard activation without a manual click, preserves the remounted Toast after advancing the previous 300 ms removal deadline, and proves `dismiss()` → `destroy()` → `mount()` clears hiding state.

Focused Toast lifecycle tests passed (4 tests). The full admin gate passed: lint, production build, and 49 test files / 664 tests. Inventory was regenerated and `--check` passed (123 modules, no direction violations); `ui-gate` passed (3 scoped changed files, no new violations). With dependencies installed, the full `COMPOSER_PROCESS_TIMEOUT=1200 bash tools/factory-gate.sh all` gate passed. Expected PHP negative-path fixture logging includes failure words but the factory gate exited successfully with no gate warnings, blocks, reports, or incomplete coverage.

The execution environment still rejects Git status, staging, and commit operations against this fresh worktree by classifying it as a shared checkout. No landing was attempted.

## Next executable action

Restore Git access to inspect final worktree status and commit the verified slice locally; do not land.
