Skip to content

chore(layout): remove redundant shadcn Toaster — Sonner is the sole toast system - #250

Draft
dccakes wants to merge 1 commit into
mainfrom
claude/sharp-feynman-nrt2f4
Draft

dccakes wants to merge 1 commit into
mainfrom
claude/sharp-feynman-nrt2f4

Conversation

@dccakes

@dccakes dccakes commented Aug 12, 2026

Copy link
Copy Markdown
Owner

📝 TLDR

Remove the unused shadcn/Radix <Toaster /> from the root layout; Sonner's <SonnerToaster> is already the sole active toast system.

📝 Description

The root layout mounted two toast providers side-by-side: the shadcn/Radix <Toaster /> and Sonner's <SonnerToaster>. A grep of the entire codebase confirmed that useToast() — the hook that feeds the Radix toaster — is only referenced in dead code under src/components/old_dashboard/. Every active feature drives toasts through Sonner's toast() directly. The Radix toaster was hydrating an unused viewport slot on every page load with no consumer.

This Change

  • Removes import { Toaster } from '~/components/ui/toaster' from src/app/layout.tsx
  • Removes the <Toaster /> JSX element from the root layout body
  • <SonnerToaster richColors position='top-right' /> remains as the single, consistent toast provider

🗂️ Daily Product Improvement Run — 2026-08-12

Recommendations Reviewed

# Area Finding Size Priority
1 Layout Dual toast providers: shadcn <Toaster> mounted alongside Sonner but never invoked — dead hydration on every page S High
2 Events loading.tsx Loading skeleton shows 1 toolbar button but the real page renders 2 ("General RSVP questions" + "Create Event") — layout shift on load S Medium
3 Vendor card Star rating <button> has text-sm (~14 px) touch target — well below WCAG 44 px minimum; accessibility regression risk M Medium
4 Vendor card Ratings breakdown popover has no click-outside handler — once opened it can only be closed by clicking the toggle button again S Low
5 quote-form / expense-form toDateInputValue duplicated with divergent timezone behaviour (UTC slice vs. local getters) — silent date-off-by-one bug risk M Medium
6 Icon library consistency Vendor detail panel mixes Lucide icons with raw Unicode emoji (★, ☆, ✕) — visual inconsistency across dark/light themes M Low

Selected Improvement

#1 — Remove redundant shadcn <Toaster /> from root layout

Why This Was Selected

  • Smallest possible footprint (2-line deletion, zero risk of behaviour change)
  • Eliminates dead React tree hydration on every page load
  • Consolidates the app on a single toast system, removing a confusing artefact that could mislead future contributors into wiring up useToast
  • Not covered by any of the 31 existing open draft PRs

Changes Made

Removed the Toaster import and JSX element from src/app/layout.tsx. SonnerToaster (already present) is the only active toast provider.

Files Changed

  • src/app/layout.tsx — 2 lines deleted (import + JSX element)

Verification

  • npx tsc --noEmit passes (only pre-existing baseUrl deprecation warning, unrelated to this change)
  • Grep confirms useToast is referenced only in src/hooks/use-toast.ts, src/components/ui/toaster.tsx, and the dead old_dashboard components — no active feature depends on it

Future Recommendations

# Area Finding Suggested action
2 Events loading.tsx Skeleton shows 1 toolbar button; page renders 2 Add second <Skeleton className='h-9 w-36' /> to match "General RSVP questions" button
3 Vendor card Star rating buttons have ~14 px touch target Increase to min-h-[44px] min-w-[44px] or wrap in a larger hit-area container
4 Vendor card Ratings breakdown panel has no click-outside close Add useEffect with a mousedown listener or use a Radix Popover
5 quote-form / expense-form toDateInputValue duplicated with UTC vs. local-time divergence Extract a single shared util using date-fns format(date, 'yyyy-MM-dd') in local time
6 Vendor UI Mixed Lucide icons and Unicode emoji (★, ☆, ✕) Replace ★/☆ with <Star> from lucide-react (filled/outline variants); replace ✕ with <X> (already imported in vendor-card)

GitHub Issues Created

None — all remaining items are Small/Medium scope suitable for future daily improvement runs.


🧪 Testing

  • Added/updated tests
  • Manually tested functionality — confirmed no active component calls useToast; Sonner toasts continue to work

🧪 How to test as a user

  1. Load any authenticated page (e.g. /vendors, /budget)
  2. Trigger any action that produces a toast (add a vendor, update a quote, etc.)
  3. Verify the Sonner toast appears top-right as before
  4. Verify no second toast viewport or ghost element appears in the DOM

📚 Documentation

  • No documentation changes needed

🎨 Style and code quality

  • TypeScript check passes (npx tsc --noEmit)

📦 Dependencies

  • No dependency changes

Generated by Claude Code

…oast system

The shadcn/Radix <Toaster /> was mounted in the root layout alongside
<SonnerToaster>, but no active component ever calls useToast(). Every
feature in the app uses sonner's toast() directly, making the Radix
provider dead weight that hydrates an unused viewport slot on every page.

Remove the import and JSX element; <SonnerToaster richColors position="top-right" />
remains as the single, consistent toast system.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
scv Error Error Aug 12, 2026 10:29am

@github-actions

Copy link
Copy Markdown
Contributor

Jest Test Coverage

Coverage Summary

Lines Statements Branches Functions
Coverage: 81%
81.71% (35129/42990) 82.92% (3734/4503) 68.04% (1037/1524)

This branch had an error being deployed

1 failed deployment
Preview — 42d3f48a Deployed Aug 12, 2026 by vercel[bot]
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