Files
goodbuddy/src/main/workspace/unsupported-remote-workspace-access.ts
T
mesalogo f669e490b8 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 分支并查看提交历史,返回预览后保留浏览位置;浏览器支持在工作栏内直接交互和全屏显示。
2026-09-09 15:47:24 +08:00

76 lines
1.6 KiB
TypeScript

import type {
DirectoryPage,
FilePreview,
SearchPage,
WorkspaceAccess,
WorkspaceChanges,
WorkspaceChangesInput,
WorkspaceDirectoryInput,
WorkspaceEntry,
WorkspaceIdentity,
WorkspacePathInput,
WorkspaceReadInput,
WorkspaceSearchInput,
WorkspaceWriteInput,
WriteResult
} from './workspace-access'
const unsupportedRemoteMessage = '远程工作区访问尚不可用'
export class UnsupportedRemoteWorkspaceAccess
implements WorkspaceAccess {
constructor(
private readonly message: string = unsupportedRemoteMessage
) {}
private unsupported(): never {
throw new Error(this.message)
}
async manage(): Promise<never> { return this.unsupported() }
async getIdentity(): Promise<WorkspaceIdentity> {
return this.unsupported()
}
async listDirectory(
input: WorkspaceDirectoryInput
): Promise<DirectoryPage> {
void input
return this.unsupported()
}
async stat(input: WorkspacePathInput): Promise<WorkspaceEntry> {
void input
return this.unsupported()
}
async readText(input: WorkspaceReadInput): Promise<FilePreview> {
void input
return this.unsupported()
}
async writeTextAtomic(
input: WorkspaceWriteInput
): Promise<WriteResult> {
void input
return this.unsupported()
}
async search(input: WorkspaceSearchInput): Promise<SearchPage> {
void input
return this.unsupported()
}
async getChanges(
input: WorkspaceChangesInput
): Promise<WorkspaceChanges> {
void input
return this.unsupported()
}
async dispose(): Promise<void> {
// Cleanup is always safe and idempotent, even when access is unsupported.
}
}