fix(frontend): 调整工作台文件总览与快捷指令菜单

将文件管理区从单目录文件表格修正为多根目录常驻的文件夹总览,
点击目录时仅展开和聚焦,不再切换为单独目录列表。

同时修复快捷指令右键菜单的透明背景与粘贴语义,
统一为“粘贴到命令输入框”且不自动发送,并同步多语言文案。

顺带收紧快捷指令编辑弹窗的最小尺寸、初始尺寸与视口上限,
降低小分辨率下的弹窗溢出概率。
This commit is contained in:
yinjianm
2026-03-26 02:04:07 +08:00
parent 3f6e2bffc6
commit b1f036fdc6
15 changed files with 517 additions and 208 deletions
@@ -209,7 +209,7 @@
<!-- Context Menu for Quick Commands -->
<div
v-if="quickCommandContextMenuVisible"
class="fixed bg-background border border-border/50 shadow-xl rounded-lg py-1.5 z-50 min-w-[180px] quick-command-context-menu"
class="fixed bg-card text-card-foreground border border-border shadow-xl rounded-lg py-1.5 z-50 min-w-[220px] quick-command-context-menu"
:style="{ top: `${quickCommandContextMenuPosition.y}px`, left: `${quickCommandContextMenuPosition.x}px` }"
@click.stop
>
@@ -225,10 +225,10 @@
<li
v-if="quickCommandContextTargetCommand"
class="group px-4 py-1.5 cursor-pointer flex items-center gap-3 text-foreground hover:bg-primary/10 hover:text-primary text-sm transition-colors duration-150 rounded-md mx-1"
@click="handleQuickCommandMenuAction('pasteToTerminal', quickCommandContextTargetCommand!)"
@click="handleQuickCommandMenuAction('pasteToCommandInput', quickCommandContextTargetCommand!)"
>
<i class="fas fa-terminal w-4 text-center text-text-secondary group-hover:text-primary"></i>
<span>{{ t('quickCommands.actions.pasteToTerminal', '粘贴到终端') }}</span>
<span>{{ t('quickCommands.actions.pasteToCommandInput', '粘贴到命令输入框') }}</span>
</li>
<li
v-if="quickCommandContextTargetCommand"
@@ -238,14 +238,6 @@
<i class="fas fa-copy w-4 text-center text-text-secondary group-hover:text-primary"></i>
<span>{{ t('quickCommands.actions.copyCommand', '复制命令') }}</span>
</li>
<li
v-if="quickCommandContextTargetCommand"
class="group px-4 py-1.5 cursor-pointer flex items-center gap-3 text-foreground hover:bg-primary/10 hover:text-primary text-sm transition-colors duration-150 rounded-md mx-1"
@click="handleQuickCommandMenuAction('pasteToQuickInput', quickCommandContextTargetCommand!)"
>
<i class="fas fa-i-cursor w-4 text-center text-text-secondary group-hover:text-primary"></i>
<span>{{ t('quickCommands.actions.pasteToQuickInput', '粘贴到快捷输入框') }}</span>
</li>
<li
v-if="quickCommandContextTargetCommand"
class="group px-4 py-1.5 cursor-pointer flex items-center gap-3 text-foreground hover:bg-primary/10 hover:text-primary text-sm transition-colors duration-150 rounded-md mx-1"
@@ -324,9 +316,8 @@ const quickCommandContextMenuPosition = ref({ x: 0, y: 0 });
const quickCommandContextTargetCommand = ref<QuickCommandFE | null>(null);
type QuickCommandContextAction =
| 'runNow'
| 'pasteToTerminal'
| 'pasteToCommandInput'
| 'copyCommand'
| 'pasteToQuickInput'
| 'edit'
| 'delete'
| 'sendToAllSessions';
@@ -675,18 +666,7 @@ const pasteCommandToTerminalInput = async (cmd: QuickCommandFE) => {
}
sessionStore.updateSessionCommandInput(activeSessionId, await resolveProcessedCommand(cmd, activeSessionId));
uiNotificationsStore.showSuccess(t('quickCommands.notifications.pastedToTerminal', '已粘贴到终端输入框'));
};
const pasteCommandToQuickInput = async (cmd: QuickCommandFE) => {
const activeSessionId = sessionStore.activeSessionId;
quickCommandsStore.setSearchTerm(await resolveProcessedCommand(cmd, activeSessionId));
await nextTick();
if (searchInputRef.value) {
searchInputRef.value.focus();
searchInputRef.value.select();
}
uiNotificationsStore.showSuccess(t('quickCommands.notifications.pastedToQuickInput', '已粘贴到快捷输入框'));
uiNotificationsStore.showSuccess(t('quickCommands.notifications.pastedToCommandInput', '已粘贴到命令输入框'));
};
// +++ 聚焦搜索框的方法 +++
@@ -866,7 +846,7 @@ const handleQuickCommandMenuAction = async (action: QuickCommandContextAction, c
return;
}
if (action === 'pasteToTerminal') {
if (action === 'pasteToCommandInput') {
await pasteCommandToTerminalInput(command);
return;
}
@@ -876,11 +856,6 @@ const handleQuickCommandMenuAction = async (action: QuickCommandContextAction, c
return;
}
if (action === 'pasteToQuickInput') {
await pasteCommandToQuickInput(command);
return;
}
if (action === 'edit') {
openEditForm(command);
return;