feat: add workspace file management and embedded browsing

Users previously had to leave the workbar to manage project files and inspect Git branches or commit history. Add file and directory creation, rename, move, delete and properties, plus searchable branches, branch creation and switching, explicit fetch, and commit file diffs.

Keep file previews in the right workspace pane with directory expansion, selection, scroll and focus preserved on return. Add compact action menus, directory pickers, preview refresh and source switching. Embed the shared browser session directly in the workbar with navigation, resizing and fullscreen controls instead of a separate interaction window.

Moves stay within the current workspace, deletion is permanent after confirmation, and Git switch reports conflicts without discarding or stashing changes. Typecheck, lint and staged whitespace checks pass; existing full-suite failures and the blocked real remote directory validation remain recorded in the workbar progress document.

Release note: 可在右侧工作区管理文件、切换 Git 分支并查看提交历史,返回预览后保留浏览位置;浏览器支持在工作栏内直接交互和全屏显示。
This commit is contained in:
mesalogo
2026-09-09 15:47:24 +08:00
parent b6d4633a33
commit f669e490b8
38 changed files with 2336 additions and 772 deletions
@@ -1,4 +1,5 @@
import {
remoteWorkspaceManageRequestSchema,
remoteGitDiffRequestSchema,
remoteGitDiffResultSchema,
remoteGitStatusRequestSchema,
@@ -25,6 +26,8 @@ import type {
ProtocolMethodHandler
} from './protocol-server'
import type { WorkspaceGitService } from './workspace-git-service'
import { manageWorkspace } from '../main/workspace/workspace-management'
import { workspaceManagementResultSchema } from '../shared/workspace-management-contracts'
import type { WorkspaceRegistry } from './workspace-registry'
import {
WorkspaceServiceError,
@@ -35,6 +38,7 @@ const DEFAULT_WORKSPACE_REQUEST_TIMEOUT_MS = 30_000
const MAXIMUM_WORKSPACE_REQUEST_TIMEOUT_MS = 120_000
export const WORKSPACE_PROTOCOL_METHODS = [
'workspace/manage',
'workspace/validate',
'workspace/open',
'workspace/resume',
@@ -77,6 +81,15 @@ export function createWorkspaceProtocolMethods(options: {
}
return {
'workspace/manage': async (params, context) => {
const request = remoteWorkspaceManageRequestSchema.parse(params)
return await invoke(context, async (io) => {
const workspace = await options.workspaces.get(request.workspaceId, request.generation, context.controller, io)
if (workspace.handle.access !== 'read-write') throw new WorkspaceServiceError('Workspace management requires read-write access', 'read-only')
await workspace.access.assertCurrent(io)
return workspaceManagementResultSchema.parse(await manageWorkspace(workspace.access.root.canonicalPath, request.action, io.signal))
})
},
'workspace/validate': async (params, context) =>
await invoke(context, async (io) =>
remoteWorkspaceValidateResultSchema.parse(