Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
5fe8a00b
Commit
5fe8a00b
authored
Jul 03, 2025
by
Jiachi Liu
Committed by
RobPruzan
Jul 07, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[segment explorer] dropdown design for overrides
parent
8b675c9b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
585 additions
and
197 deletions
+585
-197
tooltip.css
packages/next/src/next-devtools/components/tooltip.css
+0
-1
tooltip.tsx
packages/next/src/next-devtools/components/tooltip.tsx
+3
-1
segments-explorer.tsx
.../dev-tools-indicator/dev-tools-info/segments-explorer.tsx
+7
-0
utils.ts
...ev-overlay/components/errors/dev-tools-indicator/utils.ts
+8
-7
segment-boundary-trigger.tsx
...-overlay/components/overview/segment-boundary-trigger.tsx
+256
-90
segment-explorer.tsx
...ools/dev-overlay/components/overview/segment-explorer.tsx
+269
-97
segment-explorer-path.ts
packages/next/src/server/app-render/segment-explorer-path.ts
+9
-1
error.tsx
...p-dir/segment-explorer/app/parallel-routes/@bar/error.tsx
+5
-0
layout.tsx
...dir/segment-explorer/app/vercel/framework/blog/layout.tsx
+11
-0
page.tsx
...p-dir/segment-explorer/app/vercel/framework/blog/page.tsx
+3
-0
layout.tsx
.../app-dir/segment-explorer/app/vercel/framework/layout.tsx
+11
-0
not-found.tsx
...lopment/app-dir/segment-explorer/app/vercel/not-found.tsx
+3
-0
No files found.
packages/next/src/next-devtools/components/tooltip.css
View file @
5fe8a00b
...
...
@@ -10,7 +10,6 @@
border-radius
:
8px
;
font-size
:
14px
;
line-height
:
1.4
;
min-width
:
200px
;
pointer-events
:
none
;
}
...
...
packages/next/src/next-devtools/components/tooltip.tsx
View file @
5fe8a00b
...
...
@@ -14,11 +14,13 @@ interface TooltipProps {
offset
?:
number
bgcolor
?:
string
color
?:
string
className
?:
string
}
export
const
Tooltip
=
forwardRef
<
HTMLDivElement
,
TooltipProps
>
(
function
Tooltip
(
{
className
,
children
,
title
,
direction
=
'top'
,
...
...
@@ -53,7 +55,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
}
>
<
BaseTooltip
.
Popup
className=
"tooltip"
className=
{
cx
(
'tooltip'
,
className
)
}
style=
{
{
backgroundColor
:
bgcolor
,
...
...
packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-info/segments-explorer.tsx
View file @
5fe8a00b
...
...
@@ -22,6 +22,13 @@ export function SegmentsExplorer({
export
const
SEGMENTS_EXPLORER_STYLES
=
`
[data-nextjs-segments-explorer] {
min-width: 768px;
margin: -16px;
}
@media (max-width: 768px) {
[data-nextjs-segments-explorer] {
min-width: 90vw;
}
}
`
packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/utils.ts
View file @
5fe8a00b
...
...
@@ -84,14 +84,15 @@ export function useClickOutside(
rootRef
:
React
.
RefObject
<
HTMLElement
|
null
>
,
triggerRef
:
React
.
RefObject
<
HTMLButtonElement
|
null
>
,
active
:
boolean
,
close
:
()
=>
void
close
:
()
=>
void
,
ownerDocument
?:
Document
)
{
useEffect
(()
=>
{
if
(
!
active
)
{
return
}
const
ownerDocument
=
rootRef
.
current
?.
ownerDocument
const
ownerDocument
El
=
ownerDocument
||
rootRef
.
current
?.
ownerDocument
function
handleClickOutside
(
event
:
MouseEvent
)
{
const
target
=
event
.
target
as
HTMLElement
...
...
@@ -124,15 +125,15 @@ export function useClickOutside(
}
}
ownerDocument
?.
addEventListener
(
'mousedown'
,
handleClickOutside
)
ownerDocument
?.
addEventListener
(
'keydown'
,
handleKeyDown
)
ownerDocument
El
?.
addEventListener
(
'mousedown'
,
handleClickOutside
)
ownerDocument
El
?.
addEventListener
(
'keydown'
,
handleKeyDown
)
return
()
=>
{
ownerDocument
?.
removeEventListener
(
'mousedown'
,
handleClickOutside
)
ownerDocument
?.
removeEventListener
(
'keydown'
,
handleKeyDown
)
ownerDocument
El
?.
removeEventListener
(
'mousedown'
,
handleClickOutside
)
ownerDocument
El
?.
removeEventListener
(
'keydown'
,
handleKeyDown
)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
active
])
},
[
active
,
rootRef
,
triggerRef
])
}
//////////////////////////////////////////////////////////////////////////////////////
...
...
packages/next/src/next-devtools/dev-overlay/components/overview/segment-boundary-trigger.tsx
View file @
5fe8a00b
This diff is collapsed.
Click to expand it.
packages/next/src/next-devtools/dev-overlay/components/overview/segment-explorer.tsx
View file @
5fe8a00b
This diff is collapsed.
Click to expand it.
packages/next/src/server/app-render/segment-explorer-path.ts
View file @
5fe8a00b
import
type
{
LoaderTree
}
from
'../lib/app-dir-module'
export
const
BUILTIN_PREFIX
=
'__next_builtin__'
export
function
normalizeConventionFilePath
(
projectDir
:
string
,
conventionPath
:
string
|
undefined
...
...
@@ -22,12 +24,18 @@ export function normalizeConventionFilePath(
if
(
nextInternalPrefixRegex
.
test
(
relativePath
))
{
relativePath
=
relativePath
.
replace
(
nextInternalPrefixRegex
,
''
)
// Add a special prefix to let segment explorer know it's a built-in component
relativePath
=
`
__next_builtin__
${
relativePath
}
`
relativePath
=
`
${
BUILTIN_PREFIX
}
${
relativePath
}
`
}
return
relativePath
}
export
function
normalizeBoundaryFilename
(
filename
:
string
)
{
return
filename
.
replace
(
new
RegExp
(
`^
${
BUILTIN_PREFIX
}
`
),
''
)
.
replace
(
/@boundary$/
,
''
)
}
export
function
getConventionPathByType
(
tree
:
LoaderTree
,
dir
:
string
,
...
...
test/development/app-dir/segment-explorer/app/parallel-routes/@bar/error.tsx
0 → 100644
View file @
5fe8a00b
'use client'
export
default
function
Error
()
{
return
<
div
>
Error @bar
</
div
>
}
test/development/app-dir/segment-explorer/app/vercel/framework/blog/layout.tsx
0 → 100644
View file @
5fe8a00b
import
Link
from
'next/link'
export
default
function
Layout
({
children
}:
{
children
:
React
.
ReactNode
})
{
return
(
<
div
>
<
h2
>
Layout - /vercel/framework/blog
</
h2
>
{
children
}
<
Link
href=
"/vercel/framework"
>
To /vercel/framework
</
Link
>
</
div
>
)
}
test/development/app-dir/segment-explorer/app/vercel/framework/blog/page.tsx
0 → 100644
View file @
5fe8a00b
export
default
function
Page
()
{
return
<
div
>
Page - /vercel/framework/blog
</
div
>
}
test/development/app-dir/segment-explorer/app/vercel/framework/layout.tsx
0 → 100644
View file @
5fe8a00b
import
Link
from
'next/link'
export
default
function
Layout
({
children
}:
{
children
:
React
.
ReactNode
})
{
return
(
<
div
>
<
h1
>
Layout - /vercel/framework
</
h1
>
{
children
}
<
Link
href=
"/vercel"
>
To /vercel
</
Link
>
</
div
>
)
}
test/development/app-dir/segment-explorer/app/vercel/not-found.tsx
0 → 100644
View file @
5fe8a00b
export
default
function
NotFound
()
{
return
<
div
>
Not Found - /vercel
</
div
>
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment