feat(remote-dev): Remote Development in the project popup, opened in a new or this window

- The title bar project popup lists Remote Development… next to Open… and Clone Repository….
- Opening a remote project follows "Open project in" (new window / this window / ask) when this window already has a project, and confirms leaving the current one first.
- A remote project already open in another window focuses that window.
- A new window connects to the host itself and shows the connection progress on its welcome screen.
- Recent remote projects get Open in New Window.
Цей коміт міститься в:
l0ng-ai committed 2026-10-28 11:29:13 +08:00
1 джерело 45c7f43c02
коміт 0222c84ace
15 files changed
+210 -62

No files matched your search

+2 -2
Переглянути файл
@@ -4175,12 +4175,12 @@
"Delete remote": "删除远程",
"Delete local": "删除本地",
"Remote Development": "远程开发",
"The project runs on the remote host; this window shows it. The IDE backend is installed there on first use.": "项目在远程主机上运行,此窗口负责显示。首次使用时会在远程主机上安装 IDE 后端。",
"The project runs on the remote host; the IDE backend is installed there on first use.": "项目在远程主机上运行,首次使用时会在该主机上安装 IDE 后端。",
"SSH configuration:": "SSH 配置:",
"No SSH configurations": "没有 SSH 配置",
"Project directory:": "项目目录:",
"Remote Development…": "远程开发…",
"Opens a project folder on an SSH host in this window; the IDE backend runs on that host.": "在此窗口中打开 SSH 主机上的项目文件夹;IDE 后端在该主机上运行。",
"Opens a project folder on an SSH host; the IDE backend runs on that host.": "打开 SSH 主机上的项目文件夹;IDE 后端在该主机上运行。",
"Disconnect from Remote Host": "断开与远程主机的连接",
"Opens a terminal tab connected to an SSH configuration (`arg`: its id; otherwise a chooser).": "打开连接到 SSH 配置的终端标签页(`arg`:配置 id;否则显示选择器)。",
"Connecting to the host…": "正在连接主机…",
+10 -4
Переглянути файл
@@ -96,15 +96,21 @@ export async function restoreRemote(): Promise<RemoteSession | null> {
return session;
}
/** Where the connection in progress is (`null`: none). */
export const useRemoteProgress = create<{ progress: RemoteProgress | null }>(() => ({ progress: null }));
/** Where the connection in progress is, and to which location (`null`: none). */
export const useRemoteProgress = create<{ progress: RemoteProgress | null; location: string | null }>(() => ({
progress: null,
location: null,
}));
/** Opens `path` on the host of SSH configuration `sshConfig` in this window. */
export async function connectRemote(sshConfig: string, path: string) {
useProject.setState({ opening: true });
const onProgress = new Channel<RemoteProgress>();
onProgress.onmessage = (progress) => useRemoteProgress.setState({ progress });
useRemoteProgress.setState({ progress: { stage: "connecting", fraction: null } });
useRemoteProgress.setState({
progress: { stage: "connecting", fraction: null },
location: remoteLocation(sshConfig, path),
});
try {
const r = await call(commands.remoteConnect(sshConfig, path, onProgress));
enableRemote({ sshConfig: r.sshConfig, root: r.root, host: r.host, commands: r.commands });
@@ -119,7 +125,7 @@ export async function connectRemote(sshConfig: string, path: string) {
return r;
} finally {
useProject.setState({ opening: false });
useRemoteProgress.setState({ progress: null });
useRemoteProgress.setState({ progress: null, location: null });
}
}