feat(sidebar): 文件页与文件变动页 UIUX 重构 + 全局组件抽取

文件页(FileTree/TreePanel)
- Ctrl/Cmd 多选 + Shift 按可见行序连选(Esc/点空白/右键收敛),批量条支持复制路径、批量删除(共享 ConfirmDialog + 顺序 fsRemove)
- Git 变更着色:行名按状态上色 + M/A/D/U 徽标,目录按 dirHasChanges 着色,非仓库静默降级(数据来自共享 git 状态存储)
- 新建文件夹:fs.mkdir 路由 + mkdirWorkspaceEntry + 内联输入行(Enter/Esc/blur/IME 守卫)
- 性能:FileRow/DirRow memo(含反向验证)、搜索 hidden 停车不再卸载树、level 拉取世代守卫 + AbortController、fs.tree truncated 提示、use-dir-watch 入参 memo
- 拖拽上传视觉 token 化(硬编码色清零);可见性下传后隐藏页签停止轮询
- 右键「打开方式」改为复用 DSH 自带 open-in-app(宿主探测的关联应用 + 文件管理器显示)

文件变动页(changes/diff)
- 36px 头(宿主 SegmentedControl)+ 单一 ChangeRow + SectionHeader 分组 + 吸底提交条单状态行 + 历史独立空态
- 修掉:双份空态、暂存失败 unhandled rejection、手动刷新被丢、仓库切换刷新两次、worktree 清单缺 repoRoot、工作树被自动切走、预览持旧快照、恢复高度未 clamp、session ops 无谓轮询
- DiffPane/DiffTab 共用 use-git-diff;修掉 DiffPane 的 untracked 预览从不渲染

全局组件与宿主接入
- 新增 src/client/ui(IconButton/Chip/SectionHeader/Notice/ConfirmDialog/StatusBadge + 共享 git 状态存储)
- 新增 src/client/open-in-app.ts(宿主 open-in-app 客户端适配),删除自研 open-with 全链路与 open.external 路由
- 客户端 inject 补 remote / remote.session:缺声明时 ctx.get('remote').session 会抛出并把整个面板打成错误条(真实挂载 lane 抓到)
- 词典:+25 键 / -20 openWith* / -noChanges,20 份同步

验证:typecheck / lint / test(126 文件 1322 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过(含 tab sweep 与 perf lane)
This commit is contained in:
Menghuan1918 committed 2026-09-28 00:27:31 +08:00
1 parent 606339f81e
commit 36fbc5ac7e
76 files changed
+6961 -3944

No files matched your search

+25 -21
View File
@@ -57,26 +57,31 @@ export const vi: Record<string, string> = {
editorEmptyHint: 'Chọn tệp từ cây tệp bên phải hoặc ô nhập đường dẫn phía trên để xem trước',
openFileNewTab: 'Mở trong Tab mới',
openFileSide: 'Mở ở bên cạnh',
openWithMenu: 'Mở bằng',
openWithSshSuffix: ' (SSH)',
pinOpenWith: 'Ghim vào menu',
unpinOpenWith: 'Bỏ ghim',
openWithExplorer: 'Trình quản lý tệp',
openWithVscode: 'VS Code',
openWithCursor: 'Cursor',
openWithZed: 'Zed',
openWithSettingsSshTitle: 'Máy chủ từ xa SSH',
openWithSettingsSshDesc: 'Để trống cho không gian làm việc cục bộ; nhập user@host hoặc alias SSH, các trình mở họ VSCode sẽ chuyển sang giao thức vscode-remote/ssh-remote, Trình quản lý tệp / Zed / trình soạn thảo tùy chỉnh không phải VSCode sẽ ẩn khỏi menu',
openWithSettingsSshPlaceholder: 'user@host hoặc alias SSH',
openWithSettingsCustomTitle: 'Trình soạn thảo tùy chỉnh',
openWithSettingsCustomDesc: 'Tên + mẫu URL (placeholder {path}) + cờ họ VSCode; ở chế độ SSH chỉ họ VSCode mở được đường dẫn từ xa',
openWithSettingsAdd: 'Thêm',
openWithSettingsName: 'Tên',
openWithSettingsTemplate: 'vd: cursor://file/{path}',
openWithSettingsFamily: 'Họ VSCode',
openWithSettingsFamilyDesc: 'Trình soạn thảo này dùng giao thức URL của VSCode (hỗ trợ mở từ xa qua SSH)',
openWithSettingsRemove: 'Xóa',
openWithSettingsInvalidHint: 'Trình soạn thảo thiếu tên hoặc mẫu (cần chứa {path} và bắt đầu bằng scheme://) sẽ không xuất hiện trong menu',
openInApp: 'Mở bằng',
openInAppDefault: 'Mở bằng ứng dụng mặc định',
openInAppEmpty: 'Không có ứng dụng nào mở được tệp này',
openInAppFailed: 'Không mở được: {path}',
revealInFileManager: 'Hiển thị trong trình quản lý tệp',
filesSelected: 'Đã chọn {count}',
clearSelection: 'Bỏ chọn',
copyPaths: 'Sao chép đường dẫn',
deleteSelected: 'Xóa mục đã chọn',
deleteSelectedTitle: 'Xóa {count} mục đã chọn?',
deleteSelectedDesc: 'Các tệp và thư mục này sẽ bị xóa vĩnh viễn, không thể khôi phục.',
newFolder: 'Thư mục mới',
newFolderPlaceholder: 'Tên thư mục',
newFolderInvalid: 'Tên thư mục không hợp lệ',
filesTruncated: 'Thư mục này có quá nhiều mục; chỉ hiển thị phần đầu',
gitStatusModified: 'Đã sửa',
gitStatusAdded: 'Đã thêm',
gitStatusDeleted: 'Đã xóa',
gitStatusUntracked: 'Chưa theo dõi',
gitStatusRenamed: 'Đã đổi tên',
gitStatusConflict: 'Xung đột',
changesClean: 'Không có thay đổi trong workspace',
changesNoHistory: 'Chưa có lịch sử commit',
changesStageFailed: 'Stage thất bại: {message}',
changesOpGone: 'Thao tác này không còn trong nhật ký phiên',
newTab: 'Tab mới',
brokenSymlink: 'Symlink hỏng',
close: 'Đóng',
@@ -120,7 +125,6 @@ export const vi: Record<string, string> = {
error: 'Tải thất bại',
retry: 'Thử lại',
notRepo: 'Thư mục hiện tại không phải repo git',
noChanges: 'Không có thay đổi',
statusTruncated: 'Quá nhiều thay đổi; chỉ hiển thị 2000 mục đầu tiên',
stage: 'Stage',
unstage: 'Unstage',