Repository navigation
Give v2.1 polish: Sprint 5 P3 fixes, /me ambassador toggle, and README Production sync - #332
Conversation
… & README sync (Refs #331)
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 61f2c9c Independent PO flagship review (37809884-b7d9-46ce-9590-1d1baba07e20): APPROVE (0 P0/P1/P2 findings).
|
Refs #331
Summary
App-only polish batch resolving all non-blocking P3 items across Give v2 (
#313–#320), adding a post-end ambassador leaderboard visibility toggle on/me, and syncingREADME.mdwith live Production (https://give.vn). Zero DB schema changes and zero money-logic changes.Changes
#313P3s):apps/web/src/lib/canvas-cards.ts: resolve computeddocument.bodyfont family at draw time (falling back safely toSANS_FONTin SSR/Node) so client PNG posters and thank-you cards use self-hosted Be Vietnam Pro across browsers; addedcanvas-cards.test.tscovering Node/SSR fallback, computed family, Story/Square VietQR cards, and thank-you cards.apps/web/src/app/campaigns/[slug]/opengraph-image.tsx: returnCache-Control: no-storewhen!prelaunch && totals === nullso CDNs never cache transient0 ₫fallback figures (preservingPUBLIC_COVER_CACHEon pre-launch teasers and normal renders); added Vitest coverage.#314P3s):TransparencySummaryBox.tsx,ClosingImpactReport.tsx,MilestoneList.tsx,ImpactReportSection.tsx: bumped non-Badgetext-xslabels/metadata/links totext-sm(DESIGN.md §3), removed nestedborder border-borderboxes inside.card/<Panel>in favor of hairline dividers and borderlessbg-surfacefills (DESIGN.md §1 Rule 2), and alignedTransparencySummaryBox.tsxpadding/gap tosm:p-6/gap-3(DESIGN.md §2.4).apps/web/src/app/me/campaigns/[id]/disbursements/actions.ts: passed context-specificGIVE_DISBURSEMENT_NOT_FOUNDwording forlinkDisbursementMilestoneon both pre-check and RPC error paths + tests.apps/web/src/components/campaign/MilestoneList.test.ts: aligned test prop query param to?filter=outmatchingstatementHref.#316P3):4.000formatting consistently acrossapps/web/src/lib/errors.ts,apps/web/src/lib/validation.ts,FaqSection.tsx, and tests.#317P3s — UI/tests only, zero money-logic changes):PledgeForm.tsx: switched"Mức hiện tại của bạn"badge inside disabledbg-surfacecard fromtone="info"totone="brand"for readable contrast.pledge/page.tsx: gated the second expired-tier reassurance sentence mentioning cancel/switch onaccepting.pledge/actions.test.ts: added fast-fail expired-tier regression assertion forchange_pledge(savePledge(CAMPAIGN, PLEDGE, ...)).#318P3):CampaignCard.tsx: tightenedvalidLastStatementAtcheck toisPublicStatus(campaign.status)with non-public status test coverage.#319P3s):ambassador-actions.ts: added local override forGIVE_CAMPAIGN_NOT_ACCEPTING("Chiến dịch này hiện không còn mở tạo liên kết kêu gọi.").apps/web/src/app/me/actions.ts,/me/page.tsx,MyAmbassadorLinksSection.tsx: added"Ẩn khỏi bảng xếp hạng"/"Hiện trên bảng xếp hạng"toggle callinggive.get_my_campaign_ambassador+give.upsert_my_campaign_ambassadorstrictly underdbAs(session.accessToken)(zerodbService()), preserving authoritativedisplay_name, working on ended campaigns, revalidating/meand validated/campaigns/[slug], and syncing cleanly on server prop refresh + error paths.#320P3s):apps/web/src/app/admin/reports/wishes/page.tsx: aligned Callout button wording to“Xác nhận ẩn & chốt báo cáo”and added truncation note whentotalCount > reports.lengthmatching SQL sort order (open=sớm nhất, others =mới nhất).apps/web/src/components/campaign/WishHeartButton.tsx: removed redundant inner.sr-onlyspan since<button>already carries descriptivearia-label.README.mdProduction sync:## Status,### Staff,### Cron,## Routes, and## Security modelto accurately reflect live Production (https://give.vn), Beta (https://beta.give.vn), Wave 1/2, Give v2, all 62 routes, and all 10 Vercel Cron jobs.Verification
pnpm format:check— PASSpnpm lint— PASSpnpm typecheck— PASSpnpm test(vitest run) — 212 files / 2,900 tests PASSpnpm build— PASS (all 62 routes compiled cleanly)📌 TL;DR
This PR updates the
README.mdto reflect the full production release status (Give v2, Wave 1/2) and expands the documented route/cron surface. It also introduces several UX and robustness improvements, including a truncation notice for admin report queues, dynamicCache-Controlheaders for Open Graph images to prevent caching of transient errors, and specific error handling for ambassador links and expired Early Bird pledges.🎯 Type of Change
🔍 Changes Walkthrough
README.md1. Status: Updated to reflect
mainas Production (live on Vercel) anddevas Beta. Detailed shipped capabilities for Core, Wave 1/2, and Give v2.2. Staff: Added
financerole and documented the new/admin/rolesmanagement UI.3. Cron: Expanded the list from 3 to 10 scheduled routes, detailing new jobs for reminders, pledge lapsing, email outbox, and data purging.
4. Routes: Significantly expanded the route table to include new admin finance pages, donor tracking, ambassador features, and email unsubscribe flows.
5. Security: Clarified the scope of
dbService()usage for server-side operations.apps/web/src/app/admin/reports/wishes/page.tsxapps/web/src/app/admin/reports/wishes/page.test.tstotal_countexceeds the returned list length. Updated assertions for the new button label.apps/web/src/app/campaigns/[slug]/opengraph-image.tsxCache-Control: no-storeif the campaign is live/ended but thetotalslookup fails (returnsnull). This prevents CDNs from caching "0 ₫" fallback images during transient database errors.apps/web/src/app/campaigns/[slug]/opengraph-image.test.tsno-storeheader is returned when totals lookup fails for live/ended campaigns, andPUBLIC_COVER_CACHEis used otherwise.apps/web/src/app/campaigns/[slug]/ambassador-actions.tsAMBASSADOR_ERROR_OVERRIDESto map specific database errors (e.g.,GIVE_CAMPAIGN_NOT_ACCEPTING) to user-friendly Vietnamese messages.apps/web/src/app/campaigns/[slug]/ambassador-actions.test.tsapps/web/src/app/campaigns/[slug]/pledge/PledgeForm.tsxinfotobrandfor better visual consistency.apps/web/src/app/campaigns/[slug]/pledge/PledgeForm.test.tsbrandbadge styling.apps/web/src/app/campaigns/[slug]/pledge/actions.test.tssavePledgecorrectly rejects expired Early Bird tiers without calling the database.apps/web/src/app/campaigns/[slug]/pledge/page.test.tsapps/web/src/app/campaigns/[slug]/DonorWishesWall.test.tsaria-labelof the heart button includes the count and that no.sr-onlyelement is present (accessibility check).📊 Architectural Flow
flowchart TD subgraph Client A[User Browser] end subgraph Next.js App B[Admin Reports Page] C[Open Graph Image Route] D[Ambassador Action] E[Pledge Form] end subgraph Database / Supabase F[RPC: list_reported_contribution_messages] G[RPC: public_campaigns / campaigns] H[RPC: save_ambassador] I[RPC: create_pledge / change_pledge] end A -->|Request| B A -->|Request| C A -->|Action| D A -->|Action| E B -->|Query| F F -->|Returns rows + total_count| B B -->|If total > rows| B1[Show Truncation Notice] C -->|Query| G G -->|Returns data| C G -->|Returns null/error| C1[Set Cache-Control: no-store] G -->|Returns valid data| C2[Set Cache-Control: public] C1 -->|Response| A C2 -->|Response| A D -->|Action| H H -->|Error: GIVE_CAMPAIGN_NOT_ACCEPTING| D1[Map to Friendly Error] D1 -->|Response| A E -->|Validation| E1{Check Early Bird Status} E1 -->|Expired| E2[Reject Client-Side] E1 -->|Valid| I I -->|Response| A