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
0a298885
Unverified
Commit
0a298885
authored
Sep 19, 2025
by
Jiwon Choi
Committed by
GitHub
Sep 19, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[backport] fix: devtools initial position should be from next config (#83571) (#83994)
backports #83571
parent
7a53950c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
162 additions
and
2 deletions
+162
-2
shared.ts
packages/next/src/next-devtools/dev-overlay/shared.ts
+5
-2
layout.tsx
test/development/app-dir/devtools-position/app/layout.tsx
+9
-0
page.tsx
test/development/app-dir/devtools-position/app/page.tsx
+3
-0
bottom-left.test.ts
...development/app-dir/devtools-position/bottom-left.test.ts
+20
-0
bottom-right-position.test.ts
...t/app-dir/devtools-position/bottom-right-position.test.ts
+20
-0
default-position.test.ts
...opment/app-dir/devtools-position/default-position.test.ts
+15
-0
position-persistence.test.ts
...nt/app-dir/devtools-position/position-persistence.test.ts
+31
-0
top-left-position.test.ts
...pment/app-dir/devtools-position/top-left-position.test.ts
+20
-0
top-right-position.test.ts
...ment/app-dir/devtools-position/top-right-position.test.ts
+20
-0
utils.ts
test/development/app-dir/devtools-position/utils.ts
+19
-0
No files found.
packages/next/src/next-devtools/dev-overlay/shared.ts
View file @
0a298885
...
@@ -251,6 +251,9 @@ function getStackIgnoringStrictMode(stack: string | undefined) {
...
@@ -251,6 +251,9 @@ function getStackIgnoringStrictMode(stack: string | undefined) {
const
shouldDisableDevIndicator
=
const
shouldDisableDevIndicator
=
process
.
env
.
__NEXT_DEV_INDICATOR
?.
toString
()
===
'false'
process
.
env
.
__NEXT_DEV_INDICATOR
?.
toString
()
===
'false'
const
devToolsInitialPositionFromNextConfig
=
(
process
.
env
.
__NEXT_DEV_INDICATOR_POSITION
??
'bottom-left'
)
as
Corners
export
const
INITIAL_OVERLAY_STATE
:
Omit
<
export
const
INITIAL_OVERLAY_STATE
:
Omit
<
OverlayState
,
OverlayState
,
'isErrorOverlayOpen'
|
'routerType'
'isErrorOverlayOpen'
|
'routerType'
...
@@ -272,9 +275,9 @@ export const INITIAL_OVERLAY_STATE: Omit<
...
@@ -272,9 +275,9 @@ export const INITIAL_OVERLAY_STATE: Omit<
refreshState
:
{
type
:
'idle'
},
refreshState
:
{
type
:
'idle'
},
versionInfo
:
{
installed
:
'0.0.0'
,
staleness
:
'unknown'
},
versionInfo
:
{
installed
:
'0.0.0'
,
staleness
:
'unknown'
},
debugInfo
:
{
devtoolsFrontendUrl
:
undefined
},
debugInfo
:
{
devtoolsFrontendUrl
:
undefined
},
devToolsPosition
:
'bottom-left'
,
devToolsPosition
:
devToolsInitialPositionFromNextConfig
,
devToolsPanelPosition
:
{
devToolsPanelPosition
:
{
[
STORE_KEY_SHARED_PANEL_LOCATION
]:
'bottom-left'
,
[
STORE_KEY_SHARED_PANEL_LOCATION
]:
devToolsInitialPositionFromNextConfig
,
},
},
devToolsPanelSize
:
{},
devToolsPanelSize
:
{},
scale
:
NEXT_DEV_TOOLS_SCALE
.
Medium
,
scale
:
NEXT_DEV_TOOLS_SCALE
.
Medium
,
...
...
test/development/app-dir/devtools-position/app/layout.tsx
0 → 100644
View file @
0a298885
import
type
{
ReactNode
}
from
'react'
export
default
function
RootLayout
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/development/app-dir/devtools-position/app/page.tsx
0 → 100644
View file @
0a298885
export
default
function
Page
()
{
return
<
p
>
hello world
</
p
>
}
test/development/app-dir/devtools-position/bottom-left.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-bottom-left'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
nextConfig
:
{
devIndicators
:
{
position
:
'bottom-left'
,
},
},
})
it
(
'should devtools indicator position initially be bottom-left when configured'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'bottom: 20px'
)
expect
(
style
).
toContain
(
'left: 20px'
)
})
})
test/development/app-dir/devtools-position/bottom-right-position.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-bottom-right'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
nextConfig
:
{
devIndicators
:
{
position
:
'bottom-right'
,
},
},
})
it
(
'should devtools indicator position initially be bottom-right when configured'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'bottom: 20px'
)
expect
(
style
).
toContain
(
'right: 20px'
)
})
})
test/development/app-dir/devtools-position/default-position.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-default'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should devtools indicator position initially be bottom-left by default'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'bottom: 20px'
)
expect
(
style
).
toContain
(
'left: 20px'
)
})
})
test/development/app-dir/devtools-position/position-persistence.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-persistence'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
nextConfig
:
{
devIndicators
:
{
position
:
'top-right'
,
},
},
})
it
(
'should maintain devtools indicator position after navigation'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
let
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'top: 20px'
)
expect
(
style
).
toContain
(
'right: 20px'
)
// Navigate and check devtools indicator position is maintained
await
browser
.
refresh
()
await
browser
.
waitForIdleNetwork
()
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'top: 20px'
)
expect
(
style
).
toContain
(
'right: 20px'
)
})
})
test/development/app-dir/devtools-position/top-left-position.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-top-left'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
nextConfig
:
{
devIndicators
:
{
position
:
'top-left'
,
},
},
})
it
(
'should devtools indicator position initially be top-left when configured'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'top: 20px'
)
expect
(
style
).
toContain
(
'left: 20px'
)
})
})
test/development/app-dir/devtools-position/top-right-position.test.ts
0 → 100644
View file @
0a298885
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
getDevIndicatorPosition
}
from
'./utils'
describe
(
'devtools-position-top-right'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
nextConfig
:
{
devIndicators
:
{
position
:
'top-right'
,
},
},
})
it
(
'should devtools indicator position initially be top-right when configured'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
const
style
=
await
getDevIndicatorPosition
(
browser
)
expect
(
style
).
toContain
(
'top: 20px'
)
expect
(
style
).
toContain
(
'right: 20px'
)
})
})
test/development/app-dir/devtools-position/utils.ts
0 → 100644
View file @
0a298885
import
type
{
Playwright
}
from
'../../../lib/next-webdriver'
import
{
assertHasDevToolsIndicator
}
from
'next-test-utils'
export
async
function
getDevIndicatorPosition
(
browser
:
Playwright
)
{
// assert before eval() to prevent race condition
await
assertHasDevToolsIndicator
(
browser
)
const
style
=
await
browser
.
eval
(()
=>
{
return
(
[].
slice
.
call
(
document
.
querySelectorAll
(
'nextjs-portal'
))
.
find
((
p
)
=>
p
.
shadowRoot
.
querySelector
(
'[data-nextjs-toast]'
))
// portal
?.
shadowRoot
?.
querySelector
(
'[data-nextjs-toast]'
)
?.
getAttribute
(
'style'
)
||
''
)
})
return
style
||
''
}
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