Skip to content

Commit 7ac0a13

Browse files
authoredJun 21, 2024··
feat(client): only show feature settings on iframe/seperate-window (#461)
1 parent 9bf2ac5 commit 7ac0a13

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed
 

‎packages/client/src/pages/settings.vue

+29-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { VueButton, VueCard, VueCheckbox, VueConfirm, VueDarkToggle, VueSelect, VueSwitch } from '@vue/devtools-ui'
3-
// import { isInChromePanel } from '@vue/devtools-shared'
43
54
// #region view mode
65
// const viewMode = inject<Ref<'overlay' | 'panel'>>('viewMode', ref('overlay'))
@@ -10,6 +9,13 @@ import { VueButton, VueCard, VueCheckbox, VueConfirm, VueDarkToggle, VueSelect,
109
1110
const { categorizedTabs: categories } = useAllTabs()
1211
12+
const hostEnv = useHostEnv()
13+
14+
/**
15+
* Enable feature settings in separate window because someone is using it, related #458
16+
*/
17+
const enableFeatureSettings = hostEnv === 'iframe' || hostEnv === 'separate-window'
18+
1319
const { scale, interactionCloseOnOutsideClick, showPanel, minimizePanelInteractive, expandSidebar, scrollableSidebar } = toRefs(toReactive(devtoolsClientState))
1420
1521
// #region settings
@@ -184,26 +190,28 @@ const minimizePanelInteractiveLabel = computed(() => {
184190
</div>
185191
</VueCard>
186192

187-
<h3 mt2 text-lg>
188-
Features
189-
</h3>
190-
<VueCard p4 flex="~ col gap-2">
191-
<div class="flex items-center gap2 text-sm">
192-
<VueCheckbox v-model="interactionCloseOnOutsideClick" />
193-
<span op75>Close DevTools when clicking outside</span>
194-
</div>
195-
<div class="flex items-center gap2 text-sm">
196-
<VueCheckbox v-model="showPanel" />
197-
<span op75>Always show the floating panel</span>
198-
</div>
199-
200-
<div mx--2 my1 h-1px border="b base" op75 />
201-
202-
<p>Minimize floating panel on inactive</p>
203-
<div>
204-
<VueSelect v-model="minimizePanelInteractive" :button-props="{ outlined: true }" :options="minimizePanelInteractiveOptions" :placeholder="minimizePanelInteractiveLabel" />
205-
</div>
206-
</VueCard>
193+
<template v-if="enableFeatureSettings">
194+
<h3 mt2 text-lg>
195+
Features
196+
</h3>
197+
<VueCard p4 flex="~ col gap-2">
198+
<div class="flex items-center gap2 text-sm">
199+
<VueCheckbox v-model="interactionCloseOnOutsideClick" />
200+
<span op75>Close DevTools when clicking outside</span>
201+
</div>
202+
<div class="flex items-center gap2 text-sm">
203+
<VueCheckbox v-model="showPanel" />
204+
<span op75>Always show the floating panel</span>
205+
</div>
206+
207+
<div mx--2 my1 h-1px border="b base" op75 />
208+
209+
<p>Minimize floating panel on inactive</p>
210+
<div>
211+
<VueSelect v-model="minimizePanelInteractive" :button-props="{ outlined: true }" :options="minimizePanelInteractiveOptions" :placeholder="minimizePanelInteractiveLabel" />
212+
</div>
213+
</VueCard>
214+
</template>
207215

208216
<h3 mt2 text-lg>
209217
Debug

0 commit comments

Comments
 (0)
Please sign in to comment.