Skip to content

chore: remove the /quests growth-campaign surface (TASK-22082) - #2908

Merged
kushagrasarathe merged 2 commits into
devfrom
chore/remove-quests
Sep 1, 2026
Merged

chore: remove the /quests growth-campaign surface (TASK-22082)#2908
kushagrasarathe merged 2 commits into
devfrom
chore/remove-quests

Conversation

@kushagrasarathe

@kushagrasarathe kushagrasarathe commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

The quests growth campaign is over. This PR removes the /quests surface from peanut-ui entirely: the route tree, the quests API service, and every inbound reference. Pure deletion — 30 files, ~+35/−1330.

Task

TASK-22082 — https://app.notion.com/p/3ce83811757981719552f04078b611da

What was removed

  • src/app/quests/** (15 files): pages (list, explore + loading, [questId]), layout, components (QuestCard, QuestsHero, QuestLeaderboard, UserRankCard, QuestArrowCta, QuestHeroDecoration), hooks (useQuests), constants, types, footer test.
  • src/services/quests.ts — orphaned by the deletion (only consumer was useQuests).
  • EN_LANDING_STRINGS export in landingStrings.ts — orphaned (only consumer was the quests page).
  • Inbound references: seo-route-policy.js (noindex + robots-disallow lists), constants/routes.ts DEDICATED_ROUTES, support-context.ts identifier prefixes, scripts/native-build.js export exclusions, locale-switcher doc comment + test row, friendly-error test row, stale comments (Manteca, PartnerLockup, landingContentHrefs, demo-api).

Redirects (decision)

Campaign links to /quests may exist in the wild, so instead of letting them 404:

  • /quests and /quests/:path*/ (non-permanent, in redirects.json)
  • /devconnect (previously → /quests) → /
  • Native App Links don't use redirects.json, so 'quests' is kept reserved in STATIC_REDIRECT_ROUTES (the list for redirect-handled slugs). The deep-link mapper returns null and the in-app browser opens the web URL, which redirects home — same behavior as every other retired slug (/pints, /foodie). Exact + nested-path tests added.

