From 9570292337237731e1146bb15ae2ceaad2e72b5e Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 21 Nov 2026 21:40:31 +0800 Subject: [PATCH] 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. --- src/features/app/windows.ts | 2 +- src/features/remote-dev/RemoteDev.module.css | 24 +++++++++++++------- src/features/remote-dev/index.ts | 2 +- src/features/welcome/ProjectPopup.tsx | 2 +- src/features/welcome/ProjectsPage.tsx | 9 ++++---- src/features/welcome/Welcome.module.css | 5 +--- src/ui/icons.tsx | 2 ++ src/ui/openidea/general/newFile.svg | 4 ++++ src/ui/openidea/general/newFile_dark.svg | 4 ++++ src/ui/openidea/general/remote.svg | 4 ++++ src/ui/openidea/general/remote_dark.svg | 4 ++++ 11 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 src/ui/openidea/general/newFile.svg create mode 100644 src/ui/openidea/general/newFile_dark.svg create mode 100644 src/ui/openidea/general/remote.svg create mode 100644 src/ui/openidea/general/remote_dark.svg diff --git a/src/features/app/windows.ts b/src/features/app/windows.ts index b4b4857d1b..31ef394128 100644 --- a/src/features/app/windows.ts +++ b/src/features/app/windows.ts @@ -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; diff --git a/src/features/remote-dev/RemoteDev.module.css b/src/features/remote-dev/RemoteDev.module.css index 623f4d4981..d0ea9c546f 100644 --- a/src/features/remote-dev/RemoteDev.module.css +++ b/src/features/remote-dev/RemoteDev.module.css @@ -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 { diff --git a/src/features/remote-dev/index.ts b/src/features/remote-dev/index.ts index c21f9e75ff..8da2ee21d8 100644 --- a/src/features/remote-dev/index.ts +++ b/src/features/remote-dev/index.ts @@ -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(), }, diff --git a/src/features/welcome/ProjectPopup.tsx b/src/features/welcome/ProjectPopup.tsx index 3ca22dfdd6..710b2a80f6 100644 --- a/src/features/welcome/ProjectPopup.tsx +++ b/src/features/welcome/ProjectPopup.tsx @@ -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[] { diff --git a/src/features/welcome/ProjectsPage.tsx b/src/features/welcome/ProjectsPage.tsx index 2cd209a082..3c9a0dcc0a 100644 --- a/src/features/welcome/ProjectsPage.tsx +++ b/src/features/welcome/ProjectsPage.tsx @@ -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 (