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.
Document the ConfirmDialog focus-trap contract and caller responsibilities
Description
src/components/ConfirmDialog.tsxtraps focus, closes on Escape, and explicitly delegates focus restoration to the caller, butdocs/componentshas no page for it. Contributors wiring new destructive flows have to read the source to learn that contract.Requirements and context
ConfirmDialogProps, including theconfirmLabel/cancelLabeldefaults.src/components/ActionPanel.tsxas the worked example.FOCUSABLE_SELECTORSlist and what happens when the dialog contains no focusable element.Suggested execution
git checkout -b docs/dialogs-confirm-dialogsrc/components/ConfirmDialog.tsxsrc/components/__tests__/ConfirmDialog.test.tsxdocs/components/ConfirmDialog.mdTest and commit
npm run lint,npm test,npm run buildExample commit message
docs(dialogs): document ConfirmDialog focus and escape contractGuidelines
Community & contribution rewards