mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-10 15:40:24 +00:00
feat: right side panel (#6952)
<img width="1183" height="809" alt="CleanShot 2025-11-26 at 16 01 15" src="https://github.com/user-attachments/assets/c14dc5c3-a672-4dcd-917d-14f16310188e" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6952-feat-right-side-panel-2b76d73d36508112b121c283a479f42a) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
52
src/stores/workspace/rightSidePanelStore.ts
Normal file
52
src/stores/workspace/rightSidePanelStore.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
type RightSidePanelTab = 'parameters' | 'settings' | 'info'
|
||||
|
||||
/**
|
||||
* Store for managing the right side panel state.
|
||||
* This panel displays properties and settings for selected nodes.
|
||||
*/
|
||||
export const useRightSidePanelStore = defineStore('rightSidePanel', () => {
|
||||
// Panel visibility state
|
||||
const isOpen = ref(false)
|
||||
const isEditingSubgraph = ref(false)
|
||||
|
||||
// Active tab in the node properties panel
|
||||
const activeTab = ref<RightSidePanelTab>('parameters')
|
||||
|
||||
// Actions
|
||||
function openPanel(tab?: RightSidePanelTab | 'subgraph') {
|
||||
isOpen.value = true
|
||||
if (tab === 'subgraph') {
|
||||
activeTab.value = 'parameters'
|
||||
isEditingSubgraph.value = true
|
||||
} else if (tab) {
|
||||
activeTab.value = tab
|
||||
isEditingSubgraph.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function closePanel() {
|
||||
isOpen.value = false
|
||||
isEditingSubgraph.value = false
|
||||
}
|
||||
|
||||
function togglePanel() {
|
||||
isOpen.value = !isOpen.value
|
||||
}
|
||||
|
||||
function setActiveTab(tab: RightSidePanelTab) {
|
||||
activeTab.value = tab
|
||||
}
|
||||
|
||||
return {
|
||||
isOpen,
|
||||
activeTab,
|
||||
isEditingSubgraph,
|
||||
openPanel,
|
||||
closePanel,
|
||||
togglePanel,
|
||||
setActiveTab
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user