|
|
@@ -9,6 +9,7 @@ import { useQuickCommandsStore } from '../stores/quickCommands.store';
|
|
|
|
import { useCommandHistoryStore } from '../stores/commandHistory.store';
|
|
|
|
import { useCommandHistoryStore } from '../stores/commandHistory.store';
|
|
|
|
import QuickCommandsModal from './QuickCommandsModal.vue'; // +++ Import the modal component +++
|
|
|
|
import QuickCommandsModal from './QuickCommandsModal.vue'; // +++ Import the modal component +++
|
|
|
|
import SuspendedSshSessionsModal from './SuspendedSshSessionsModal.vue'; // +++ Import the new modal +++
|
|
|
|
import SuspendedSshSessionsModal from './SuspendedSshSessionsModal.vue'; // +++ Import the new modal +++
|
|
|
|
|
|
|
|
import { useFileEditorStore } from '../stores/fileEditor.store'; // +++ Import File Editor Store +++
|
|
|
|
import { useWorkspaceEventEmitter } from '../composables/workspaceEvents';
|
|
|
|
import { useWorkspaceEventEmitter } from '../composables/workspaceEvents';
|
|
|
|
|
|
|
|
|
|
|
|
// Disable attribute inheritance as this component has multiple root nodes (div + modal)
|
|
|
|
// Disable attribute inheritance as this component has multiple root nodes (div + modal)
|
|
|
@@ -23,9 +24,10 @@ const settingsStore = useSettingsStore();
|
|
|
|
const quickCommandsStore = useQuickCommandsStore();
|
|
|
|
const quickCommandsStore = useQuickCommandsStore();
|
|
|
|
const commandHistoryStore = useCommandHistoryStore();
|
|
|
|
const commandHistoryStore = useCommandHistoryStore();
|
|
|
|
const sessionStore = useSessionStore(); // +++ 初始化 Session Store +++
|
|
|
|
const sessionStore = useSessionStore(); // +++ 初始化 Session Store +++
|
|
|
|
|
|
|
|
const fileEditorStore = useFileEditorStore(); // +++ Initialize File Editor Store +++
|
|
|
|
|
|
|
|
|
|
|
|
// Get reactive setting from 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
|
|
|
|
// Get reactive state and actions from quick commands store
|
|
|
|
const { selectedIndex: quickCommandsSelectedIndex, flatVisibleCommands: quickCommandsFiltered } = storeToRefs(quickCommandsStore);
|
|
|
|
const { selectedIndex: quickCommandsSelectedIndex, flatVisibleCommands: quickCommandsFiltered } = storeToRefs(quickCommandsStore);
|
|
|
|
const { resetSelection: resetQuickCommandsSelection } = 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 +++
|
|
|
|
// +++ Handler for command execution from the modal +++
|
|
|
|
const handleQuickCommandExecute = (command: string) => {
|
|
|
|
const handleQuickCommandExecute = (command: string) => {
|
|
|
|
console.log(`[CommandInputBar] Executing quick command: ${command}`);
|
|
|
|
console.log(`[CommandInputBar] Executing quick command: ${command}`);
|
|
|
@@ -420,6 +433,15 @@ const handleQuickCommandExecute = (command: string) => {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i class="fas fa-folder text-base"></i>
|
|
|
|
<i class="fas fa-folder text-base"></i>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<!-- File Editor Button -->
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
v-if="showPopupFileEditorBoolean"
|
|
|
|
|
|
|
|
@click="openFileEditorModal"
|
|
|
|
|
|
|
|
class="flex-shrink-0 flex items-center justify-center w-8 h-8 border border-border/50 rounded-lg text-text-secondary transition-colors duration-200 hover:bg-border hover:text-foreground"
|
|
|
|
|
|
|
|
:title="t('fileEditor.title', '文件编辑器')"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<i class="fas fa-edit text-base"></i>
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Search navigation buttons (Hide on mobile when searching) -->
|
|
|
|
<!-- Search navigation buttons (Hide on mobile when searching) -->
|
|
|
|
<template v-if="isSearching && !props.isMobile"> <!-- +++ Add !props.isMobile condition +++ -->
|
|
|
|
<template v-if="isSearching && !props.isMobile"> <!-- +++ Add !props.isMobile condition +++ -->
|
|
|
|