11<script setup lang="ts">
22import { useEventListener , useEyeDropper } from ' @vueuse/core'
33import { computed , onMounted , ref , watch , watchEffect } from ' vue'
4- import { useRoute } from ' #app/composables/router'
54import { useHead } from ' #imports'
65import { getColorMode , showConnectionWarning , useClient , useInjectionClient } from ' ~/composables/client'
76import { useCopy } from ' ~/composables/editor'
8- import { isEmbedded } from ' ~/composables/embed'
97import { setupFrameNav } from ' ~/composables/frame-nav'
108import { WS_DEBOUNCE_TIME } from ' ~/composables/rpc'
119import { registerCommands } from ' ~/composables/state-commands'
12- import { splitScreenAvailable , splitScreenEnabled } from ' ~/composables/storage'
1310import { wsConnectedOnce } from ' ./composables/rpc'
1411import { useSchemaInput } from ' ./composables/state-schema'
1512import { useDevToolsOptions } from ' ./composables/storage-options'
@@ -43,12 +40,7 @@ useHead({
4340setupClientRPC ()
4441
4542const client = useClient ()
46- const route = useRoute ()
4743const colorMode = getColorMode ()
48- // When embedded as the shared-frame anchor (`?embed=1`), hide the app shell
49- // (SideNav + split pane) so the iframe shows only the current tab; the dock's
50- // per-tab members drive navigation via the frame-nav shim.
51- const isUtilityView = computed (() => isEmbedded .value || route .path .startsWith (' /__' ) || route .path === ' /' )
5244const waiting = computed (() => ! client .value && ! showConnectionWarning .value )
5345const showDisconnectIndicator = ref (false )
5446
@@ -88,14 +80,14 @@ useEventListener('keydown', (e) => {
8880 }
8981})
9082
91- const { scale, sidebarExpanded } = useDevToolsOptions (' ui' )
83+ const { scale } = useDevToolsOptions (' ui' )
9284const dataSchema = useSchemaInput ()
9385
9486onMounted (async () => {
95- // As the shared-frame anchor, announce our tabs to the dock and answer
96- // soft-navigation over postMessage.
97- if ( isEmbedded . value )
98- setupFrameNav ()
87+ // Nuxt DevTools always renders as the shared-frame anchor inside the Vite
88+ // DevTools dock: announce our tabs to the dock and answer soft-navigation
89+ // over postMessage.
90+ setupFrameNav ()
9991
10092 const injectClient = useInjectionClient ()
10193 watchEffect (() => {
@@ -111,16 +103,6 @@ const copy = useCopy()
111103const eyeDropper = useEyeDropper ({})
112104
113105registerCommands (() => [
114- ... (splitScreenAvailable .value
115- ? [{
116- id: ' action:split-screen' ,
117- title: ` ${splitScreenEnabled .value ? ' Close' : ' Open' } Split Screen ` ,
118- icon: ' i-carbon-split-screen' ,
119- action : () => {
120- splitScreenEnabled .value = ! splitScreenEnabled .value
121- },
122- }]
123- : []),
124106 ... (eyeDropper .isSupported .value
125107 ? [{
126108 id: ' action:eye-dropper' ,
@@ -158,21 +140,14 @@ registerCommands(() => [
158140 </NLoading >
159141 <div
160142 v-else
161- :class =" isEmbedded ? 'grid grid-cols-[1fr]' : isUtilityView ? 'flex' : sidebarExpanded ? 'grid grid-cols-[250px_1fr]' : 'grid grid-cols-[50px_1fr]'"
143+ id =" nuxt-devtools-app"
144+ class =" grid grid-cols-[1fr]"
162145 h-full h-screen of-hidden rounded-xl bg-base font-sans
163146 >
164- <SideNav v-show =" ! isUtilityView " of-x-hidden of-y-auto />
147+ <!-- Single-tab view: the shared-frame anchor mounts the current tab
148+ directly; the Vite DevTools dock provides navigation between tabs. -->
165149 <NuxtLayout >
166- <!-- Embedded single-tab view: mount the tab content directly, no split pane -->
167- <NuxtPage v-if =" isEmbedded " />
168- <NSplitPane v-else storage-key="devtools:split-screen-mode " :min-size =" 20 " >
169- <template #left >
170- <NuxtPage />
171- </template >
172- <template v-if =" ! isUtilityView && splitScreenEnabled && splitScreenAvailable " #right >
173- <SplitScreen />
174- </template >
175- </NSplitPane >
150+ <NuxtPage />
176151 </NuxtLayout >
177152 <CommandPalette />
178153 </div >
0 commit comments