Skip to content

Add Errors/Insights tab split to the instant error overlay#94073

Merged
aurorascharff merged 17 commits into
canaryfrom
aurorascharff/instant-insights-tab
May 29, 2026
Merged

Add Errors/Insights tab split to the instant error overlay#94073
aurorascharff merged 17 commits into
canaryfrom
aurorascharff/instant-insights-tab

Conversation

@aurorascharff
Copy link
Copy Markdown
Contributor

@aurorascharff aurorascharff commented May 23, 2026

What?

Adds a tab bar to the dev overlay that separates normal errors ("Errors") from instant navigation errors ("Insights"). The indicator pill also reflects the split.

Why?

When unstable_instant validation produces navigation-phase errors alongside regular prerender errors, they were mixed into a single list. Developers had no way to tell which errors were structural instant-validation issues versus regular runtime/prerender errors.

Demo

How?

  • Errors splits runtimeErrors into normalErrors / instantErrors (using the existing inNavigation flag from getBlockingRouteErrorDetails) and defaults to whichever bucket has errors.
  • ErrorTabBar renders between the nav and dialog inside ErrorOverlayLayout (new tabBar prop). Empty tabs are disabled.
  • ErrorOverlay passes a key derived from the error composition so tab state resets when the shape changes (e.g. normal errors resolve).
  • RenderErrorContext gains instantErrorCount; the indicator pill shows "N Issues", "N Insights", or "N Issues · N Insights" accordingly.
  • Prerender errors show Blocking Route badge (red), navigation errors show Instant badge (amber).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

Tests Passed

Commit: 241f1cc

@aurorascharff aurorascharff marked this pull request as ready for review May 25, 2026 14:06
Copilot AI review requested due to automatic review settings May 25, 2026 14:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a tabbed "Errors" vs "Insights" split to the dev overlay, distinguishing navigation-phase unstable_instant validation errors from regular prerender/runtime errors. Navigation-phase blocking-route errors keep the amber Instant badge; all other prerender/metadata/viewport/sync-IO errors are relabeled Blocking Route. The indicator pill now reflects the same split ("Issues" / "Insights" / "Issues · Insights").

Changes:

  • New ErrorTabBar + isInstantNavigationError helper in container/errors.tsx, splitting runtimeErrors into normalErrors / instantErrors and scoping pagination to the active tab via a new tabBar prop on ErrorOverlayLayout.
  • RenderErrorContext and RenderRuntimeError expose a new instantErrorCount; next-logo.tsx uses it to drive the new pill label, data-insights-only state, and amber styling.
  • Test snapshots across cache-components/instant-validation suites updated from Instant to Blocking Route for prerender-phase errors; navigation-phase cases retain Instant.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/next/src/next-devtools/dev-overlay/container/errors.tsx Adds isInstantNavigationError, ErrorTabBar, tab state, label remapping, and tab-bar CSS.
packages/next/src/next-devtools/dev-overlay/container/errors.test.ts Tests for the new isInstantNavigationError helper.
packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx Exposes instantErrorCount derived from ready runtime errors.
packages/next/src/next-devtools/dev-overlay/dev-overlay.tsx Wires instantErrorCount through RenderErrorContext.
packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay/error-overlay.tsx Adds composition-based key to reset tab state when bucket presence changes.
packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-layout/error-overlay-layout.tsx Adds optional tabBar slot between nav and dialog.
packages/next/src/next-devtools/dev-overlay/components/errors/error-type-label/error-type-label.tsx Drops the blocking-page class for Blocking Route and removes redundant font rules from instant.
packages/next/src/next-devtools/dev-overlay/components/errors/error-message/error-message.tsx Extends no-truncate/instant styling to Blocking Route messages.
packages/next/src/next-devtools/dev-overlay/components/dialog/dialog.tsx Excludes new tab bar from click-outside dismissal.
packages/next/src/next-devtools/dev-overlay/components/devtools-indicator/next-logo.tsx New PillLabel/Plural helpers, insights-only amber styling, mixed-count label.
packages/next/.storybook/decorators/with-dev-overlay-contexts.tsx Provides default instantErrorCount: 0 for stories.
test/development/app-dir/cache-components-dev-errors/…, test/development/app-dir/cache-components-dev-fallback-validation/…, test/e2e/app-dir/cache-components-errors/…, test/e2e/app-dir/instant-validation/…, test/e2e/app-dir/instant-validation-level-manual-warning/…, test/e2e/app-dir/instant-validation-static-shells/… Update redbox label expectations from Instant to Blocking Route for prerender-phase cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/next/src/next-devtools/dev-overlay/container/errors.tsx Outdated
Comment thread packages/next/src/next-devtools/dev-overlay/container/errors.tsx
Comment thread packages/next/.storybook/decorators/with-dev-overlay-contexts.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

