From 6bd61ae5228b918c474465f6c59c9b9dd222c1c0 Mon Sep 17 00:00:00 2001 From: cocos02 Date: Tue, 16 Jun 2026 17:06:25 +0800 Subject: [PATCH] feat: collapsible NodeEditor panel with right-edge bar --- editor/App.vue | 2 +- editor/components/NodeEditor.vue | 116 ++++++++++++++++++++++++------- editor/stores/editorStore.ts | 3 +- 3 files changed, 93 insertions(+), 28 deletions(-) diff --git a/editor/App.vue b/editor/App.vue index 423f87d..6c21f69 100644 --- a/editor/App.vue +++ b/editor/App.vue @@ -165,7 +165,7 @@ html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a16; c .toolbar-actions button.secondary { color: #8cf; border-color: rgba(100,200,255,0.2); background: rgba(100,200,255,0.06); } .toolbar-actions button.active { background: rgba(100,200,255,0.18); color: #fff; } .error-bar { padding: 8px 16px; background: #4a1a1a; color: #f88; font-size: 13px; flex-shrink: 0; } -.editor-main { flex: 1; display: flex; overflow: hidden; } +.editor-main { flex: 1; display: flex; overflow: hidden; position: relative; } .graph-area { flex: 1; } .loading-hint { display: flex; align-items: center; justify-content: center; height: 100%; color: #555; font-size: 14px; } diff --git a/editor/components/NodeEditor.vue b/editor/components/NodeEditor.vue index 5f9ef24..5009bf2 100644 --- a/editor/components/NodeEditor.vue +++ b/editor/components/NodeEditor.vue @@ -54,49 +54,103 @@ function onBlur() { diff --git a/editor/stores/editorStore.ts b/editor/stores/editorStore.ts index 19331b6..c72f9c1 100644 --- a/editor/stores/editorStore.ts +++ b/editor/stores/editorStore.ts @@ -27,6 +27,7 @@ export const useEditorStore = defineStore('editor', () => { const deepseekKey = ref(localStorage.getItem('deepseek_key') || '') const showAIPanel = ref(true) const aiCollapsed = ref(true) + const nodeEditorCollapsed = ref(true) const aiSessionId = ref('') const aiChanges = ref(null) const versions = ref([]) @@ -235,7 +236,7 @@ export const useEditorStore = defineStore('editor', () => { return { gameData, selectedNodeId, selectedScene, startSceneId, dirty, sourcePath, - deepseekKey, showAIPanel, aiSessionId, aiCollapsed, aiChanges, versions, + deepseekKey, showAIPanel, aiSessionId, aiCollapsed, nodeEditorCollapsed, aiChanges, versions, markDirty, loadJSON, exportJSON, addScene, deleteScene, updateScene, addChoice, updateChoice, deleteChoice, generateId, setSourcePath, setDeepseekKey, setAISessionId, clearAISession, autoSave, reloadFromDisk,