feat(web): admin UI for email campaigns - #368
Open
williamchiii wants to merge 3 commits into
Open
Conversation
Builds the campaign list and create/edit panel against the seven endpoints shipped in #365. Layout follows the Figma two-pane design: the list stays visible and shifts left while an inline panel expands beside it, rather than an overlay. - Typed hooks for list, get, create, update, send, and delete - Recipient groups are a union type, so a group the API cannot resolve is a compile error rather than a runtime 400 - Format has no default; picking wrong sends raw tags or unrendered markup, so it must be a deliberate choice - Subject and format are not in the Figma but the API requires both Send, delete, scheduling, and delivery stats are not wired yet.
Adds the Email Campaigns sidebar entry — the page was only reachable by typing the URL. Sent, sending, and failed campaigns now open read-only with the reason shown, mirroring the API's canEditCampaign. Previously the form accepted edits and only failed on save with a generic "check the fields" hint that pointed at the wrong problem. Failed campaigns also surface last_error, and save errors now show the API's own message. - Every control disabled; MultiSelect wrapped since it takes no disabled prop - Format pill drops its blue fill when loc
Completes the campaign lifecycle in the UI. Sending is a split button per the Figma: the label sends immediately behind a confirmation naming the recipient groups, the chevron holds scheduling, and Save for later sits beside it. Scheduled campaigns get an amber banner with Reschedule and Unschedule, and the card kebab carries the same actions plus Delete. Both destructive paths confirm first; unschedule does not, since it is reversible. The date picker's minValue only guards the calendar popover and ignores the time entirely, so a past datetime could reach the API. The API accepts it and the sweep then fails the campaign for missing its window, which is how a send ends up dead with no way back. Validate the combined value instead and disable Schedule. - Errors render inside the modals; the panel behind them is not visible - Only currently scheduled campaigns prefill a time. scheduled_at survives unscheduling, so a draft can carry a stale timestamp - Menu merges its className instead of discarding it, and takes popoverClassName - Menu items highlight on hover, not focus: react-aria keeps the last item focused after the pointer leaves, so a focus highlight looks stuck - Kebab drops variant="icon", whose pressed tint persists while the menu is open Stats panel is not included; it needs SES delivery events that do not exist yet.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Admin UI for email campaigns, built against the seven endpoints from #365. Organizers
can now send campaigns themselves instead of asking the tech team to run a script.
Two-pane Figma layout: the list stays visible and shifts left while an inline panel
expands beside it, rather than an overlay.
Verified against real AWS SES. A campaign scheduled through this UI was swept 35
seconds after its slot and delivered to ahe full path ran
outside an emulator.
Subject and format are added because the API requires both and neither is in the Figma.
Format has no default: picking wrong sendarkup.
Menuplaced its own className after thescarding any passedin. It now merges, and takes an optional
popoverClassName.Type of Change
Checklist
Additional Notes
is thin over the API. Typecheck and lin baseline.
error rather than a runtime 400.
minValueignores the time, so past datetimes are validated separately.The API accepts a past
scheduledAtan campaign.MultiSelecthardcodes chip styles),no recipient count in the confirmation and the list doesn't
refetch on panel open, so a since-failed campaign can look scheduled until next fetch.
dev