Skip to content

Commit 495c318

Browse files
yavorpunchevaurorascharffcursoragent
authored
Redesign dev overlay: cleaner shell + instant fix-card guidance (#93755)
## Summary ### Error overlay shell - Clean up nav, dialog frame, footer placement, and button styles across the overlay - Remove unused `fader` and notch components - Tighten layout spacing throughout the dialog ### Instant error guidance (fix cards) - New data-driven fix-card grid for instant errors: each card has a `group` (Stream / Cache / Block / Static / Dynamic / Client / Defer / Measure / Prerender), an icon, a color, and an optional docs link - Whole card is clickable when a docs link is present, with an always-visible external-link indicator - Centralized group metadata (label / color / icon) in `instant-guidance-data.ts` so cards stay consistent across the overlay and the docs surface - Outlined SVG icons live in a dedicated `fix-card-icons.tsx` - Snippets refined: cache cards trimmed to 3 lines, client sync-IO defer cards use block-body arrow syntax so longer expressions don't overflow ### Code frame - Restore the red bar / caret on the errored line (parser previously only matched storybook synthetic frames) - Fix caret alignment with `codeFrameColumns` output - Style inline error code snippets ### Storybook & examples - Add error examples and instant-error fixtures for development/testing - Align all 11 instant storybook fixtures with canary factory output and the matching test-app routes --------- Co-authored-by: Aurora Scharff <aurora.sofie@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Aurora Scharff <66901228+aurorascharff@users.noreply.github.com>
1 parent f3f56ec commit 495c318

58 files changed

Lines changed: 1724 additions & 995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/next/src/next-devtools/dev-overlay/storybook/use-overlay-reducer.ts renamed to packages/next/.storybook/decorators/use-overlay-reducer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import type { DispatcherEvent, OverlayState } from '../shared'
1+
import type {
2+
DispatcherEvent,
3+
OverlayState,
4+
} from '../../src/next-devtools/dev-overlay/shared'
25

36
import { useReducer } from 'react'
47
import {
@@ -29,7 +32,7 @@ import {
2932
ACTION_UNHANDLED_REJECTION,
3033
ACTION_VERSION_INFO,
3134
INITIAL_OVERLAY_STATE,
32-
} from '../shared'
35+
} from '../../src/next-devtools/dev-overlay/shared'
3336

3437
export const storybookDefaultOverlayState: OverlayState = {
3538
...INITIAL_OVERLAY_STATE,

packages/next/src/next-devtools/dev-overlay/storybook/with-dev-overlay-contexts.tsx renamed to packages/next/.storybook/decorators/with-dev-overlay-contexts.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ import { useRef, useState, type Dispatch, type SetStateAction } from 'react'
22
import {
33
DevOverlayContext,
44
useDevOverlayContext,
5-
} from '../../dev-overlay.browser'
6-
import { RenderErrorContext } from '../dev-overlay'
7-
import { PanelRouterContext, type PanelStateKind } from '../menu/context'
8-
import { INITIAL_OVERLAY_STATE } from '../shared'
9-
import type { OverlayState, DispatcherEvent } from '../shared'
10-
import type { ReadyRuntimeError } from '../utils/get-error-by-type'
5+
} from '../../src/next-devtools/dev-overlay.browser'
6+
import { RenderErrorContext } from '../../src/next-devtools/dev-overlay/dev-overlay'
7+
import {
8+
PanelRouterContext,
9+
type PanelStateKind,
10+
} from '../../src/next-devtools/dev-overlay/menu/context'
11+
import { INITIAL_OVERLAY_STATE } from '../../src/next-devtools/dev-overlay/shared'
12+
import type {
13+
OverlayState,
14+
DispatcherEvent,
15+
} from '../../src/next-devtools/dev-overlay/shared'
16+
import type { ReadyRuntimeError } from '../../src/next-devtools/dev-overlay/utils/get-error-by-type'
1117

1218
interface WithDevOverlayContextsOptions {
1319
state?: Partial<OverlayState>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import '../../src/next-devtools/dev-overlay/global.css'
2+
import { ComponentStyles } from '../../src/next-devtools/dev-overlay/styles/component-styles'
3+
import { ShadowPortal } from '../../src/next-devtools/dev-overlay/components/shadow-portal'
4+
5+
export const withShadowPortal = (Story: any) => (
6+
<ShadowPortal>
7+
<ComponentStyles />
8+
<Story />
9+
</ShadowPortal>
10+
)

0 commit comments

Comments
 (0)