feat(workspace): enhance previews, terminal, and tab splitting - #2273
Merged
openai0229 merged 14 commits intoAug 3, 2026
Conversation
auenger
force-pushed
the
feat/workspace-file-preview-terminal
branch
from
July 28, 2026 03:23
8597078 to
ae975e8
Compare
# Conflicts: # chat2db-community-client/scripts/i18n-source-hashes.json
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

背景
工作台的“文件”区域原先主要面向 SQL/文本编辑,缺少 Markdown 富预览、图片/PDF 预览和从当前目录直接启动终端的能力。本 PR 在 Community JCEF 桌面端补齐完整文件预览与集成终端链路,不引入 Electron API,也不改变 Community 离线、本地和 loopback 运行约束。
功能清单
1. 文件树与文件打开
2. Markdown 编辑与 Review
getInstance()获取实例,并在绑定滚动事件前检查 API,避免onDidScrollChange is not a function导致白屏。3. 图片与 PDF 预览
4. 集成终端
window.javaQueryJCEF bridge 推送到前端。TERM=xterm-256color、COLORTERM=truecolor、TERM_PROGRAM=Chat2DB。NO_COLOR,设置FORCE_COLOR=1、CLICOLOR_FORCE=1和兼容颜色变量,解决 Node 同时检测到NO_COLOR/FORCE_COLOR的警告,同时保留命令颜色。5. 国际化
zh-CN、en-US、ja-JP、ko-KR、es-ES。主要实现位置
chat2db-community-client/src/pages/main/workspace/components/WorkspaceTabs/FilePreviewTab.tsxchat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/handler/biz/ReadSqlDirectoryPreviewHandler.javachat2db-community-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsxchat2db-community-client/src/pages/main/workspace/components/LocalSQLFileTree/index.tsxchat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/handler/biz/SqlDirectoryTreeStore.javachat2db-community-client/src/pages/main/workspace/components/WorkspaceTabs/TerminalTab.tsxchat2db-community-client/src/blocks/Setting/TerminalSetting/index.tsxchat2db-community-client/src/components/Xterm/index.tsxchat2db-community-client/src/constants/terminal.tschat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/terminal/TerminalSessionManager.javachat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/handler/biz/*TerminalHandler.java验证结果
前端
COREPACK_ENABLE_PROJECT_SPEC=0 corepack yarn run build:web:community --app_version=0.0.0JCEF/后端
TerminalSessionManagerTest:6 个测试通过,0 failure,0 error,0 skipped。NO_COLOR、启用颜色和兼容颜色变量。SqlDirectoryTreeStoreTest已增加文件树/预览路径相关覆盖。clean package:通过。-Dmaven.test.skip=true,测试结果以上述显式启用的 focused test 为准。prepare:通过。git diff --check:通过。未覆盖与平台说明
6. Tab 拖动自动切分
workspaceTabDrop.test.ts,覆盖 drop ID、四向布局映射、首个分栏、跨 Pane 嵌套切分和无效唯一 Tab 拖动。git diff --check均通过。