Skip to content

fix(settings): wrap useSearchParams pages in Suspense so navigation works in prod#399

Merged
ArnasDon merged 1 commit into
mainfrom
fix/settings-nav-suspense
Jul 17, 2026
Merged

fix(settings): wrap useSearchParams pages in Suspense so navigation works in prod#399
ArnasDon merged 1 commit into
mainfrom
fix/settings-nav-suspense

Conversation

@ArnasDon

Copy link
Copy Markdown
Owner

What & why

Opening Settings → WhatsApp (e.g. via the account menu, which links to /settings?tab=whatsapp) left the page locked on the WhatsApp panel — clicking any other rail section did nothing.

Root cause

The settings page derives its active panel from useSearchParams() but wasn't wrapped in a <Suspense> boundary. In Next 16 that:

  • fails the production build with useSearchParams() should be wrapped in a suspense boundary … missing-suspense-with-csr-bailout, and
  • forces the page to bail to full client-side rendering, shipping a settings screen whose rail click handlers never wire up.

Since the entry link targets ?tab=whatsapp, you land on WhatsApp and can't leave. next dev renders on-demand and papers over this, so it only shows up in a production build/deploy.

login/signup already wrap useSearchParams in <Suspense>; settings, inbox, and automations/new did not — so all three broke the build.

Changes

  • Wrap the useSearchParams consumer in <Suspense> on settings, inbox, and automations/new (thin wrapper + *Inner component, matching login/signup).
  • Add the missing Settings.sections.quick-replies translation key (the rail was rendering the raw key Settings.sections.quick-replies).

Verification

  • Before: next build errors out during static generation on these pages.
  • After: next build succeeds (✓ Generating static pages 51/51); ran the production server and confirmed every settings rail section navigates to its correct panel, and the rail shows "Quick replies".

Follow-up (not in this PR)

The WhatsApp panel's setup-instruction strings (Settings.whatsapp.step3_2step4_4) embed <strong class="…"> inside dangerouslySetInnerHTML={{ __html: t(...) }}, which next-intl can't parse (INVALID_TAG) — cosmetic, tracked separately.

🤖 Generated with Claude Code

… prod

The settings page derived its active panel from `useSearchParams()` but
wasn't wrapped in a Suspense boundary. In Next 16 that fails the
production build ("missing Suspense with CSR bailout") and forces the
page to bail to full client-side rendering — shipping a settings screen
whose rail click handlers never wire up. Because the account-menu
Settings link targets `?tab=whatsapp`, users land on the WhatsApp panel
and can't navigate to any other section ("locked on WhatsApp").

Wrap the `useSearchParams` consumer in `<Suspense>` on the three
affected dashboard pages — settings, inbox, automations/new — mirroring
the split login/signup already use. Also add the missing
`Settings.sections.quick-replies` label, which was rendering as a raw
translation key in the settings rail.

Verified: production build now succeeds (previously errored out during
static generation); every settings rail section navigates correctly in a
production build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project crxylxakpapcfziradbb because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@ArnasDon
ArnasDon merged commit b24aa79 into main Jul 17, 2026
2 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.

1 participant