Skip to content

fix: raise free print cap to 1000 and surface count + upgrade path#2477

Merged
aalemayhu merged 1 commit into
mainfrom
fix/print-cap-1000-and-friendlier-errors
May 20, 2026
Merged

fix: raise free print cap to 1000 and surface count + upgrade path#2477
aalemayhu merged 1 commit into
mainfrom
fix/print-cap-1000-and-friendlier-errors

Conversation

@aalemayhu
Copy link
Copy Markdown
Contributor

@aalemayhu aalemayhu commented May 20, 2026

Summary

  • Raise free PDF print cap from 500 -> 1000 cards (MAX_CARDS in ExportApkgToPdfUseCase.ts)
  • /print failure: stop replacing the server's specific "This deck has N cards. PDF export supports up to M cards." message with a vague string. Render it verbatim and append an inline <Link to="/pricing">Upgrade for unlimited</Link> on the card-limit error only.
  • /upload: when a user drops an existing .apkg, the error now nudges them inline to Print Decks (/print) instead of a dead end.
  • Update print-export.md and common-problems.md to match the new cap and the new in-product link.

Why

A free user (thankyouprofessor21@gmail.com, 9/100 conv cards used) tried /print for the first time, hit the 500-cap, and saw "This deck is too large to print right now. Try a deck with fewer cards." — no count, no cap, no upgrade hook. Felt broken. Trio (pm/designer/engineer) agreed:

  • Cap 500 -> 1000 (round number, ~10x conv cap, covers semester decks, stays under Puppeteer OOM risk)
  • Don't surface the cap pre-upload — the existing "1 free PDF this month. Subscribe for unlimited." subhead is enough
  • Show the count + cap + upgrade path at failure time, inline, not a paywall card
  • Same nudge pattern on the upload page when a user drops an existing .apkg

Test plan

  • pnpm test src/usecases/apkg/ExportApkgToPdfUseCase.test.ts — boundary moved from 501 to 1001 cards
  • pnpm --filter 2anki-web test:run — new PrintForm.test.tsx covers (a) card-limit response renders server message verbatim + Upgrade link, (b) corrupted-file response renders the friendly corrupted message and no upgrade link
  • pnpm --filter 2anki-web typecheck clean
  • pnpm --filter 2anki-web lint clean
  • npx tsc --noEmit clean
  • Visual: drop a >1000-card deck on /print, confirm count + cap message + Upgrade link
  • Visual: drop a .apkg on /upload, confirm "Try Print Decks" link appears

🤖 Generated with Claude Code


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

The "too large" failure on /print used to swallow the server's specific
"This deck has N cards. PDF export supports up to M cards." message and
replace it with a vague one-liner, with no upgrade link. First-time
free users hit the 500-card cap with no idea what went wrong.

- Bump MAX_CARDS 500 -> 1000 (covers semester-sized decks; 2x cap)
- Let the server's specific count/cap message render verbatim on /print
- Append an inline "Upgrade for unlimited" link (-> /pricing) on the
  card-limit error only
- /upload: when a user drops an existing .apkg, the error now points
  them to Print Decks instead of a dead end
- Docs: update print-export and common-problems to match the new cap
  and the new in-product link

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for notion2anki ready!

Name Link
🔨 Latest commit 9152578
🔍 Latest deploy log https://app.netlify.com/projects/notion2anki/deploys/6a0d4c857a20ec0008f35867
😎 Deploy Preview https://deploy-preview-2477--notion2anki.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aalemayhu aalemayhu marked this pull request as ready for review May 20, 2026 05:55
@aalemayhu aalemayhu merged commit 730a4bc into main May 20, 2026
13 checks passed
@aalemayhu aalemayhu deleted the fix/print-cap-1000-and-friendlier-errors branch May 20, 2026 05:56
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant