feat(wave-admin): UI for managing waves; split current/upcoming display#1909
Open
efstajas wants to merge 1 commit into
Open
feat(wave-admin): UI for managing waves; split current/upcoming display#1909efstajas wants to merge 1 commit into
efstajas wants to merge 1 commit into
Conversation
…ve display - Admin dashboard: new "Waves" card (gated on manageWaves) linking to /wave/admin/waves, listing all wave programs. - Per-program admin page: list scheduled waves with status badges, schedule new waves, edit upcoming ones, extend active ones (start/budget locked), and delete upcoming waves (with confirmation). Ended waves are read-only. - Wave program public page: split into separate "Current Wave" and "Upcoming Waves" sections so a current+upcoming combo renders both; upcoming section hides entirely when there's a current wave but nothing scheduled, and keeps the newsletter/Discord empty state when neither exists. - API client: add manualCreateWave, updateWave, and deleteWave helpers.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds wave administration UI (new admin routes + modals) backed by new wavePrograms client helpers, and updates the public wave program page to display current and upcoming waves simultaneously.
Changes:
- Added
/wave/admin/wavesand/wave/admin/waves/[waveProgramId]pages for listing wave programs and managing scheduled waves (create/edit/extend/delete). - Introduced create/edit wave modals and new
wavePrograms.tshelpers (manualCreateWave,updateWave,deleteWave). - Updated public wave program page to render separate “Current Wave” and “Upcoming Waves” sections (instead of collapsing to one).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/(pages)/wave/(base-layout)/admin/waves/+page.ts | Loads wave programs for the new admin waves list route with permission gating. |
| src/routes/(pages)/wave/(base-layout)/admin/waves/+page.svelte | Renders wave program list UI and refresh action. |
| src/routes/(pages)/wave/(base-layout)/admin/waves/[waveProgramId]/+page.ts | Loads a specific wave program + waves list with permission gating and sorting. |
| src/routes/(pages)/wave/(base-layout)/admin/waves/[waveProgramId]/+page.svelte | Renders waves table with status, edit/extend actions, and delete flow. |
| src/routes/(pages)/wave/(base-layout)/admin/waves/[waveProgramId]/components/create-wave-modal.svelte | Modal UI/validation for scheduling a new wave. |
| src/routes/(pages)/wave/(base-layout)/admin/waves/[waveProgramId]/components/edit-wave-modal.svelte | Modal UI/validation for editing upcoming waves and extending active waves. |
| src/routes/(pages)/wave/(base-layout)/admin/+page.svelte | Adds the new “Waves” admin card gated by manageWaves. |
| src/routes/(pages)/wave/(base-layout)/[waveProgramSlug]/+page.svelte | Splits public display into separate current/upcoming/past wave sections. |
| src/lib/utils/wave/wavePrograms.ts | Adds client helpers for manual create, update, and delete wave endpoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+248
to
+252
| export async function deleteWave(f = fetch, waveProgramId: string, waveId: string) { | ||
| await authenticatedCall(f, `/api/wave-programs/${waveProgramId}/waves/${waveId}`, { | ||
| method: 'DELETE', | ||
| }); | ||
| } |
Comment on lines
+34
to
+40
| const budgetValidationState = $derived.by(() => { | ||
| if (budgetUSD.length === 0) return undefined; | ||
| if (!BUDGET_PATTERN.test(budgetUSD)) { | ||
| return { type: 'invalid' as const, message: 'Must be a decimal number, e.g. "50000.00".' }; | ||
| } | ||
| return { type: 'valid' as const }; | ||
| }); |
Comment on lines
+69
to
+75
| const budgetValidationState = $derived.by(() => { | ||
| if (budgetUSD.length === 0) return undefined; | ||
| if (!BUDGET_PATTERN.test(budgetUSD)) { | ||
| return { type: 'invalid' as const, message: 'Must be a decimal number, e.g. "50000.00".' }; | ||
| } | ||
| return { type: 'valid' as const }; | ||
| }); |
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.
Summary
Front-end for the new wave-admin endpoints (see matching wave PR: drips-network/wave#624), plus a small fix to the public wave program page so a current wave and an upcoming wave can both show at the same time.
Admin
/wave/admin(gated onmanageWaves)./wave/admin/waves— lists wave programs with a "Manage Waves" link each./wave/admin/waves/[waveProgramId]— lists scheduled waves with status badges and per-row actions:Public wave program page
Test plan