Skip to content

feat: broadcast announcements to guards (AP-043) - #562

Open
navyamidha95339-arch wants to merge 2 commits into
mainfrom
navya/feature/broadcast-announcements
Open

feat: broadcast announcements to guards (AP-043)#562
navyamidha95339-arch wants to merge 2 commits into
mainfrom
navya/feature/broadcast-announcements

Conversation

@navyamidha95339-arch

Copy link
Copy Markdown
Collaborator

Summary
Adds a Compose Announcement feature for admins to draft and mock-send broadcasts to guard audience segments, with a persisted send history.

Checklist

✅ Compose UI + audience (title, message body, audience dropdown: All Guards / Active Guards Only / Pending Verification)
✅ Confirm before send — explicit confirmation modal restating the title and audience before sending
✅ Mock send + history — localStorage-persisted, survives page refresh
✅ Audience clarity — live "This will be sent to: X" hint on the compose form, repeated in the confirm dialog
⬜ Wire endpoint — explicitly out of scope per ticket ("later"); noted in the UI copy that delivery isn't live yet

Evidence
Screenshots attached: composing an announcement, the confirm-before-send dialog, and the resulting history entry.

Note: Built using the reusable Button/Card/FormField components from AP-016 for visual consistency.
Screenshot 2026-09-04 131721
Screenshot 2026-09-04 131658
Screenshot 2026-09-04 131759

@puniaruj

puniaruj commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Nice work on this feature. I reviewed all three changed files and validated the main announcement flow against the current Admin Panel code.

The core implementation is correct for the current mock-only scope. The page is connected through the sidebar and protected Admin routes, the title and message validation works, all three audience options are available, the selected audience is shown before sending, and the confirmed mock send is recorded in persistent history. It also correctly explains that no live backend delivery is connected yet.

I found two points that should be addressed before the final review:

  1. The confirmation sentence currently omits the selected audience and reads: You're about to send "{title}" to This cannot be easily undone...
    This should restate the audience as described in the PR checklist, for example:
    You're about to send "{title}" to {audienceLabel}. This cannot be easily undone once a real send endpoint is wired up.

  2. The confirmation is implemented as a custom overlay rather than using the shared Modal component. Please use the shared Modal from the current main so the confirmation retains the existing dialog labelling, keyboard focus, Escape handling, focus trap and focus restoration behaviour.

A small focused test covering the confirmation audience and completed mock-send flow would also help prevent these behaviours from regressing.

Apart from those points, the structure and mock workflow look good. Once they are addressed, I believe this will be ready for Krisha’s final review.

…irm text (AP-043 review feedback)

- Replaced custom overlay with the shared Modal component for consistent
  focus trap, Escape handling, and focus restoration
- Confirmation text now includes the selected audience label
- Added Announcements.test.jsx covering confirmation-audience display
  and the completed mock-send-to-history flow
@navyamidha95339-arch

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-09-11 122304 Both points addressed:

The confirmation text now restates the selected audience: You're about to send "{title}" to {audienceLabel}. This cannot be easily undone once a real send endpoint is wired up.
Replaced the custom overlay with the shared Modal component — confirmation now gets the existing dialog labelling, focus trap, Escape handling, and focus restoration for free.

Also added Announcements.test.jsx with two tests: one verifying the audience shows correctly in the confirmation dialog, and one verifying a completed mock-send is recorded in history and resets the form. Both pass, and CI is green.

Ready for another look whenever you get a chance — thanks for the thorough review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants