Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): only show feature settings on iframe/seperate-window #461

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions packages/client/src/pages/settings.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { VueButton, VueCard, VueCheckbox, VueConfirm, VueDarkToggle, VueSelect, VueSwitch } from '@vue/devtools-ui'
// import { isInChromePanel } from '@vue/devtools-shared'

// #region view mode
// const viewMode = inject<Ref<'overlay' | 'panel'>>('viewMode', ref('overlay'))
Expand All @@ -10,6 +9,13 @@ import { VueButton, VueCard, VueCheckbox, VueConfirm, VueDarkToggle, VueSelect,

const { categorizedTabs: categories } = useAllTabs()

const hostEnv = useHostEnv()

/**
* Enable feature settings in separate window because someone is using it, related #458
*/
const enableFeatureSettings = hostEnv === 'iframe' || hostEnv === 'separate-window'

const { scale, interactionCloseOnOutsideClick, showPanel, minimizePanelInteractive, expandSidebar, scrollableSidebar } = toRefs(toReactive(devtoolsClientState))

// #region settings
Expand Down Expand Up @@ -184,26 +190,28 @@ const minimizePanelInteractiveLabel = computed(() => {
</div>
</VueCard>

<h3 mt2 text-lg>
Features
</h3>
<VueCard p4 flex="~ col gap-2">
<div class="flex items-center gap2 text-sm">
<VueCheckbox v-model="interactionCloseOnOutsideClick" />
<span op75>Close DevTools when clicking outside</span>
</div>
<div class="flex items-center gap2 text-sm">
<VueCheckbox v-model="showPanel" />
<span op75>Always show the floating panel</span>
</div>

<div mx--2 my1 h-1px border="b base" op75 />

<p>Minimize floating panel on inactive</p>
<div>
<VueSelect v-model="minimizePanelInteractive" :button-props="{ outlined: true }" :options="minimizePanelInteractiveOptions" :placeholder="minimizePanelInteractiveLabel" />
</div>
</VueCard>
<template v-if="enableFeatureSettings">
<h3 mt2 text-lg>
Features
</h3>
<VueCard p4 flex="~ col gap-2">
<div class="flex items-center gap2 text-sm">
<VueCheckbox v-model="interactionCloseOnOutsideClick" />
<span op75>Close DevTools when clicking outside</span>
</div>
<div class="flex items-center gap2 text-sm">
<VueCheckbox v-model="showPanel" />
<span op75>Always show the floating panel</span>
</div>

<div mx--2 my1 h-1px border="b base" op75 />

<p>Minimize floating panel on inactive</p>
<div>
<VueSelect v-model="minimizePanelInteractive" :button-props="{ outlined: true }" :options="minimizePanelInteractiveOptions" :placeholder="minimizePanelInteractiveLabel" />
</div>
</VueCard>
</template>

<h3 mt2 text-lg>
Debug
Expand Down