Toast Catalog — Phase 2 Implementation Plan
Branch: feat/toast-catalog-phase2 off origin/dev (has #1040 catalog + #1058).
Goal: Finish the betting-toast catalog sweep — (A) remove the dead legacy slip chain, (B) migrate the remaining LIVE betting toasts onto the catalog, aligning copy/tone with the inline flow.
Scope decisions (from the user)
- Betting-domain only. Admin/ops CRUD toasts (~180) are OUT — one-off strings, no catalog value.
- Remove dead code in this PR (verified unmounted; superseded by the inline flow).
- Align live slip copy with the inline flow's newer copy (UX change on desktop, product-approved).
Global Constraints
- No fabricated/defaulted financial/domain values (§1). Preserve money/identity fields.
- Catalog modules stay pure (type-only imports). Dispatch via
toast.show(descriptor). - Deletion: before removing each file, re-confirm zero LIVE importers. NEVER delete a shared helper (
LimitsLine,OpenBetsTab,BetSlipCard,SwipeToConfirmare shared — keep). - Verify:
npm test+npx tsc --noEmitclean after each task.
Task A — Remove the dead legacy slip chain
Verified dead (closed subgraph — the only importers of each are other dead files; roots BetPanelMobile + StrykrBetPanelMobile have zero mounts):
- Delete:
strykr-fe/src/components/betting/StrykrBetPanelMobile.tsx - Delete:
strykr-fe/src/components/betting/BetPanelMobile.tsx - Delete:
strykr-fe/src/components/betting/StrykrBetSlipTab.tsx - Delete:
strykr-fe/src/components/betting/StrykrBetSlipFooter.tsx - Delete:
strykr-fe/src/components/betting/StrykrBetSlipCard.tsx(orphaned — imported only by StrykrBetSlipTab)
Keep (shared / live): BetPanel (live, MainLayout), BetSlipTab + BetSlipFooter (live via BetPanel — Task B migrates them), OpenBetsTab, BetSlipCard, LimitsLine, SwipeToConfirm (used by admin/transfers).
- Confirm each of the 5 has zero live importers (grep), delete them.
-
npx tsc --noEmitclean (no dangling imports);npm testgreen. - Commit:
chore(betting): remove dead legacy slip chain (StrykrBetSlip*/*PanelMobile, superseded by inline)
Task B — Migrate live betting toasts to the catalog (align with inline flow)
Live targets: BetSlipFooter.tsx (9), BetSlipTab.tsx (1), InlineBetSlip.tsx (6 leftover non-Excel).
Alignment conventions (from #1040 inline decisions):
- Success, exchange/BF (rests) → yellow tick "Bet Accepted - Awaiting Match" (
messages.placement.betAccepted). - Success, bookmaker/BM (instant) → green tick "Bet Placed Successfully!" (
messages.placement.betPlacedFancy). - Placement failure → red "Unexpected Error" (
messages.placement.failure). - Stake-validation → inline caption, not a toast, where the surface supports it.
- Reuse existing catalog entries where semantics match; add new
messages.placement.*entries (with tests) for batch-specific cases, preserving the batch count and matching the tone/color above.
Steps:
- Read
BetSlipFooter.tsxfully; map each of its 9 toasts → an existing catalog entry or a new one. Batch cases (multi-bet "N placed", "X placed, Y failed") get newmessages.placement.*entries following the conventions; single-bet cases reuse the inline entries. Propose the mapping in the report for review. - Migrate
BetSlipTab.tsx"Cleared N bets" → a catalog entry (e.g.messages.placement.cleared(n)). - Migrate the 6
InlineBetSlipleftovers (odds-unavailable / invalid-odds / unable-to-place) → catalog entries (newmessages.placement.oddsUnavailable/invalidOdds/unavailable), dispatched viatoast.show. - Add
.test.mjscoverage for every new catalog entry. - Replace all raw
toast.success/error/warning/infoin these three files withtoast.show(messages.placement.*). Confirm zero rawtoast.*betting call sites remain (grep). - Verify:
node --test(catalog),npm testfull,npx tsc --noEmitclean. - Commit:
feat(messages): migrate live betslip-footer/tab + inline leftovers onto the catalog
Verification (whole PR)
npm test+tscclean;git grep -nE "toast\.(success|error|warning|info)\(" src/components/bettingreturns nothing (all betting toasts now go through the catalog).- Manual/desktop: BetPanel placement toasts render with the aligned copy.
Out of scope / follow-ups
- Admin/ops CRUD toasts (~180) — not catalog-migrated; the repeated
err?.response?.data...||'Failed'pattern could get a shared helper in a separate cleanup.