Repository navigation
fix(campaigns): paginate fulfillment backers, reset bulk save, and harden organizer UX (#241) - #244
Conversation
…rden organizer UX (#241)
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
PO acceptance: merge at 782d162 Campaigns PO acceptance gate passed:
|
Summary
Fixes organizer workspace and reward-fulfillment UX, state safety, and accessibility gaps (
line:campaignsonly):Paginate 500+ fulfillment backers (
apps/web/src/lib/fulfillment.ts,apps/web/src/app/me/campaigns/[id]/fulfillment/page.tsx)pagetoFulfillmentFilters/parseFulfillmentFiltersand exportsfulfillmentHrefto preservetier,status, andpagequery parameters while omitting defaultpage=1.listFulfillmentPledgesfrom offset-0.limit(500)to.range((page - 1) * FULFILLMENT_BATCH_MAX, page * FULFILLMENT_BATCH_MAX - 1)(handling PostgRESTPGRST103out-of-range responses with a head count fallback), keeping each page<= 500rows so"Chọn tất cả trong danh sách"fits a singleset_pledge_fulfillmentRPC call while making rows501+reachable across every status/tier filter."Trang trước"/"Trang sau"pagination controls wheneverpage > 1or further pages exist, including when an upper page becomes empty after moving backers out of a filtered status.Reset bulk selection &
#bulk_noteafter save, contextualize row save buttons, and skip unused tier reads (apps/web/src/app/me/campaigns/[id]/fulfillment/page.tsx)resetOnSuccessonFulfillmentForm'sActionFormand keys both the bulk fieldset controls and per-row checkboxes/inputs on saved fulfillment state (status,updated_at,note), so a successful bulk update clearscontribution_idcheckboxes,<SelectAll>, and#bulk_note(preventing subsequent ticks from silently re-submitting earlier backers or wiping their tracking notes) while keeping inputs intact on failed submissions.pledge.reference_codein each per-row"Lưu cho người này"button's accessible name (<span className="sr-only">) and skipslistCampaignTierswhen!canUpdateFulfillment(campaign).Surface stopped payment requests and post-live status notices on
/me/campaigns/[id](apps/web/src/app/me/campaigns/[id]/page.tsx)warningCalloutwhentotals?.payments_stopped_atis set (includingtotals.payments_stopped_notewhen present and Give's support email link).CampaignStatusvalues—including post-livesettling,succeeded,failed, andclosed—inStatusNotice.Destructive milestone confirmation & organizer form/row accessibility (
apps/web/src/app/me/campaigns/[id]/page.tsx,RewardTiersSection.tsx,apps/web/src/app/start/page.tsx)confirmprompt (Xóa mốc “${milestone.title}”?) andmilestone.titleaccessible label context ondeleteMilestone, plusrequiredonpayment_window_daysforbackcampaigns.TierSummaryfrom<p>to semantic<h3>under the"Phần thưởng"<h2>panel and addstier.titlecontext to repeated row controls (↑ Lên,↓ Xuống,Xóa,<summary>"Sửa mức này",Lưu phần thưởng, andNgừng nhận mức này;<SubmitButton>uses.sr-onlychildren to preservePendingContextwithout modifying sharedcomponents/forms.tsx).id/aria-describedbyhints (including#organizer_reverify_hintwhen verified/pending) andmaxLength={20}on#phonein/start/page.tsx.Verification
pnpm format:checkpnpm lintpnpm typecheckpnpm --filter @give/web test(123test files,1,759tests passing)pnpm buildCloses #241
📌 TL;DR
This PR enhances the campaign management dashboard by implementing server-side pagination for the fulfillment page, adding accessibility (a11y) improvements via
aria-labelsand screen-reader-only text, and introducing new status notifications for post-live campaign states (settling, succeeded, failed, closed).🎯 Type of Change
🔍 Changes Walkthrough
apps/web/src/app/me/campaigns/[id]/RewardTiersSection.tsxsr-onlyspans to buttons for screen reader context (e.g., "Move up: [Tier Name]"). Changed tier title from<p>to<h3>for semantic heading hierarchy. Addedaria-labelto the "Edit tier" summary element.apps/web/src/app/me/campaigns/[id]/RewardTiersSection.test.tssr-onlytext content andaria-labelattributes on reward tier controls.apps/web/src/app/me/campaigns/[id]/fulfillment/page.tsxpagesearch param. Addednavelement for "Previous/Next" page links. UpdatedFulfillmentFormto useresetOnSuccessand keyed inputs to ensure React re-renders controls with fresh server data after bulk updates. Addedsr-onlyreference codes to "Save for this person" buttons.apps/web/src/app/me/campaigns/[id]/fulfillment/page.test.tsapps/web/src/app/me/campaigns/[id]/page.tsxStatusNoticesupport for new campaign statuses (settling,succeeded,failed,closed). Added a warningCalloutwhenpayments_stopped_atis set. Addedrequiredattribute topayment_window_days. Addedconfirmdialog andsr-onlytext to milestone delete buttons.apps/web/src/app/me/campaigns/[id]/page.test.tsapps/web/src/app/start/page.tsxidattributes to hint paragraphs and linking them viaaria-describedbyon inputs. AddedmaxLengthto phone input.apps/web/src/app/start/page.test.tsaria-describedbylinks andmaxLengthconstraints on the start page forms.apps/web/src/lib/fulfillment.test.tsparseFulfillmentFiltersandlistFulfillmentPledges(using.range()instead of.limit()). Added tests for the newfulfillmentHrefhelper.📊 Architectural Flow
sequenceDiagram participant User participant Browser participant Server (RSC) participant DB Note over User,Browser: Pagination Flow User->>Browser: Clicks "Next Page" Browser->>Server: GET /fulfillment?page=2 Server->>DB: Query pledges with .range(500, 999) DB-->>Server: Returns page 2 data + total count Server-->>Browser: Renders FulfillmentForm with page 2 data Note over User,Browser: Bulk Update Flow User->>Browser: Selects rows & clicks "Bulk Update" Browser->>Server: POST /fulfillment (Action) Server->>DB: Updates selected pledges DB-->>Server: Success Server-->>Browser: Re-renders page with resetOnSuccess Note right of Browser: React keys force re-mount of inputs<br/>to reflect new DB state