Stats cancelled

Commit: 241f1cc
View workflow run

yavorpunchev and others added 7 commits May 27, 2026 00:14
### What?

Refines the new Errors/Insights tab treatment in the dev overlay and
adds a Storybook scenario for exercising both tabs.

### Why?

The follow-up makes the pagination feel more coherent when switching
between issues and insights, and gives us a reliable Storybook case for
iterating on the tabbed UI.

### How?

- move the tab bar into the pagination area
- keep per-tab counts visible and let arrows page across tab boundaries
- thread the custom previous/next behavior through the overlay
nav/pagination components
- add a mixed issues/insights Storybook fixture and story

### Verification

- `pnpm --filter=next types`
- Not run: `pnpm storybook` (`not run in this session`)

<!-- NEXT_JS_LLM_PR -->

---------

Co-authored-by: Aurora Scharff <aurora.sofie@gmail.com>
### What?

Tweaks the mobile behavior of the error overlay nav so the controls can
scroll horizontally without breaking the version badge into multiple
lines.


https://github.com/user-attachments/assets/c3e91d6c-a303-4a04-9655-0ec005e2e9e7

### Why?

On narrow screens the nav content can overflow, and the Next.js version
badge was wrapping internally instead of staying intact while the nav
scrolled.

### How?

- allow the error overlay nav row to scroll horizontally on mobile
- add a small gap between the left and right nav groups
- keep the version status badge on a single line with `white-space:
nowrap`

### Verification

- `pnpm prettier --check
packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-nav/error-overlay-nav.tsx
packages/next/src/next-devtools/dev-overlay/components/version-staleness-info/version-staleness-info.tsx`
- Not run: `pnpm --filter=next types` (`not needed for these CSS-only
tweaks`)

<!-- NEXT_JS_LLM_PR -->
Wrap setActiveTab in startTransition so tab switches keep the previous
content visible until the new tab resolves, instead of flashing the
Suspense fallback and bouncing the panel height. Remove the now-unused
resetKey/skipTransition plumbing from Resizer and ErrorOverlayLayout.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

@aurorascharff aurorascharff merged commit 0846789 into canary May 29, 2026
300 of 303 checks passed
@aurorascharff aurorascharff deleted the aurorascharff/instant-insights-tab branch May 29, 2026 15:27
aurorascharff added a commit that referenced this pull request May 29, 2026
### What?

A focused dev-overlay redesign and CLI/build message refresh for the
"expected segment was not rendered" instant validation warning (PR
#93770). Now integrated with the Errors/Insights tab split from #94073.

### Why?

The wrapper carries no useful source location to point at — the
code-frame chrome and Call Stack the overlay rendered before were
misleading. Users mostly need to know which segment didn't render and
where to set `instant = false` to silence the warning.

### Demo

- [Demo
1](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/81-instant-wrapper-unrendered-segment)
- [Demo
2](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/82-nested-layouts-unrendered-segment)
- [Demo
3](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/83-conditional-render-unrendered-segment)
- [Demo
4](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/84-parallel-slot-unrendered-segment)

### How

- Restructured framework message in `dynamic-rendering.ts`: leads with
`Route "<path>":` prefix like every other validation factory, drops the
verbose paragraphs in favour of a one-sentence explanation + `Ways to
fix this:` list, and uses `instant` not `unstable_instant` in the fix
bullet.
- New `unrendered-segment` `GuidanceKind` and a dedicated case in
`errors.tsx` that drops the code-frame and Call Stack.
- New `UnrenderedSegmentInfo` component renders the route + each
unrendered file with the same chrome as `CodeFrame`, plus
open-in-editor.
- Two fix cards: `Render the missing segment` (render, gray) and `Allow
no validation` (silence, red).
- **Errors/Insights tab integration**: `isInstantNavigationError` now
returns `true` for unrendered-segment errors, so they appear under the
**Insights** tab with the amber pill (not the red Issues tab). They
clear on navigation like other instant errors. Added `renderTabBar` to
the unrendered-segment overlay layout.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Yavor Punchev <yavor.punchev@gmail.com>
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.

4 participants