From 33a702829500e6e5c9de97ec8d09e5c0010d5e50 Mon Sep 17 00:00:00 2001
From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com>
Date: Tue, 13 May 2025 08:53:15 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E5=91=BD=E4=BB=A4=E8=BE=93?=
=?UTF-8?q?=E5=85=A5=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=89=93=E5=BC=80?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/CommandInputBar.vue | 26 +++++++++++++++++--
packages/frontend/src/locales/en-US.json | 6 +++++
packages/frontend/src/locales/ja-JP.json | 3 +++
packages/frontend/src/locales/zh-CN.json | 3 +++
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/packages/frontend/src/components/CommandInputBar.vue b/packages/frontend/src/components/CommandInputBar.vue
index 1e71de0..900f68d 100644
--- a/packages/frontend/src/components/CommandInputBar.vue
+++ b/packages/frontend/src/components/CommandInputBar.vue
@@ -9,7 +9,8 @@ import { useQuickCommandsStore } from '../stores/quickCommands.store';
import { useCommandHistoryStore } from '../stores/commandHistory.store';
import QuickCommandsModal from './QuickCommandsModal.vue'; // +++ Import the modal component +++
import SuspendedSshSessionsModal from './SuspendedSshSessionsModal.vue'; // +++ Import the new modal +++
-import { useWorkspaceEventEmitter } from '../composables/workspaceEvents';
+import { useFileEditorStore } from '../stores/fileEditor.store'; // +++ Import File Editor Store +++
+import { useWorkspaceEventEmitter } from '../composables/workspaceEvents';
// Disable attribute inheritance as this component has multiple root nodes (div + modal)
defineOptions({ inheritAttrs: false });
@@ -23,9 +24,10 @@ const settingsStore = useSettingsStore();
const quickCommandsStore = useQuickCommandsStore();
const commandHistoryStore = useCommandHistoryStore();
const sessionStore = useSessionStore(); // +++ 初始化 Session Store +++
+const fileEditorStore = useFileEditorStore(); // +++ Initialize File Editor Store +++
// Get reactive setting from store
-const { commandInputSyncTarget, showPopupFileManagerBoolean } = storeToRefs(settingsStore); // +++ Import showPopupFileManagerBoolean +++
+const { commandInputSyncTarget, showPopupFileManagerBoolean, showPopupFileEditorBoolean } = storeToRefs(settingsStore); // +++ Import showPopupFileEditorBoolean +++
// Get reactive state and actions from quick commands store
const { selectedIndex: quickCommandsSelectedIndex, flatVisibleCommands: quickCommandsFiltered } = storeToRefs(quickCommandsStore);
const { resetSelection: resetQuickCommandsSelection } = quickCommandsStore;
@@ -309,6 +311,17 @@ const openFileManagerModal = () => {
}
};
+// +++ Function to request opening the file editor modal +++
+const openFileEditorModal = () => {
+ if (activeSessionId.value) {
+ console.log(`[CommandInputBar] Triggering popup editor for session: ${activeSessionId.value}`);
+ fileEditorStore.triggerPopup('', activeSessionId.value); // Call store action directly
+ } else {
+ console.warn('[CommandInputBar] Cannot open file editor modal: No active session ID.');
+ // Optionally, show a notification to the user
+ }
+};
+
// +++ Handler for command execution from the modal +++
const handleQuickCommandExecute = (command: string) => {
console.log(`[CommandInputBar] Executing quick command: ${command}`);
@@ -420,6 +433,15 @@ const handleQuickCommandExecute = (command: string) => {
>
+
+
diff --git a/packages/frontend/src/locales/en-US.json b/packages/frontend/src/locales/en-US.json
index 8173d84..874c8e6 100644
--- a/packages/frontend/src/locales/en-US.json
+++ b/packages/frontend/src/locales/en-US.json
@@ -302,6 +302,12 @@
"reconnectingMsg": "Attempting to reconnect..."
}
},
+"fileEditor": {
+ "title": "File Editor"
+ },
+"fileEditor": {
+ "title": "File Editor"
+ },
"fileManager": {
"currentPath": "Current Path",
"loading": "Loading directory...",
diff --git a/packages/frontend/src/locales/ja-JP.json b/packages/frontend/src/locales/ja-JP.json
index e566edf..74b697c 100644
--- a/packages/frontend/src/locales/ja-JP.json
+++ b/packages/frontend/src/locales/ja-JP.json
@@ -312,6 +312,9 @@
},
"waitingForSsh": "SSH接続を待機中..."
},
+"fileEditor": {
+ "title": "ファイルエディタ"
+ },
"fileManager": {
"actions": {
"cancel": "キャンセル",
diff --git a/packages/frontend/src/locales/zh-CN.json b/packages/frontend/src/locales/zh-CN.json
index a229655..94c95f2 100644
--- a/packages/frontend/src/locales/zh-CN.json
+++ b/packages/frontend/src/locales/zh-CN.json
@@ -301,6 +301,9 @@
"reconnectingMsg": "正在尝试重新连接..."
}
},
+"fileEditor": {
+ "title": "文件编辑器"
+ },
"fileManager": {
"currentPath": "当前路径",
"loading": "正在加载目录...",