USRSE / USRSE/usrse.github.io

feat(admin): replace window.prompt with proper modal for required review comments

Open
#2,004 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
33
Forks
104
Avg merge
12h 3m
Merged PRs (30d)
10

Description

Summary

apps/admin/src/pages/events/EventDetailPage.tsx and apps/admin/src/pages/announcements/AnnouncementDetailPage.tsx use window.prompt to collect the required comment for reject and request_changes transitions. Works but UX is rough — no validation, no formatting, no cancel-without-typing, blocks the JS thread.

Requirements

  • Build a reusable <RequiredCommentModal> component (or use an existing modal primitive if one exists in apps/admin/src/components/)
  • Replace the two window.prompt calls in EventDetailPage and AnnouncementDetailPage
  • Validate non-empty before submit; show inline error if empty
  • Add to any future artifact detail page (Plan 4 forms, Plan 5 broadcast UIs)

Context

Flagged in the Plan 3 review. Forms (Plan 4) will add another detail page with the same pattern — fix before that lands so the new code copies the modal instead of window.prompt.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/admin/src/pages/events/EventDetailPage.tsx and apps/admin/src/pages/announcements/AnnouncementDetailPage.tsx, then inspect apps/admin/src/components/ for an existing modal primitive. Trace the reject and request_changes transitions and replace both window.prompt calls with the reusable required-comment flow. Done means empty comments show an inline error, cancellation is possible, and both pages use the modal.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.