Deliberately kept

  • src/types/api.generated.ts / api.openapi.json keep the /quests/* endpoints — they mirror the backend openapi snapshot and are gated by check:api. Removing them here would create drift.
  • Dev DS audit datasets (src/app/(mobile-ui)/dev/ds/audit/**) mention quests file paths in prose/data — they are point-in-time audit records, not live references.

Other flags

  • No quests scenario exists in mono engineering/qa/ui/scenarios.mjs — nothing to prune there.
  • Mono content follow-up (separate, via update-content, never bundled here): help/blog pages claiming points are "used for leaderboards" go stale — product/rewards.md, content/help/rewards-*, content/blog/rewards-v2-the-receipts/*. Legal (content/legal/) verified clean — pure surface deletion, no data-flow change.

Cross-repo note

⚠️ peanut-api-ts still serves GET /quests/leaderboards and GET /quests/{questId}/leaderboard. No FE consumer remains after this PR. Backend removal is a separate peanut-api-ts task — not bundled here.

Recovery

quests last existed at a3a7ed22f1de6a64a1b6add866a85c99029a07ba (the parent of the deletion commit). To restore:

git checkout a3a7ed22f1de6a64a1b6add866a85c99029a07ba -- src/app/quests src/services/quests.ts

plus revert the reference edits this PR makes.

Full deleted-file list
  • src/app/quests/[questId]/page.tsx
  • src/app/quests/tests/footer.test.tsx
  • src/app/quests/components/QuestArrowCta.tsx
  • src/app/quests/components/QuestCard.tsx
  • src/app/quests/components/QuestHeroDecoration.tsx
  • src/app/quests/components/QuestLeaderboard.tsx
  • src/app/quests/components/QuestsHero.tsx
  • src/app/quests/components/UserRankCard.tsx
  • src/app/quests/constants.ts
  • src/app/quests/explore/loading.tsx
  • src/app/quests/explore/page.tsx
  • src/app/quests/hooks/useQuests.ts
  • src/app/quests/layout.tsx
  • src/app/quests/page.tsx
  • src/app/quests/types.ts
  • src/services/quests.ts

QA

  • npm run typecheck clean, npm test 392 suites / 4984 passed, npm run build green, pnpm prettier --check . clean.
  • node scripts/ds-lint-counts.mjs --check — ratchet ok, counts dropped (rawHex 65→61, rawHexFiles 41→37, stockTextSize 362→275, nonDsClassesInViews 138→122, useSearchParamsFiles 47→44). Baseline json untouched.
  • No surviving page links to /quests (grepped src/, e2e/, config) — no visual change to any remaining screen.

Screenshots: N/A (pure deletion; no surviving surface changes)

The quests campaign is over. Delete the route tree (src/app/quests/**),
the quests API service, and every inbound reference: seo-route-policy,
dedicated-routes list, support-context prefixes, native-build exclusions,
locale-switcher docs/tests, landing-page comments, and the now-orphaned
EN_LANDING_STRINGS export. /quests and /quests/* now redirect to / so
campaign links in the wild land safely (/devconnect follows).

quests last existed at a3a7ed2.
To restore: git checkout a3a7ed2 -- src/app/quests src/services/quests.ts
(plus revert the reference edits in this commit).

Claude-Session: https://claude.ai/code/session_01LkJHBTT8SiJLfHe7T4wm17
@notion-workspace

Copy link
Copy Markdown

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Sep 1, 2026 3:37pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7153.05 → 7076.86 (-76.19)
Findings: -41 net (+2 new, -43 resolved)

🆕 New findings (2)

  • medium high-mdd — src/components/LandingPage/landingStrings.ts:46 — landingStrings: MDD 24.6 (uses across many lines from declarations)
  • medium complexity — src/components/LandingPage/landingStrings.ts — CC 2, MI 53.27, SLOC 48

✅ Resolved (43)

  • src/services/quests.ts — CC 9, MI 43.49, SLOC 39
  • src/app/quests/components/QuestsHero.tsx:32 — QuestsHero: MDD 84.7 (uses across many lines from declarations)
  • src/app/quests/explore/page.tsx:17 — QuestsExplorePage: MDD 75.9 (uses across many lines from declarations)
  • src/app/quests/[questId]/page.tsx:22 — QuestDetailPage: MDD 59.5 (uses across many lines from declarations)
  • src/app/quests/components/QuestCard.tsx:30 — QuestCard: MDD 48.0 (uses across many lines from declarations)
  • src/app/quests/page.tsx:12 — QuestsPage: MDD 46.5 (uses across many lines from declarations)
  • src/app/quests/explore/page.tsx:91 — : MDD 46.1 (uses across many lines from declarations)
  • src/app/quests/components/QuestLeaderboard.tsx:16 — QuestLeaderboard: MDD 30.5 (uses across many lines from declarations)
  • app/quests/components/QuestsHero.tsx:41 — 30 duplicate lines / 164 tokens with app/quests/explore/page.tsx:26
  • src/app/quests/explore/page.tsx — CC 27, MI 60.98, SLOC 57
  • src/components/LandingPage/landingStrings.ts:47 — landingStrings: MDD 24.6 (uses across many lines from declarations)
  • src/app/quests/components/QuestCard.tsx — CC 24, MI 65.7, SLOC 27
  • src/app/quests/[questId]/page.tsx — CC 18, MI 59.48, SLOC 51
  • src/app/quests/explore/page.tsx:91 — CC 17 SLOC 10
  • src/app/quests/components/QuestsHero.tsx — CC 12, MI 60.97, SLOC 53
  • src/app/quests/hooks/useQuests.ts — CC 11, MI 63.45, SLOC 38
  • src/app/quests/components/QuestHeroDecoration.tsx — CC 10, MI 62.94, SLOC 50
  • src/app/quests/constants.ts — CC 4, MI 54.79, SLOC 41
  • src/app/quests/page.tsx — CC 2, MI 61.11, SLOC 23
  • src/components/LandingPage/landingStrings.ts — CC 2, MI 51.88, SLOC 50

…and 23 more.

📈 Painscore deltas (top movers)

File Before After Δ
src/app/quests/layout.tsx 2.4 0.0 -2.4
src/app/quests/components/QuestArrowCta.tsx 3.5 0.0 -3.5
src/app/quests/constants.ts 4.5 0.0 -4.5
src/app/quests/hooks/useQuests.ts 4.5 0.0 -4.5
src/app/quests/components/QuestHeroDecoration.tsx 5.6 0.0 -5.6
src/app/quests/components/QuestLeaderboard.tsx 5.9 0.0 -5.9
src/app/quests/components/UserRankCard.tsx 6.5 0.0 -6.5
src/app/quests/components/QuestsHero.tsx 6.7 0.0 -6.7
src/services/quests.ts 6.8 0.0 -6.8
src/app/quests/[questId]/page.tsx 7.0 0.0 -7.0
src/app/quests/components/QuestCard.tsx 7.2 0.0 -7.2
src/app/quests/explore/page.tsx 7.6 0.0 -7.6
src/app/quests/page.tsx 8.0 0.0 -8.0

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 4994 ran, 0 failed, 0 skipped, 1.6m

📊 Coverage (unit)

metric %
statements 74.0%
branches 60.0%
functions 66.1%
lines 75.1%
⏱ 10 slowest test cases
time test
4.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
2.1s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › the change cooldown shows its date and blocks changing to another country, not re-saving
1.7s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › prefers the server value over a stale device mirror
1.7s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › moving to a country in neither slot leaves the second document alone
1.6s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › saves the declared residence, refetches, and closes
1.3s src/components/Setup/Views/__tests__/Residence.test.tsx › shows the per-country availability comparison with the truth-first guidance
1.3s src/components/Setup/Views/__tests__/Residence.test.tsx › returns to the selector from the heads-up
1.3s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › swaps from the server value with no device mirror at all
1.0s src/hooks/query/__tests__/user.test.tsx › does NOT clear a token that rotated mid-request (stale 401 racing a fresh login)
1.0s src/components/Profile/views/__tests__/ResidenceChangeModal.test.tsx › promoting the second document country swaps the pair instead of dropping one
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — changes requested

Request changes: retiring /quests breaks existing campaign links when opened as native App Links; web redirects and the remaining deletion are otherwise sound.

Findings

  • MAJOR · src/constants/routes.ts:33 · Keep the retired route out of native recipient routing
    Native App Links do not use redirects.json; deepLinkToNativePath classifies paths through RESERVED_ROUTES. After this deletion, https://peanut.me/quests maps to /profile/view?username=quests, while /quests/example maps to /send?recipient=quests%2Fexample, so campaign links opened in the installed app bypass the intended homepage redirect. Keep quests reserved and add an explicit native retirement mapping (for example /home) with exact and nested-path tests.

Checked clean

  • HEAD and merge base matched the supplied SHAs; PR author, base, and metadata matched the trusted request.
  • Web redirects parse correctly and cover exact and nested /quests paths.
  • The quest route tree, API service, exports, SEO entries, support context, locale test row, and native-build exclusions were removed without live imports.
  • Native App Link and catch-all classification were evaluated at the exact head; the surviving defect is reported above.
  • Security review found no new external redirect, secret exposure, authorization change, or money or data mutation.
  • Required CI aggregate, unit, typecheck, ESLint, format, design-system lint, and deploy preview checks succeeded; ds-shots was still running.
  • The slop pass found only inert ESLint allowlist entries for three deleted quest files beyond the reported runtime defect.

Second opinion skipped: daily-budget-reached.

Exact head: 8abc11b6cb03 · Context: repo

Comment thread src/constants/routes.ts
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: e74fd707-8955-4846-b410-58e94da4be12

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

…slint entries

Chip review: native App Links classify paths through RESERVED_ROUTES, not
redirects.json — with 'quests' unlisted, peanut.me/quests read as a recipient
username in the installed app. Reserve it in STATIC_REDIRECT_ROUTES (the list
for redirect-handled slugs), so the native mapper returns null and the in-app
browser opens the web URL, which redirects home. Tests cover exact and nested
paths. Also remove the eslint allowlist entries for three deleted quest files.

Claude-Session: https://claude.ai/code/session_01LkJHBTT8SiJLfHe7T4wm17
@kushagrasarathe

Copy link
Copy Markdown
Contributor Author

Readiness report

What & why: removes the finished /quests growth-campaign surface — route tree, service, orphans, all inbound refs. −1330 LoC.
Risk: low. Live campaign links covered on web (redirects.json → /) and native (reserved slug → in-app browser → redirect). BE /quests/* endpoints keep serving with zero FE consumers — separate peanut-api-ts task.

  • Gates: CI green on e98d4f053 (round-1 ds-shots fail was a /dev/ds sweep timeout flake, passed on rerun) · eslint green (allowlist shrank) · ds-lint ratchet legal, counts dropped: rawHex 65→61, rawHexFiles 41→37, stockTextSize 362→275, nonDsClassesInViews 138→122, useSearchParamsFiles 47→44 (baseline json untouched)
  • Chip: round-1 MAJOR (native deep-link recipient misclassification) fixed at e98d4f053 + slop finding (inert eslint entries) fixed; thread replied + resolved. Chip re-review of e98d4f053 pending — the check still carries the round-1 state.
  • Tested: typecheck clean · 392 suites / 4984 tests pass · prod build green · new exact+nested deep-link tests
  • Screenshots: N/A (pure deletion; no surviving surface changes — no page linked to /quests)
  • Smells: adds none; reveals Manteca's now-unused cream default (comment fixed, not worth a follow-up)
  • Docs: legal clean; leaderboard claims in product/rewards.md + content/help/rewards-* + rewards-v2 blog go stale → separate update-content follow-up
  • Recovery: quests last existed at a3a7ed22f1de6a64a1b6add866a85c99029a07ba (see PR body)

Parked for Kush's own review — no reviewer requested, do not merge from automation.

@kushagrasarathe
kushagrasarathe marked this pull request as ready for review September 1, 2026 16:01

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — no blocking findings — this is not an approval

The quests surface is removed cleanly. Prior finding P1 is fixed: retired quests links remain reserved and no longer enter native recipient routing.

Checked clean

  • Pinned head, supplied base, merge base, trusted author, and dev target all matched.
  • Prior finding P1 is fixed: quests moved from DEDICATED_ROUTES to STATIC_REDIRECT_ROUTES, and native exact and nested links now return null with regression coverage.
  • Web redirects cover /quests, /quests/:path*, and /devconnect without a redirect chain.
  • Deleted pages, components, service code, and live references were removed; generated API snapshots and point-in-time audit data remain intentionally unchanged.
  • SEO, locale-switcher, native-build, support-context, demo, and ESLint cleanup matched the removed surface.
  • Exact-head analyze and review CI checks passed; the preview deployment was still running when checked.

Second opinion by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only, so treat its findings as advice.

Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

Exact head: e98d4f053043 · Context: repo

@kushagrasarathe
kushagrasarathe merged commit eeb28a3 into dev Sep 1, 2026
26 of 28 checks passed
@chip-peanut-bot

Copy link
Copy Markdown
Contributor

This pull request was already closed when the review finished, so these findings are follow-up work rather than a gate.

Chip review — no blocking findings — this is not an approval

The quests surface is removed cleanly. Prior finding P1 is resolved: retired quests links remain reserved and cannot enter native recipient routing.

Checked clean

  • Pinned head, supplied base, merge base, trusted author, and dev target all matched.
  • Prior finding P1 is fixed: quests moved from DEDICATED_ROUTES to STATIC_REDIRECT_ROUTES, and native exact and nested links return null with regression coverage.
  • Web redirects cover /quests, /quests/:path*, and /devconnect without a redirect chain.
  • Deleted pages, components, service code, and live imports were removed; generated API snapshots and point-in-time audit data remain intentionally unchanged.
  • SEO, locale-switcher, native-build, support-context, demo, and ESLint cleanup matched the removed surface.
  • All applicable exact-head CI checks completed successfully.

Second opinion by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only, so treat its findings as advice.

Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

Exact head: e98d4f053043 · Context: repo · Took 6m (queued 27m)

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