next.js
ecc4775a - Document Next.js DevTools and improve badge controls (#102015)

Commit
1 day ago
Document Next.js DevTools and improve badge controls (#102015) ### What? Add a visual Next.js DevTools guide that explains how to open the menu, inspect diagnostics, and move, collapse, hide, or restore the badge. The guide links to the `devIndicators` reference and the Navigation Inspector walkthrough, and each Preferences help link opens the matching section. The Next.js logo opens the menu and is the drag handle. Red Issues and amber Insights buttons open their respective overlay tabs, and the trailing chevron collapses the badge to a logo with a count. The menu has a single **Diagnostics** entry with both counts. When the idle indicator is hidden, the trailing × dismisses the current diagnostic badge. New diagnostics still appear, and build errors stay available. Preferences groups appearance, indicator visibility, and server controls and explains what each option does. The shortcut field shows recording and saved feedback. Bindings stay in the browser for the current app instead of being shared through the dev server. Hiding the indicator offers **Undo** and shows how to restore it with the shortcut or by restarting the dev server. The Navigation Inspector's paused banner now follows the selected DevTools theme. ### Why? An expanded Insight badge can cover an app control in the corner. It was hard to tell how to move the badge, reach Preferences, or clear the obstruction while keeping diagnostics available. ### Badge states | State | Badge | | --- | --- | | Idle | Next.js logo opens the menu. | | Issues, Insights, or both | Each count opens its own overlay tab; the trailing chevron collapses the badge. | | Collapsed diagnostic | A red or amber logo with a count; click it to expand the badge. | | Compiling or rendering | Status text next to the logo. | | Cold cache or cache disabled | Status text next to the logo with a collapse control. | | Idle indicator hidden | New diagnostics can still appear, with × to dismiss a non-build diagnostic badge. | | Immediately after hiding | A temporary confirmation offers **Undo** and explains how to restore the indicator. | ### Before and after The left column is the [PR base at `ab0c6c77e66`](https://github.com/vercel/next.js/commit/ab0c6c77e66411b7570ebf8fde6fbdf5d92c4a74); the right is [this PR at `a585b9b13f0`](https://github.com/vercel/next.js/commit/a585b9b13f0b1dbe9c7ee3201a3bde28f0cc4163). Both columns show the actual DevTools components in Chromium, at the same scale and in a 1280 × 900 window. The sidebar button in the idle, hover, and hide examples shows where the badge can cover an app control. | State | Before | After | | --- | --- | --- | | Idle | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-idle-00a91e536303.png" width="260" alt="Idle before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-idle-5cc33bf7b31c.png" width="260" alt="Idle after"> | | Hovering the logo | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-hover-809e6028e0c4.png" width="260" alt="Hovering the logo before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-hover-73685b598ac8.png" width="260" alt="Hovering the logo after"> | | Compiling | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-compiling-13d5772214a6.png" width="260" alt="Compiling before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-compiling-3f38f40e8e70.png" width="260" alt="Compiling after"> | | Rendering | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-rendering-36d8b8ee8581.png" width="260" alt="Rendering before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-rendering-16fbd51aebe3.png" width="260" alt="Rendering after"> | | Cold cache | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-cold-c6bdcb45a1f8.png" width="260" alt="Cold cache before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-cold-dbdc8d7175bc.png" width="260" alt="Cold cache after"> | | Cache disabled | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-bypass-826841aef460.png" width="260" alt="Cache disabled before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-bypass-af0517b9bc64.png" width="260" alt="Cache disabled after"> | | 2 Issues | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-issues-5e3f1e8d3749.png" width="260" alt="2 Issues before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-issues-433dc9be6d85.png" width="260" alt="2 Issues after"> | | 1 Insight | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-insight-0f4cb8920bb3.png" width="260" alt="1 Insight before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-insight-ea6f391e4134.png" width="260" alt="1 Insight after"> | | 2 Issues and 1 Insight | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-both-18241839ecf4.png" width="260" alt="2 Issues and 1 Insight before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-both-63a8ccc42628.png" width="260" alt="2 Issues and 1 Insight after"> | | 2 Issues while compiling | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-issues-compiling-5c4a2b3d86e4.png" width="260" alt="2 Issues while compiling before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-issues-compiling-945d6cdb550c.png" width="260" alt="2 Issues while compiling after"> | | New Insight with the indicator hidden | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-hidden-insight-0fc87dd5f911.png" width="260" alt="New Insight with the indicator hidden before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-hidden-insight-54b9c95545f9.png" width="260" alt="New Insight with the indicator hidden after"> | | Collapsed: 2 Issues | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-collapsed-issues-6a6fd878f008.png" width="260" alt="Collapsed: 2 Issues before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-collapsed-issues-0d3255ba603f.png" width="260" alt="Collapsed: 2 Issues after"> | | Collapsed: 1 Insight | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-collapsed-insight-f5e432d09dc6.png" width="260" alt="Collapsed: 1 Insight before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-collapsed-insight-3bb206f28819.png" width="260" alt="Collapsed: 1 Insight after"> | | Collapsed: 2 Issues and 1 Insight | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-collapsed-both-6a6fd878f008.png" width="260" alt="Collapsed: 2 Issues and 1 Insight before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/725880afc06/collapsed-three-2be8a3b4eac3.png" width="54" alt="Red collapsed badge showing a total of 3 diagnostics"> | | Menu with diagnostics | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-menu-5e9cc7bb1569.png" width="290" alt="Menu with diagnostics before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-menu-c22400aab8f9.png" width="290" alt="Menu with diagnostics after"> | | Preferences | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-preferences-f2fcb0d29e1d.png" width="340" alt="Preferences before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-preferences-a648b88bdb01.png" width="340" alt="Preferences after"> | | Immediately after hiding the idle indicator | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/before-hidden-0aa2bc5fdc77.png" width="290" alt="Immediately after hiding the idle indicator before"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/after-hidden-bcfec5b6e9ab.png" width="290" alt="Immediately after hiding the idle indicator after"> | Both Preferences panels are shown at their initial scroll position. The old panel has more settings below the fold. In this window, the new panel fits every setting, including **Reset bundler cache**, which appears when the bundler uses a persistent cache. The panel body can still scroll in a shorter window. **Collapsed counts:** 1, 2, and 3 Issues after the animation finishes. The collapsed badge now adds the Issues and Insights: 1 Issue + 1 Insight shows **2**. The mixed example above uses the three-count badge from this alignment capture (2 Issues + 1 Insight). <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/count-alignment-7e662b721519.png" width="162" alt="Three collapsed Issue badges showing 1, 2, and 3"> ### DevTools in light and dark mode The [DevTools guide](https://github.com/vercel/next.js/blob/a585b9b13f0b1dbe9c7ee3201a3bde28f0cc4163/docs/01-app/02-guides/devtools.mdx) walks through these controls. The last two rows show the actual diagnostics from the demo app: a failed stock sync and an uncached navigation. | State | Light | Dark | | --- | --- | --- | | Default indicator | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-idle-dfa274936b28.png" width="54" alt="Default indicator in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-idle-82289ac4cf3a.png" width="54" alt="Default indicator in dark mode"> | | Menu without diagnostics | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-menu-f4be52b8ebc0.png" width="266" alt="Menu without diagnostics in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-menu-1a2e5fbb8d19.png" width="266" alt="Menu without diagnostics in dark mode"> | | Issues and Insights | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-badge-65df0b0a1383.png" width="245" alt="Issues and Insights in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-badge-cb95cdf8032e.png" width="245" alt="Issues and Insights in dark mode"> | | Collapsed badge | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-collapsed-f9d2e0268daf.png" width="54" alt="Collapsed badge in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-collapsed-a0c20a56a857.png" width="54" alt="Collapsed badge in dark mode"> | | Preferences | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-preferences-7aa89476dcc1.png" width="300" alt="Preferences in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-preferences-25ad33600b1b.png" width="300" alt="Preferences in dark mode"> | | Hide confirmation | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-hidden-e875cd941bb4.png" width="300" alt="Hide confirmation in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-hidden-e8677c049299.png" width="300" alt="Hide confirmation in dark mode"> | | Drag hint | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-hover-cb7ff9d56116.png" width="265" alt="Drag hint in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-hover-2c9fd8580d5c.png" width="265" alt="Drag hint in dark mode"> | | Issues tab: error, source, and call stack | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-issue-7fb6a2ba5c52.png" width="340" alt="Issues tab: error, source, and call stack in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-issue-c6a30e61056d.png" width="340" alt="Issues tab: error, source, and call stack in dark mode"> | | Insights tab: navigation diagnostic and suggested fixes | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-light-insight-4364c832e4b1.png" width="340" alt="Insights tab: navigation diagnostic and suggested fixes in light mode"> | <img src="https://h8dxkfmaphn8o0p3.public.blob.vercel-storage.com/pr/102015/a585b9b13f0/guide-dark-insight-b6f54ce8294b.png" width="340" alt="Insights tab: navigation diagnostic and suggested fixes in dark mode"> | ### Verification - The seven client overlay tests pass with both Webpack and Turbopack, including hiding existing diagnostics and showing a new error. - Checked the guide in Front with Blob-hosted screenshots in both themes, including the default indicator, full panels, and diagnostic badge. Guide screenshots use 2× captures; the tooltip uses a native-scale capture. - The five indicator visibility/shortcut browser tests pass, including local persistence and ignoring shortcut changes from another dev-server client. - All 47 tests across the four focused Turbopack suites passed, including the diagnostic suite rerun after updating its count assertion. - Rendered the DevTools guide, `devIndicators` reference, and instant navigation guide in Front. Checked the links between the pages and all Preferences help anchors. - Checked the combined Issues and Insights story in Storybook, including the accessible label after collapse and both controls after expansion. <!-- NEXT_JS_LLM -->
Author
Parents
Loading