From 10df92ffa3550c16c2d37dd0103ca894ce10dfbc Mon Sep 17 00:00:00 2001 From: yinjianm Date: Wed, 25 Mar 2026 04:18:26 +0800 Subject: [PATCH] fix(workspace): refine workbench defaults and cursor Add Quick Commands as the default Workbench tab and update the default three-column layout proportions to better match the intended workspace design. Also fix terminal hover cursor behavior and add locale and docs updates for the new default interaction. --- .helloagents/CHANGELOG.md | 1 + .../tasks.md | 1 + .helloagents/modules/frontend.md | 4 +- packages/frontend/src/components/Terminal.vue | 11 +++ .../src/components/WorkspaceWorkbench.vue | 71 ++++++++++++++++++- packages/frontend/src/locales/en-US.json | 1 + packages/frontend/src/locales/ja-JP.json | 1 + packages/frontend/src/locales/zh-CN.json | 1 + packages/frontend/src/stores/layout.store.ts | 33 +++++++-- 9 files changed, 114 insertions(+), 10 deletions(-) diff --git a/.helloagents/CHANGELOG.md b/.helloagents/CHANGELOG.md index 68339c4..dd921c0 100644 --- a/.helloagents/CHANGELOG.md +++ b/.helloagents/CHANGELOG.md @@ -5,3 +5,4 @@ - 2026-03-25:初始化 `.helloagents/` 知识库骨架与首批模块文档,不代表源码功能变更。 - 2026-03-25:新增 GHCR Docker 发布 workflow,并将 `docker-compose.yml` 的三个业务镜像切换到 `ghcr.io/micah123321/*`。 - 2026-03-25:`/workspace` 默认布局改为“左侧 Workbench + 中央视终端 + 右侧状态监控”,并在状态监控中新增开机累计上下行流量展示。 +- 2026-03-25:继续微调 `/workspace` Workbench,新增默认“快捷指令”标签、调整三栏宽度到更接近 xterminal 参考图,并修复终端区域鼠标悬停时指针异常消失的问题。 diff --git a/.helloagents/archive/2026-03/202603251200_workspace-workbench-monitor/tasks.md b/.helloagents/archive/2026-03/202603251200_workspace-workbench-monitor/tasks.md index ce5a6c7..045655f 100644 --- a/.helloagents/archive/2026-03/202603251200_workspace-workbench-monitor/tasks.md +++ b/.helloagents/archive/2026-03/202603251200_workspace-workbench-monitor/tasks.md @@ -48,6 +48,7 @@ | 2026-03-25 12:20 | 3.1 / 3.2 | 完成 | 后端透出累计上下行字节数,前端状态监控新增“开机累计流量”展示 | | 2026-03-25 12:31 | 4.1 | 完成 | 执行 `npm install` 后,前后端 build 均通过 | | 2026-03-25 12:33 | 4.2 | 完成 | 更新模块文档、变更日志并准备归档 | +| 2026-03-25 12:48 | follow-up | 完成 | Workbench 新增默认快捷指令 tab,微调三栏宽度并修复终端鼠标悬停指针异常 | --- diff --git a/.helloagents/modules/frontend.md b/.helloagents/modules/frontend.md index 21ed0ed..366ce5e 100644 --- a/.helloagents/modules/frontend.md +++ b/.helloagents/modules/frontend.md @@ -36,8 +36,8 @@ ### 工作区交互 **条件**: 用户进入 `/workspace` 或相关管理页面。 -**行为**: 通过组件、Pinia 与 composable 协同管理终端、文件管理、命令历史、布局配置、主题和状态监控;当前 `/workspace` 默认主布局为“左侧 Workbench、中央终端、右侧状态监控”,其中 Workbench 以 tab 容器整合命令历史、文件管理和编辑器。 -**结果**: 页面逻辑分散在 `views/`、`components/`、`stores/` 与 `composables/`,其中布局调整优先落在 `layout.store.ts`、`LayoutRenderer.vue` 与 `WorkspaceWorkbench.vue`。 +**行为**: 通过组件、Pinia 与 composable 协同管理终端、文件管理、命令历史、布局配置、主题和状态监控;当前 `/workspace` 默认主布局为“左侧 Workbench、中央终端、右侧状态监控”,其中 Workbench 以 tab 容器整合快捷指令、命令历史、文件管理和编辑器,默认激活快捷指令。 +**结果**: 页面逻辑分散在 `views/`、`components/`、`stores/` 与 `composables/`,其中布局与交互微调优先落在 `layout.store.ts`、`LayoutRenderer.vue`、`WorkspaceWorkbench.vue` 和 `Terminal.vue`。 ## 依赖关系 diff --git a/packages/frontend/src/components/Terminal.vue b/packages/frontend/src/components/Terminal.vue index 61c2ec7..c2d0b44 100644 --- a/packages/frontend/src/components/Terminal.vue +++ b/packages/frontend/src/components/Terminal.vue @@ -739,6 +739,17 @@ watchEffect(() => { /* z-index 调整或移除,因为背景层不再在此组件内 */ } +.terminal-inner-container, +.terminal-inner-container :deep(.xterm), +.terminal-inner-container :deep(.xterm-screen), +.terminal-inner-container :deep(.xterm-viewport) { + cursor: default !important; +} + +.terminal-inner-container :deep(.xterm .xterm-cursor-pointer) { + cursor: pointer !important; +} + /* 文字描边和阴影样式 */ .terminal-inner-container.has-text-stroke :deep(.xterm-rows span), .terminal-inner-container.has-text-stroke :deep(.xterm-rows div > span), /* 更具体地针对嵌套 span */ diff --git a/packages/frontend/src/components/WorkspaceWorkbench.vue b/packages/frontend/src/components/WorkspaceWorkbench.vue index 4c411e8..abbe199 100644 --- a/packages/frontend/src/components/WorkspaceWorkbench.vue +++ b/packages/frontend/src/components/WorkspaceWorkbench.vue @@ -3,13 +3,14 @@ import { computed, ref, watch, type PropType } from 'vue'; import { useI18n } from 'vue-i18n'; import { storeToRefs } from 'pinia'; import CommandHistoryView from '../views/CommandHistoryView.vue'; +import QuickCommandsView from '../views/QuickCommandsView.vue'; import FileManager from './FileManager.vue'; import FileEditorContainer from './FileEditorContainer.vue'; import { useSessionStore } from '../stores/session.store'; import type { FileTab } from '../stores/fileEditor.store'; import type { WebSocketDependencies } from '../composables/useSftpActions'; -type WorkbenchTab = 'files' | 'history' | 'editor'; +type WorkbenchTab = 'quickCommands' | 'files' | 'history' | 'editor'; const props = defineProps({ tabs: { @@ -42,9 +43,14 @@ const { t } = useI18n(); const sessionStore = useSessionStore(); const { sessions } = storeToRefs(sessionStore); -const activeWorkbenchTab = ref('files'); +const activeWorkbenchTab = ref('quickCommands'); const workbenchTabs = computed(() => [ + { + id: 'quickCommands' as const, + label: t('workspace.workbench.tabs.quickCommands', '快捷指令'), + icon: 'fas fa-bolt', + }, { id: 'files' as const, label: t('workspace.workbench.tabs.files', '文件'), @@ -106,7 +112,7 @@ watch( {{ t('workspace.workbench.label', '工作台') }} -
+