Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/components/ActionPanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ The inline dispute form also re-checks the wallet connection at submit time befo
- Visible focus rings use high-contrast Tailwind `focus-visible:outline` utilities and are not removed in any state.
- Actions are rendered in contract workflow order: submit milestone, release funds, dispute, then summary when applicable.
- Submit Milestone opens the shared confirmation dialog before invoking the callback, then shows a success toast once the action is confirmed.
- Dispute opens an inline reason form. The submitted reason is trimmed, must be non-empty, and is only passed to `onDispute` while a wallet address is still connected.
- Dispute opens an inline reason form. The submitted reason is validated using the shared `validateDisputeReason` utility from [disputeReason.ts](file:///c:/Users/USER/Desktop/Talenttrust-Frontend/src/lib/disputeReason.ts), which enforces `DISPUTE_REASON_MAX_LENGTH` (500 characters). The submitted reason is trimmed, must be non-empty, and is only passed to `onDispute` while a wallet address is still connected.
- Unavailable actions stay visible as disabled buttons with an accessible reason. Use `disabledReasons` for states such as no wallet, missing permissions, pending API responses, or unmet milestone conditions.
- Loading states disable all visible actions and describe that contract data is still loading.
- Error states are announced through `role="alert"` without moving focus or changing the action order.
- **Dispute Reason Character Counter**: The character counter in the inline dispute form is associated with the textarea via `aria-describedby` (`id="dispute-reason-counter"`). The remaining count is announced to screen reader users using an `aria-live` region:
- **Dispute Reason Character Counter**: The character counter in the inline dispute form is associated with the textarea via `aria-describedby` (`id="dispute-reason-counter"`). The current character count is announced to screen reader users using the format `"X of 500 characters"` in an `aria-live` region:
- **Debouncing/Throttling**: To avoid screen reader spam, updates are debounced by `1000ms` when typing non-boundary characters. Immediate announcements occur when pausing typing, or when crossing meaningful boundaries (multiples of 50, multiples of 10 when remaining count is $\le 50$, or every character when $\le 10$).
- **Assertive Escalation**: The live region defaults to `aria-live="polite"`, but escalates to `aria-live="assertive"` when within the threshold of $50$ characters or fewer remaining.
- **Clean State**: The live region is only rendered when the form is open, ensuring it remains quiet when closed.
Expand Down
Loading
Loading