Skip to content

fix(card): remove hardcoded-stats rejection-share captions#2486

Merged
Hugo0 merged 4 commits into
devfrom
fix/rejection-caption-live-tally
Jul 23, 2026
Merged

fix(card): remove hardcoded-stats rejection-share captions#2486
Hugo0 merged 4 commits into
devfrom
fix/rejection-caption-live-tally

Conversation

@0xkkonrad

@0xkkonrad 0xkkonrad commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The "Tweet to appeal" caption pool on the card rejection screen included captions with hardcoded fake stats that contradict the live door tally the screen itself renders. Removed rather than templated:

Single-file diff. (Earlier revisions of this PR interpolated the live tally and added a caption test suite — both superseded/removed; final diff is rejectionCaptions.ts only.)

Risks / breaking changes

None. Pool shrinks 25 → 24; pickRejectionCaption() unchanged; single consumer (CardRejectionScreen).

QA

  • npx jest src/components/Card — 112 tests green.
  • Manual: /card rejection screen → Tweet to appeal → caption never states waitlist/admitted numbers.

🤖 Generated with Claude Code

The numbers-flex caption in the appeal-tweet pool hardcoded the original
'213 tried, 7 got in' placeholder, so shared tweets contradicted the
rejection screen itself, which already renders the real computeDoorTally
counts. Build the pool per share from the same tally so the two surfaces
always agree.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 23, 2026 11:26am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Rejection sharing now generates captions from the current applicant and admitted tallies. The caption pool formats applicant counts for en-US display, and the rejection screen passes the computed tally into caption selection. Jest coverage verifies dynamic values, formatting, and pool compatibility.

Changes

Rejection caption flow

Layer / File(s) Summary
Dynamic caption generation
src/components/Card/share-asset/rejectionCaptions.ts, src/components/Card/share-asset/__tests__/rejectionCaptions.test.ts
Captions are built per door tally, with formatted applicant and admitted counts; tests cover dynamic values, number formatting, and random selection compatibility.
Sharing flow wiring
src/components/Card/CardRejectionScreen.tsx
The rejection screen passes the computed applicant and admitted values into caption selection for sharing text.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing hardcoded stats in card rejection share captions with live values.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rejection-caption-live-tally

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 2017 ran, 0 failed, 0 skipped, 35.1s

📊 Coverage (unit)

metric %
statements 59.9%
branches 43.5%
functions 48.9%
lines 60.1%
⏱ 10 slowest test cases
time test
3.8s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.4s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.6s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.2s src/utils/__tests__/demo-balance.test.ts › debits and floors at zero
0.2s src/utils/__tests__/demo-balance.test.ts › resetDemoBalance refills and restarts the TTL window
0.2s src/utils/__tests__/demo-balance.test.ts › starts at the full balance on a fresh install and stamps a timestamp
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6230.89 → 6231.57 (+0.68)
Findings: 0 net (+0 new, -0 resolved)

@0xkkonrad

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@0xkkonrad
0xkkonrad marked this pull request as ready for review July 23, 2026 08:22
@0xkkonrad
0xkkonrad requested a review from Hugo0 July 23, 2026 08:22
Konrad's call: rather than interpolating the live tally into the share
caption, remove the fake-stats caption entirely ('213 tried, 7 got in')
and de-number 'rejection #1' → 'my first rejection'. A no-digits test
locks the invariant so stat-flavored captions can't sneak back in.
@0xkkonrad 0xkkonrad changed the title fix(card): build rejection-share captions from the live door tally fix(card): remove hardcoded-stats rejection-share captions Jul 23, 2026
@Hugo0
Hugo0 merged commit 0a52eac into dev Jul 23, 2026
18 of 20 checks passed
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