# ProgressBar lifecycle contract

## Outcome

Add an idempotent `mount()`, `update(next)`, and `destroy()` lifecycle to the canonical `ProgressBar`, without changing constructor behavior or existing setter APIs.

## Status

IDLE — Task D5-PB-01 is complete in the current local commit; the owner explicitly scoped delivery to this slice and commit only.

## Task IDs

- D5-PB-01 — ProgressBar lifecycle slice

## Source request

Owner requested the first Delivery 5 slice: add an idempotent ProgressBar mount/update/destroy lifecycle, preserve constructor and setter compatibility, add focused lifecycle tests, run focused tests, lint, build, and commit only this slice. No delegation or external models.

## Acceptance criteria

- Constructor still creates and mounts a usable progress bar.
- `mount()` is idempotent and does not duplicate DOM.
- `update(next)` changes supported state through the existing public behavior without replacing the mounted root.
- `destroy()` is idempotent, cancels pending animation work, and removes the mounted root.
- Existing setters retain their public signatures and behavior while mounted.
- Focused lifecycle tests, lint, and production build pass cleanly.
- Commit contains only this primitive, its focused tests, and this registry update.

## Preserved WIP

- Ref/path: `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/ipz-search-delivery5`
- Baseline: clean worktree before this task.
- Do not alter concurrent work outside the ProgressBar primitive and its focused tests.

## Constraints

- Follow `.claude/agents/expert.md` and the frontend JavaScript skill.
- Delivery 5 requires the lifecycle contract to be independently revertible.
- Preserve constructor and setter compatibility.
- Do not delegate or use external models.

## Execution steps

1. Define the lifecycle against the current ProgressBar state and DOM structure.
2. Implement idempotent mounting, state update, and cleanup with compatibility retained.
3. Add focused lifecycle tests covering constructor compatibility, repeated mount, in-place update, and repeated destroy.
4. Run the focused tests, JavaScript lint, and admin production build.
5. Commit only this slice after all gates are clean.

## Current receipt

The current local commit contains the constructor-compatible idempotent `mount()`, in-place `update(next)`, and repeat-safe `destroy()` with remount support, plus three focused lifecycle tests. The focused test command, JavaScript lint, and admin production build all completed cleanly; the production build updated `admin/dist/js/454.js`.

## Next executable action

No action is scheduled within the owner-approved commit-only scope.
