@@ -3,6 +3,7 @@ import type { ModuleInfo, RolldownModuleTransformInfo, SessionContext } from '~~
33import { useRpc } from ' #imports'
44import { computedAsync } from ' @vueuse/core'
55import { computed , nextTick , ref , watchEffect } from ' vue'
6+ import { settings } from ' ~~/app/state/settings'
67import { getContentByteSize } from ' ~~/app/utils/format'
78
89const props = defineProps <{
@@ -18,7 +19,6 @@ const rpc = useRpc()
1819const transforms = ref <RolldownModuleTransformInfo []>([])
1920const transformsLoading = ref (false )
2021const flowNodeSelected = ref (false )
21- const view = ref <' flow' | ' charts' | ' imports' >(' flow' )
2222
2323watchEffect (async () => {
2424 const arg = {
@@ -132,34 +132,34 @@ function selectFlowNode(v: boolean) {
132132 </div >
133133 <div flex =" ~ gap-2" >
134134 <button
135- :class =" view === 'flow' ? 'text-primary' : ''"
135+ :class =" settings.moduleDetailsViewType === 'flow' ? 'text-primary' : ''"
136136 flex =" ~ gap-2 items-center justify-center"
137137 px2 py1 w-40
138138 border =" ~ base rounded-lg"
139139 hover =" bg-active"
140- @click =" view = 'flow'"
140+ @click =" settings.moduleDetailsViewType = 'flow'"
141141 >
142142 <div i-ph-git-branch-duotone rotate-180 />
143143 Build Flow
144144 </button >
145145 <button
146- :class =" view === 'charts' ? 'text-primary' : ''"
146+ :class =" settings.moduleDetailsViewType === 'charts' ? 'text-primary' : ''"
147147 flex =" ~ gap-2 items-center justify-center"
148148 px2 py1 w-40
149149 border =" ~ base rounded-lg"
150150 hover =" bg-active"
151- @click =" view = 'charts'"
151+ @click =" settings.moduleDetailsViewType = 'charts'"
152152 >
153153 <div i-ph-chart-donut-duotone />
154154 Charts
155155 </button >
156156 <button
157- :class =" view === 'imports' ? 'text-primary' : ''"
157+ :class =" settings.moduleDetailsViewType === 'imports' ? 'text-primary' : ''"
158158 flex =" ~ gap-2 items-center justify-center"
159159 px2 py1 w-40
160160 border =" ~ base rounded-lg"
161161 hover =" bg-active"
162- @click =" view = 'imports'"
162+ @click =" settings.moduleDetailsViewType = 'imports'"
163163 >
164164 <div i-ph-graph-duotone />
165165 Imports
@@ -168,21 +168,21 @@ function selectFlowNode(v: boolean) {
168168 </div >
169169 <div of-auto h-full pt-30 >
170170 <FlowmapModuleFlow
171- v-if =" view === 'flow'"
171+ v-if =" settings.moduleDetailsViewType === 'flow'"
172172 p4
173173 :info
174174 :session
175175 :transforms-loading
176176 @select =" selectFlowNode"
177177 />
178178 <ChartModuleFlamegraph
179- v-if =" view === 'charts'"
179+ v-if =" settings.moduleDetailsViewType === 'charts'"
180180 :info
181181 :session =" session"
182182 :flow-node-selected =" flowNodeSelected"
183183 />
184184 <DataModuleImportRelationships
185- v-if =" view === 'imports'"
185+ v-if =" settings.moduleDetailsViewType === 'imports'"
186186 :module =" info"
187187 :session =" session"
188188 />
0 commit comments