Skip to content

Commit 42288b5

Browse files
authored
fix(vite): show an empty state for unrecorded modules (#636)
1 parent 9d39d5a commit 42288b5

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎packages/vite/src/app/components/data/ModuleDetailsLoader.vue‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { DevToolsRpcServerFunctions } from '@vitejs/devtools-kit'
33
import type { InspectModuleUpdatedPayload } from '~/composables/rpc'
44
import type { ViteModuleListItem } from '~/types/modules'
55
import DisplayCloseButton from '@vitejs/devtools-ui/components/Display/DisplayCloseButton.vue'
6+
import VisualEmptyState from '@vitejs/devtools-ui/components/Visual/VisualEmptyState.vue'
67
import { useDebounceFn } from '@vueuse/core'
78
import { computed, ref, watch } from 'vue'
89
import { useRpc } from '#imports'
@@ -72,12 +73,13 @@ function selectFlowNode(v: boolean) {
7273
</script>
7374

7475
<template>
75-
<div v-if="info" class="relative h-full w-full">
76+
<div class="relative h-full w-full">
7677
<DisplayCloseButton
7778
class="absolute right-2 top-1.5 bg-glass z-panel-content"
7879
@click="emit('close')"
7980
/>
8081
<div
82+
v-if="info"
8183
class="bg-glass absolute left-2 top-2 z-panel-content p2 border border-base rounded-lg flex flex-col gap-2"
8284
>
8385
<DisplayModuleId :id="module" class="px2 pt1" :cwd="root" />
@@ -111,7 +113,7 @@ function selectFlowNode(v: boolean) {
111113
</button>
112114
</div>
113115
</div>
114-
<div class="of-auto h-full pt-30">
116+
<div v-if="info" class="of-auto h-full pt-30">
115117
<FlowmapModuleFlow
116118
v-if="settings.moduleDetailsViewType === 'flow'"
117119
:module="info"
@@ -135,6 +137,11 @@ function selectFlowNode(v: boolean) {
135137
:root="root"
136138
/>
137139
</div>
140+
<VisualEmptyState
141+
v-else
142+
class="h-full"
143+
title="No module details yet"
144+
description="Details will appear when Vite records this module."
145+
/>
138146
</div>
139-
<VisualLoading v-else />
140147
</template>

0 commit comments

Comments
 (0)