feat(welcome): show Remote Development as a header button

Move Remote Development out of the More Actions menu into the welcome
header next to Clone Repository. Give it a server icon instead of the
folder that Open already uses, and give New File a page-with-plus icon
instead of the plus that New Project uses.

Header buttons no longer cap their width, so labels are not cut off;
they collapse to icons below 740px instead of 600px.

In the Remote Development dialog, fields share one column and their
side buttons another, so the SSH configuration and project directory
rows end at the same edge, aligned with the dialog's buttons.
Цей коміт міститься в:
l0ng-ai committed 2026-11-21 21:40:31 +08:00
1 джерело 83364c5423
коміт 9570292337
11 files changed
+43 -19

No files matched your search

+1 -1
Переглянути файл
@@ -544,7 +544,7 @@ export function windowActions(): Action[] {
id: "file.newUntitled",
title: t("app.action.newFile"),
category: t("app.category.file"),
icon: "plus",
icon: "file-new",
keywords: ["new", "create", "untitled", "file", "light edit"],
run: async () => {
if (desktopOnly()) return;
+16 -8
Переглянути файл
@@ -1,8 +1,13 @@
/* Fields fill the first column; their side buttons share the second, so both rows end at the same edge. */
.form {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
padding: 14px;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: var(--space-1-5) var(--space-2);
align-items: center;
padding: 14px var(--space-4);
}
.form > * {
grid-column: 1 / -1;
}
.hint {
margin: 0 0 6px;
@@ -14,12 +19,15 @@
margin-top: 4px;
}
.row {
display: flex;
gap: var(--space-2);
align-items: center;
display: contents;
}
.row > * {
grid-column: auto;
}
.row > :only-child {
grid-column: 1 / -1;
}
.grow {
flex: 1;
min-width: 0;
}
.folders {
+1 -1
Переглянути файл
@@ -71,7 +71,7 @@ export function activate(): () => void {
title: "Remote Development…",
description: "Opens a project folder on an SSH host; the IDE backend runs on that host.",
category: "File",
icon: "folder",
icon: "remote",
keywords: ["ssh", "remote", "server", "gateway", "connect", "host"],
run: () => openConnectDialog(),
},
+1 -1
Переглянути файл
@@ -18,7 +18,7 @@ const ACTIONS: { id: string; label: string; icon: IconName }[] = [
{ id: "file.newProject", label: "New Project…", icon: "plus" },
{ id: "file.openProject", label: "Open…", icon: "folder" },
{ id: "vcs.clone", label: "Clone Repository…", icon: "branch" },
{ id: "remote.connect", label: "Remote Development…", icon: "terminal" },
{ id: "remote.connect", label: "Remote Development…", icon: "remote" },
];
function useOpenProjects(): OpenProject[] {
+5 -4
Переглянути файл
@@ -1,4 +1,4 @@
/** Welcome › Projects: search, New Project / Open / Clone Repository, and the recent projects list. */
/** Welcome › Projects: search, New Project / Open / Clone Repository / Remote Development, and the recent projects list. */
import { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent } from "react";
import clsx from "clsx";
import { executeAction, useActions } from "@/platform/actions";
@@ -29,6 +29,7 @@ import { tx } from "@/platform/i18n";
function HeaderButtons() {
const canClone = useActions((s) => s.actions.has("vcs.clone"));
const canRemote = useActions((s) => s.actions.has("remote.connect"));
const opening = useProject((s) => s.opening);
const canCreate = useActions((s) => s.actions.has("file.newProject"));
const openKey = shortcutLabel("file.openProject");
@@ -45,11 +46,11 @@ function HeaderButtons() {
disabled: opening,
},
{ id: "vcs.clone", label: "Clone Repository", icon: "branch", available: canClone },
{ id: "remote.connect", label: "Remote Development", icon: "remote", available: canRemote, disabled: opening },
];
const secondary: MenuItem[] = [
{ kind: "action", action: "file.newUntitled", label: "New File", disabled: opening },
{ kind: "action", action: "file.openFile", label: "Open File", disabled: opening },
{ kind: "action", action: "remote.connect", label: "Remote Development", disabled: opening },
];
return (
<div className={styles.headerButtons} role="group" aria-label={tx("Project actions")}>
@@ -114,7 +115,7 @@ function Landing() {
<div className={styles.landingActions}>
<button type="button" className={styles.landingAction} onClick={() => void executeAction("file.newUntitled")}>
<span className={styles.landingIcon}>
<Icon name="plus" size={20} />
<Icon name="file-new" size={20} />
</span>
<T>New File</T>
</button>
@@ -164,7 +165,7 @@ function Landing() {
onClick={() => void executeAction("remote.connect")}
>
<span className={styles.landingIcon}>
<Icon name="terminal" size={20} />
<Icon name="remote" size={20} />
</span>
<T>Remote Development</T>
</button>
+1 -4
Переглянути файл
@@ -154,15 +154,12 @@
align-items: center;
gap: var(--space-1);
}
.headerAction {
max-width: 146px;
}
.headerActionLabel {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
@container welcome-projects (max-width: 600px) {
@container welcome-projects (max-width: 740px) {
.headerAction {
width: var(--h-control);
padding: 0;
+2
Переглянути файл
@@ -423,6 +423,8 @@ const ICONS = {
export: "openidea/general/export",
artifact: "openidea/general/artifact",
web: "openidea/general/web",
remote: "openidea/general/remote",
"file-new": "openidea/general/newFile",
"browser-chrome": "openidea/browsers/chrome",
"browser-chromium": "openidea/browsers/chromium",
"browser-firefox": "openidea/browsers/firefox",
+4
Переглянути файл
@@ -0,0 +1,4 @@
<!-- OpenIDEA: new file (page with a plus) -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 13.5H4.5C3.94772 13.5 3.5 13.0523 3.5 12.5V3.5C3.5 2.94772 3.94772 2.5 4.5 2.5H9L12.5 6V8" stroke="#6C707E" stroke-linejoin="round"/><path d="M8.5 2.5V6.5H12.5" stroke="#6C707E" stroke-linejoin="round"/><path d="M12 10V15M9.5 12.5H14.5" stroke="#6C707E" stroke-linecap="round"/>
</svg>

Після

Ширина:  |  Висота:  |  Розмір: 441 B

+4
Переглянути файл
@@ -0,0 +1,4 @@
<!-- OpenIDEA: new file (page with a plus) -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 13.5H4.5C3.94772 13.5 3.5 13.0523 3.5 12.5V3.5C3.5 2.94772 3.94772 2.5 4.5 2.5H9L12.5 6V8" stroke="#CED0D6" stroke-linejoin="round"/><path d="M8.5 2.5V6.5H12.5" stroke="#CED0D6" stroke-linejoin="round"/><path d="M12 10V15M9.5 12.5H14.5" stroke="#CED0D6" stroke-linecap="round"/>
</svg>

Після

Ширина:  |  Висота:  |  Розмір: 441 B

+4
Переглянути файл
@@ -0,0 +1,4 @@
<!-- OpenIDEA: remote host (server) -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.5" y="2.5" width="11" height="4.5" rx="1" stroke="#6C707E"/><rect x="2.5" y="9" width="11" height="4.5" rx="1" stroke="#6C707E"/><circle cx="5" cy="4.75" r="0.75" fill="#6C707E"/><circle cx="5" cy="11.25" r="0.75" fill="#6C707E"/><path d="M8 4.75H11M8 11.25H11" stroke="#6C707E" stroke-linecap="round"/>
</svg>

Після

Ширина:  |  Висота:  |  Розмір: 458 B

+4
Переглянути файл
@@ -0,0 +1,4 @@
<!-- OpenIDEA: remote host (server) -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.5" y="2.5" width="11" height="4.5" rx="1" stroke="#CED0D6"/><rect x="2.5" y="9" width="11" height="4.5" rx="1" stroke="#CED0D6"/><circle cx="5" cy="4.75" r="0.75" fill="#CED0D6"/><circle cx="5" cy="11.25" r="0.75" fill="#CED0D6"/><path d="M8 4.75H11M8 11.25H11" stroke="#CED0D6" stroke-linecap="round"/>
</svg>

Після

Ширина:  |  Висота:  |  Розмір: 458 B