Commit Graph

29 Commits

Author SHA1 Message Date
Jiachi Liu b5fa24b766 Remove the experimental.devtoolSegmentExplorer flag (#83384) 2025-09-03 14:29:42 +00:00
Sebastian "Sebbie" Silbermann caffa0d866 [test] Resolve elementByCSS and waitForElementByCSS once visible (#83301) 2025-09-03 09:47:35 +00:00
Jiachi Liu 9e7df6a52c [segment explorer] missing file suggestion (#81617) 2025-07-22 19:55:04 +02:00
Jiachi Liu afec9909a0 [segment explorer] hide for pages router (#81813)
Hide the segment explorer menu item in pages router 

Closes NEXT-4635
2025-07-18 23:07:49 +02:00
Jiachi Liu d04d65b5e6 [segment explorer] fix route url is missing cases (#81622) 2025-07-14 18:05:07 +00:00
Jiachi Liu 8f060ea25a [test] improve segment explorer tests snapshot (#81616)
Format line format: `<segment> [<files,>]`

This will help visualize the rendered segment explorer panel easier by checking the snapshot. e.g.

```
app/ [layout.tsx]
parallel-routes/ [layout.tsx, page.tsx]
@bar/ [layout.tsx, page.tsx]
@foo/ [layout.tsx, page.tsx]
```
2025-07-14 17:45:48 +02:00
Jiachi Liu 27250721aa [segment explorer] redesign file pills and boundary trigger (#81302) 2025-07-11 15:42:57 +02:00
Jiachi Liu 2503c19dd0 [segment explorer] capture defined boundaries (#81232)
Capture defined boundaries (not-found / error / loading) and used to filter which one is available for boundary triggers

The trie will now hold all the defined boundaries, but what's different from the existing rendered boundaries is:

Here's the difference of new defined boundary trie nodes:
```
{
  type: "boundary:<type>"
  pagePath: "<pagePath>@boundary"
}
```
We add a `boundary:` prefix to determine if it's node representing existence;
We add a `@boundary` suffix to the filename cause the <pagePath> part is still need to use for indexing in the trie, but the `@boundary` doesn't matter yet. We'll remove it once we start using the file name in the dropdown panel

Closes NEXT-4330

### Example

When there's only one not-found.tsx, allow to trigger the not-found boundary and disable the rest.

https://github.com/user-attachments/assets/eb5c49a7-4fd2-496b-b778-fb66581908b3
2025-07-08 22:13:03 +02:00
Jiachi Liu 1e9f598ba6 [segment explorer] refactor boundary trigger with ui primitives (#81147) 2025-07-02 18:48:03 +02:00
Jiachi Liu 19bf594b60 Revert "[devtool] merge segment explorer flag into panel ui flag (#81085)" (#81131)
Reverts #81085 to keep the flags separate so can test separately
2025-07-01 19:25:00 +02:00
Jiachi Liu 13401d8fd8 [devtool] merge segment explorer flag into panel ui flag (#81085) 2025-07-01 15:35:21 +02:00
Jiachi Liu 82c85a5b7b [segment explorer] trigger boundary initial support (#80948) 2025-06-30 16:54:46 +02:00
Jiachi Liu 33477b7e64 [segment-explorer] display the builtin conventions (#80961)
Track built-in conventions in segment explorer. The default `global-not-found.js` and `global-error.js` will be displayed.
Their style will be different to the others, we'll follow up in the later PRs.

Closes NEXT-4576
2025-06-27 16:41:07 +02:00
Jiachi Liu 71cdce68e0 [refactor] group the built-in conventions (#80957)
Group all the built-in conventions into `src/client/components/builtin` with the actual same name of the conventions they represent.

e.g. 
The default `not-found.js` is `next/dist/client/compoents/builtin/not-found.js`;
The default `global-error.js` is `next/dist/client/compoents/builtin/global-error.js`;

This give us an easier way to track all the builtin conventions. This is also the preparation work for #80961 where we display the builtin conventions in the segment explorer.
2025-06-26 23:36:57 +02:00
Jiachi Liu c54cc01902 [segment explorer] display default page in segment explorer (#80716) 2025-06-23 23:18:09 +02:00
Jiachi Liu 8324d8108c [segment explorer] handle custom error boundary (#80714)
Display custom error boundary `error.js` in segement explorer when it's rendered

![image](https://github.com/user-attachments/assets/4abad442-0703-4609-8202-b4f41f007afe)

Closes NEXT-4331
2025-06-23 22:23:47 +02:00
Jiachi Liu 9d4239a150 [segment explorer] handle display loading (#80698) 2025-06-23 21:03:17 +02:00
Jiachi Liu 6e508d4f93 [segment explorer] display navigation error boundaries (#80691) 2025-06-23 18:08:02 +02:00
Jiachi Liu 3981cccbe3 [segment explorer] handle custom global-error segment (#80685) 2025-06-23 17:36:20 +02:00
Jiachi Liu 5771ce12f8 [segment explorer] handle builtin not-found (#80607) 2025-06-23 15:23:43 +02:00
Jiachi Liu 9df0c8763c [segment explorer] handle edge and pages router (#80668) 2025-06-23 14:06:01 +02:00
Jiachi Liu f3d6af9525 [segment explorer] single row layout segment (#80576) 2025-06-18 16:16:19 +02:00
Jiachi Liu f8add0d9ff [segment explorer] fix soft navigation case (#80443) 2025-06-12 13:10:33 +02:00
Sebastian "Sebbie" Silbermann ae1f0be351 [segment-explorer] Signal updates to React (#80316)
We never actually invoked the listeners attached by React. Updates only worked on soft-navigation because we also re-render the DevOverlayRoot and don't bail out anywhere at the moment.

Just invoking the listeners is not sufficient after https://github.com/vercel/next.js/pull/79699 since userspace and dev-overlay would read different versions of `listeners`. I ported the segment explorer into the new folder structure. Updates now flow through the `dispatcher` and then invoking the listeners actually works. Though mid term we should move the segment tree into actual React tree to get rid of the sync updates.

I also noticed that we're missing an implementation for a remove operation which is required to show the correct state during soft navigations.
2025-06-12 12:48:08 +02:00
Jiachi Liu 737d3199c6 [segment-explorer] optimize tree view (#80392) 2025-06-11 18:21:10 +02:00
Jiachi Liu 356cdf2393 [devtool] display segment explorer as tree view (#80261) 2025-06-07 01:07:06 +02:00
Jiachi Liu c2621a14ef [devtool] style the segment explorer as nested view (#80212) 2025-06-06 14:38:58 +02:00
Jiachi Liu bc4b72df8e [devtool] fix explorer flag consuming and style (#80110) 2025-06-03 18:40:59 +02:00
Jiachi Liu 0ca32b2b4a [devtool] initial support for segment explorer (#78858) 2025-05-16 12:10:59 +08:00