Skip to content

Replace Browser Prompts with Accessible Management Forms #72

Description

@Lakes41

Difficulty: Advanced

Type: Refactor

Summary

Replace prompt, alert, and confirm usage in management pages with accessible dashboard UI components so pass and member actions are testable, consistent, and user-friendly.

Current Behaviour

The passes page uses prompt() for editing pass names and alert() for mutation errors. The members page uses prompt() for role changes, confirm() for removals, and alert() for mutation errors. These browser dialogs are hard to style, difficult to test reliably, and provide limited accessibility or validation support.

Expected Behaviour

Management actions should use in-app forms, modals, confirmation dialogs, and toast or inline error states. Users should see consistent pending, success, validation, and rollback feedback without relying on blocking browser dialogs.

Suggested Implementation

Create reusable management dialog components for editing pass fields, changing member roles, confirming destructive actions, and displaying mutation errors. Replace direct calls to prompt, alert, and confirm with controlled React state. Ensure keyboard navigation, focus trapping, labels, and error messages are accessible.

Files or Areas Likely Affected

  • apps/dashboard/app/passes/page.tsx
  • apps/dashboard/app/members/page.tsx
  • apps/dashboard/components/
  • apps/dashboard/lib/hooks/useOptimisticMutation.ts
  • apps/dashboard/test/

Acceptance Criteria

  • Pass editing no longer uses prompt().
  • Member role changes no longer use prompt().
  • Member removal no longer uses confirm().
  • Mutation errors no longer rely on alert().
  • Dialogs are keyboard-accessible and expose clear labels.
  • Tests cover opening, submitting, cancelling, and error states for the new dialogs.

Additional Notes

This should be implemented before adding more complex management flows, since future create/edit actions can reuse the same dialog patterns.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions