mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
[backport cloud/1.38] fix: properties panel obscures menus in legacy layout (#8491)
Backport of #8474 to `cloud/1.38` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8491-backport-cloud-1-38-fix-properties-panel-obscures-menus-in-legacy-layout-2f86d73d365081aea778f7573e1202f8) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
|
|
||||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||||
|
|
||||||
@@ -19,8 +19,13 @@ type RightSidePanelSection = 'advanced-inputs' | string
|
|||||||
export const useRightSidePanelStore = defineStore('rightSidePanel', () => {
|
export const useRightSidePanelStore = defineStore('rightSidePanel', () => {
|
||||||
const settingStore = useSettingStore()
|
const settingStore = useSettingStore()
|
||||||
|
|
||||||
|
const isLegacyMenu = computed(
|
||||||
|
() => settingStore.get('Comfy.UseNewMenu') === 'Disabled'
|
||||||
|
)
|
||||||
|
|
||||||
const isOpen = computed({
|
const isOpen = computed({
|
||||||
get: () => settingStore.get('Comfy.RightSidePanel.IsOpen'),
|
get: () =>
|
||||||
|
!isLegacyMenu.value && settingStore.get('Comfy.RightSidePanel.IsOpen'),
|
||||||
set: (value: boolean) =>
|
set: (value: boolean) =>
|
||||||
settingStore.set('Comfy.RightSidePanel.IsOpen', value)
|
settingStore.set('Comfy.RightSidePanel.IsOpen', value)
|
||||||
})
|
})
|
||||||
@@ -29,7 +34,15 @@ export const useRightSidePanelStore = defineStore('rightSidePanel', () => {
|
|||||||
const focusedSection = ref<RightSidePanelSection | null>(null)
|
const focusedSection = ref<RightSidePanelSection | null>(null)
|
||||||
const searchQuery = ref('')
|
const searchQuery = ref('')
|
||||||
|
|
||||||
|
// Auto-close panel when switching to legacy menu mode
|
||||||
|
watch(isLegacyMenu, (legacy) => {
|
||||||
|
if (legacy) {
|
||||||
|
void settingStore.set('Comfy.RightSidePanel.IsOpen', false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
function openPanel(tab?: RightSidePanelTab) {
|
function openPanel(tab?: RightSidePanelTab) {
|
||||||
|
if (isLegacyMenu.value) return
|
||||||
isOpen.value = true
|
isOpen.value = true
|
||||||
if (tab) {
|
if (tab) {
|
||||||
activeTab.value = tab
|
activeTab.value = tab
|
||||||
|
|||||||
Reference in New Issue
Block a user