Skip to content

Document the ConfirmDialog focus-trap contract and caller responsibilities #435

Description

@mikewheeleer

Document the ConfirmDialog focus-trap contract and caller responsibilities

Description

src/components/ConfirmDialog.tsx traps focus, closes on Escape, and explicitly delegates focus restoration to the caller, but docs/components has no page for it. Contributors wiring new destructive flows have to read the source to learn that contract.

Requirements and context

  • Repository scope: Talenttrust/Talenttrust-Frontend only.
  • Document every prop in ConfirmDialogProps, including the confirmLabel/cancelLabel defaults.
  • State clearly that callers must retain a trigger ref and restore focus on close, using src/components/ActionPanel.tsx as the worked example.
  • Note the FOCUSABLE_SELECTORS list and what happens when the dialog contains no focusable element.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b docs/dialogs-confirm-dialog
  • Write code in: src/components/ConfirmDialog.tsx
  • Write comprehensive tests in: src/components/__tests__/ConfirmDialog.test.tsx
  • Add documentation: docs/components/ConfirmDialog.md

Test and commit

  • Run npm run lint, npm test, npm run build
  • Cover edge cases; include test output

Example commit message

docs(dialogs): document ConfirmDialog focus and escape contract

Guidelines

  • Minimum 95 percent test coverage for impacted modules
  • Clear documentation
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the TalentTrust community on Discord: https://discord.gg/WqnGpcPx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions