fix(ui): toolbar tabs unresponsive on static builds when landing with a toolbar-panel param#3645
Merged
Merged
Conversation
On statically built previews, router.push with a query-only change silently no-ops when the page was initially loaded with a query param the prerender didn't include, leaving the toolbar tabs unresponsive. The panel is client-side UI state, so use window.history.pushState (Next's supported shallow routing, which keeps useSearchParams in sync) instead of a router navigation. This also skips the RSC round-trip and the scroll-to-top on every tab switch.
🦋 Changeset detectedLatest commit: af859c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Fixes static-build toolbar tab navigation by replacing router.push with window.history.pushState. Change is small, isolated, client-side only, and well-tested.
Re-trigger cubic
gabrielmfern
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On statically built previews (
email-dev build+start), opening a preview URL that already carries a?toolbar-panel=...query param left the toolbar tabs unresponsive: clicking any tab did nothing until a navigation succeeded from a clean URL first. The cause is thatrouter.pushwith a query-only change silently no-ops in that state — the page was prerendered without search params, so the App Router has nothing to re-fetch for the same pathname. The dev server was unaffected.The toolbar panel is purely client-side UI state, so this switches
setActivePanelValueto shallow routing viawindow.history.pushState, which Next officially supports and keepsuseSearchParamsin sync. Besides fixing the static-build case, this drops the RSC round-trip and the scroll-to-top thatrouter.pushincurred on every tab switch.Verified on a static demo build: landing on
?toolbar-panel=linterand switching tabs now updates the URL and panel, browser back/forward restores the previous tab, and the dev server behaves the same as before. Full@react-email/uisuite passes.Related: surfaced while testing #3644, which makes the Props tab visible on static builds, but the bug reproduces on canary without it.
Summary by cubic
Fixes unresponsive toolbar tabs on statically built previews when the page loads with a
?toolbar-panel=...param. Switches tab changes to shallow routing viawindow.history.pushState, keepinguseSearchParamsin sync, preserving URL/back/forward, and avoiding an RSC round-trip and scroll-to-top.Written for commit af859c2. Summary will update on new commits.