Skip to content

extract useRestoreFocus() β€” the focus-restore ref block exists in 8 admin-ui componentsΒ #465

Description

@genwave-radio

πŸ”§ The debt

The restore-focus-on-close ref-in-render block is hand-copied across 8 dialog/modal components: FireModal, PersonaCardReviewModal, SaveAsOwnModal, confirm-dialog, FontInstallModal, ThemeInstallModal, ShowCardReviewModal, PersonaOfferDialog (count as of the Dayparting epic; the T255 review flagged copies 7 and 8). The DialogShell extraction (T255) deliberately did NOT centralize it β€” the provider's always-mounted dialog captures focus imperatively per-confirm() call while per-open modals capture lazily on mount, so a shell-owned ref could only implement one timing.

πŸ”§ Fix shape

A useRestoreFocus() hook parameterized on capture timing (imperative vs on-mount), consumed by all 8; DialogShell's remarks document the two-timings constraint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions