Visual Studio Code, rebuilt in Rust
Rust
feat(port): redraw the app icon as a gradient slash on black (#39)
Artur Rok1c86c5355065
diff --git a/native/crates/app/src/workbench/letterpress.svg b/native/crates/app/src/workbench/letterpress.svgindex 273e72dc32a..eece321213c 100644--- a/native/crates/app/src/workbench/letterpress.svg+++ b/native/crates/app/src/workbench/letterpress.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="232 232 560 560" width="560" height="560"><g fill="#000"><rect x="292" y="352" width="240" height="64" rx="32"/><rect x="232" y="480" width="280" height="64" rx="32"/><rect x="332" y="608" width="140" height="64" rx="32"/><path d="M672 232 L792 232 L712 792 L592 792 Z"/></g></svg>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="174 198 628 628" width="628" height="628"><g fill="#000" stroke="#000" stroke-linejoin="round"><g stroke-width="12"><path d="M316 338H578L564 430H316A46 46 0 0 1 316 338Z"/><path d="M226 466H559L545 558H226A46 46 0 0 1 226 466Z"/><path d="M396 594H540L526 686H396A46 46 0 0 1 396 594Z"/></g><path stroke-width="36" d="M680 240H784L704 784H600Z"/></g></svg>diff --git a/native/crates/config/port-settings.json b/native/crates/config/port-settings.jsonindex 8f100ad2b2a..383f84b216f 100644--- a/native/crates/config/port-settings.json+++ b/native/crates/config/port-settings.json@@ -2,7 +2,7 @@"window.appIcon": {"type": "string","enum": ["default", "inverted"],- "enumDescriptions": ["The VSRustium icon: an orange glyph on a light or dark background.", "The VSRustium icon inverted: a light or dark glyph on an orange background."],+ "enumDescriptions": ["The VSRustium icon: a gradient glyph on a black background.", "The VSRustium icon inverted: a light or dark glyph on an orange background."],"default": "default","scope": 1,"description": "VSRustium: the look of the Dock icon. It follows the system's light or dark appearance; Finder and Launchpad keep the default icon.",diff --git a/port/AppIcon.icon/Assets/back.svg b/port/AppIcon.icon/Assets/back.svgindex ebda2575875..10a20b8bea8 100644--- a/port/AppIcon.icon/Assets/back.svg+++ b/port/AppIcon.icon/Assets/back.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><g fill="#fff"><rect x="292" y="352" width="240" height="64" rx="32"/><rect x="232" y="480" width="280" height="64" rx="32"/><rect x="332" y="608" width="140" height="64" rx="32"/></g></svg>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="180" y1="512" x2="580" y2="512"><stop offset="0" stop-color="#6a4cff"/><stop offset="1" stop-color="#ffb37a"/></linearGradient></defs><g fill="url(#g)" stroke="url(#g)" stroke-width="12" stroke-linejoin="round"><path d="M316 338H578L564 430H316A46 46 0 0 1 316 338Z"/><path d="M226 466H559L545 558H226A46 46 0 0 1 226 466Z"/><path d="M396 594H540L526 686H396A46 46 0 0 1 396 594Z"/></g></svg>diff --git a/port/AppIcon.icon/Assets/front.svg b/port/AppIcon.icon/Assets/front.svgindex 00bf5d175ea..8e10a1e1fed 100644--- a/port/AppIcon.icon/Assets/front.svg+++ b/port/AppIcon.icon/Assets/front.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><path fill="#fff" d="M672 232 L792 232 L712 792 L592 792 Z"/></svg>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="700" y1="222" x2="640" y2="802"><stop offset="0" stop-color="#ffe08a"/><stop offset="0.5" stop-color="#ff7a2a"/><stop offset="1" stop-color="#ff4f8b"/></linearGradient></defs><path fill="url(#g)" stroke="url(#g)" stroke-width="36" stroke-linejoin="round" d="M680 240H784L704 784H600Z"/></svg>diff --git a/port/AppIcon.icon/icon.json b/port/AppIcon.icon/icon.jsonindex 5081f22dcbb..62b1a6b6862 100644--- a/port/AppIcon.icon/icon.json+++ b/port/AppIcon.icon/icon.json@@ -1,38 +1,19 @@{- "fill-specializations": [- {- "value": "system-light"- },- {- "appearance": "dark",- "value": "system-dark"- }- ],+ "fill": {+ "solid": "srgb:0.07000,0.07000,0.08000,1.00000"+ },"groups": [{"layers": [{- "fill": {- "linear-gradient": [- "display-p3:1.00000,0.56000,0.22000,1.00000",- "display-p3:0.88000,0.30000,0.07000,1.00000"- ]- },"glass": true,"image-name": "front.svg","name": "front"},{- "fill": {- "linear-gradient": [- "display-p3:1.00000,0.56000,0.22000,1.00000",- "display-p3:0.88000,0.30000,0.07000,1.00000"- ]- },"glass": true,"image-name": "back.svg",- "name": "back",- "opacity": 0.5+ "name": "back"}],"position": {diff --git a/port/AppIcon.png b/port/AppIcon.pngindex 35bfed09b99..8e1de525c76 100644Binary files a/port/AppIcon.png and b/port/AppIcon.png differdiff --git a/port/AppIconInverted.icon/Assets/back.svg b/port/AppIconInverted.icon/Assets/back.svgindex ebda2575875..82f23685079 100644--- a/port/AppIconInverted.icon/Assets/back.svg+++ b/port/AppIconInverted.icon/Assets/back.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><g fill="#fff"><rect x="292" y="352" width="240" height="64" rx="32"/><rect x="232" y="480" width="280" height="64" rx="32"/><rect x="332" y="608" width="140" height="64" rx="32"/></g></svg>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><g fill="#fff" stroke="#fff" stroke-width="12" stroke-linejoin="round"><path d="M316 338H578L564 430H316A46 46 0 0 1 316 338Z"/><path d="M226 466H559L545 558H226A46 46 0 0 1 226 466Z"/><path d="M396 594H540L526 686H396A46 46 0 0 1 396 594Z"/></g></svg>diff --git a/port/AppIconInverted.icon/Assets/front.svg b/port/AppIconInverted.icon/Assets/front.svgindex 00bf5d175ea..f3656058e7e 100644--- a/port/AppIconInverted.icon/Assets/front.svg+++ b/port/AppIconInverted.icon/Assets/front.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><path fill="#fff" d="M672 232 L792 232 L712 792 L592 792 Z"/></svg>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024"><path fill="#fff" stroke="#fff" stroke-width="36" stroke-linejoin="round" d="M680 240H784L704 784H600Z"/></svg>diff --git a/port/assets/icon.png b/port/assets/icon.pngindex c74a57b9ed6..212a055bfdf 100644Binary files a/port/assets/icon.png and b/port/assets/icon.png differdiff --git a/port/notes.md b/port/notes.mdindex 6ea2a8967fb..9115ed36f20 100644--- a/port/notes.md+++ b/port/notes.md@@ -817,8 +817,8 @@ Scope as in the M19 Work row of port/ledger.md.- Update service (`update.rs`, `update/install.rs`, updateService.darwin.ts with Squirrel.Mac's part): one per app, created with the first window; `update.mode` as upstream (`none` disables and drops a pending download, `manual`, `start` 30 s after startup, `default` also hourly). A check first refuses a bundle it cannot replace (App Translocation, a read-only volume, no write access) with Squirrel's message, then reads the feed; a newer build downloads at once with curl into `~/Library/Caches/com.rokartur.vsrustium.ShipIt/update` (progress from the file size and Content-Length), then is verified: the zip's SHA-256 against the feed, `ditto -x -k`, exactly one `.app`, `codesign --verify --deep --strict` against the installed app's designated requirement (Squirrel's check: an Apple-issued certificate, the Team ID and the bundle id) and the same `Identifier` and `TeamIdentifier`; an ad-hoc signed installed app verifies nothing. States: Uninitialized, Disabled, Idle, CheckingForUpdates, AvailableForDownload, Downloading, Downloaded, Ready, Restarting; an error goes back to Idle, with its message only for an explicit check (upstream). On a metered connection (`network.meteredConnection` or the OS's) an automatic check is skipped, and an update an automatic check found waits as AvailableForDownload; both resume once the connection is not metered (abstractUpdateService.ts). Not reached: Updating (Windows), Overwriting, Cancelling.ShipIt (`vsrustium --apply-update <pid> <staged> <installed> [--relaunch <args>]`, logging to `ShipIt_stderr.log` in the ShipIt folder): Restart to Update quits every window (a veto puts Ready back) and the helper starts on app quit; a plain Quit while Ready installs too, without relaunch (Squirrel installs a downloaded update on quit). The helper waits for the app's pid to exit, verifies the staged bundle again, renames the installed app to `.VSRustium.app.old`, moves the update in (a ditto copy across volumes) or on any failure puts the old one back, relaunches the executable with the app's arguments, then deletes the old copy.Workbench (`workbench/update.rs`, update.ts): the Manage menu's `7_update` items by `updateState` (Check for Updates..., Checking for Updates..., Download Update (1), Downloading Update..., Install Update... (1), Restart to Update (1)), the palette's Check for Updates... and Restart to Update, the Manage item's badge (1 with "New VSRustium update available.", a progress badge while checking or downloading, the description in its hover title, the profile badge hidden meanwhile), "There are currently no updates available." in the focused window after an explicit check. The title bar's update entry and its sticky tooltip (`workbench/update_title_bar.rs`, updateTitleBarEntry.ts and updateTooltip.ts, `update.titleBar`) sit before the right-side items of the main window's custom title bar; an explicit check's error shows in the tooltip, not as a notification. After an update to a new major or minor version (`releaseNotes/lastVersion` in application storage, `update.showReleaseNotes`), the release notes editor (`workbench/release_notes.rs`) shows the body of the GitHub release `v<version>` under `releaseNotesUrl` (the API's `/tags/v<version>`); when it cannot be fetched, the prompt "Welcome to VSRustium v{0}! Would you like to read the Release Notes?" opens `releaseNotesUrl`. Tests: `cargo test -p app update::`; end to end `port/tools/update-check` (port/tools/update-feed serves the packages laid out like GitHub releases; `?cut` cuts a download midway).-- Packaging (`port/tools/package-app`, `port/tools/app-smoke`): VSRustium.app with the release binary and bun in Contents/MacOS, the app files in Contents/Resources/app (the binary takes them as its root when it runs from a bundle; bun next to the executable wins over PATH), pnpm entries copied with their links (a built-in's dependency only when its shipped code requires, `require.resolve`s or imports it: upstream bundles every built-in and ships none, the port runs the unbundled `out`; mermaid-markdown-features' mermaid stack only feeds its prebuilt webviews; ripgrep-universal keeps the target's `bin/darwin-<arch>` only, as build/lib/copilot.ts; the app went from 817 MB to 366 MB, the update zip from 268 MB to 128 MB, VS Code 1.148.0 arm64 is 1.0 GB unpacked), Info.plist with the reference's 65 document types and the `vsrustium` URL scheme, every Mach-O signed with the hardened runtime (bun with allow-jit, allow-unsigned-executable-memory, disable-library-validation). The Studio has Gatekeeper assessments disabled, so `spctl -a` accepts any bundle there; package-app refuses to report it as a pass. The app icon is `port/AppIcon.icon` (Icon Composer: light and dark backgrounds, tinted and clear looks from macOS), compiled by actool into Assets.car and AppIcon.icns. Intel Macs (ARCH=x64, built on the arm64 Studio): the `x86_64-apple-darwin` release binary, bun's `bun-darwin-x64-baseline` release of the host's bun version (pinned with its sha256 in package-app; the baseline build runs without AVX2, on Intel Macs before Haswell that macOS 12 supports and under Rosetta before macOS 15), ripgrep's `darwin-x64`, and the native modules the shipped packages load (kerberos, @vscode/spdlog, @vscode/fs-copyfile, all N-API) rebuilt with `node-gyp rebuild --arch=x64` (node-gyp from port/tools/node-gyp's lockfile, installed with `npm ci`) from a scratch copy of their source package. package-app refuses a bundle with a Mach-O of another arch (`lipo -archs` of every file `file` names Mach-O), and as build/.moduleignore drops node-gyp's `build/Release/obj.target` and `.deps` (their object files are Mach-O of the host's arch). Universal builds are not made.-- Branding, intended port differences (Artur): (1) Name: every name the user sees is port/product.json's `nameLong`/`nameShort` (VSRustium), read by `product.rs` (app; before `product::load` the overlay alone answers) and `exthost::product_name` (init data `appName`, gallery and install messages). Where upstream hardcodes "VS Code", "Code" or the dev build's "Code - OSS" (install and engine messages, the external website and protocol url prompts, the system-wide keybinding warning, the Editor Playground text, the update commands' `nameShort` category in the reference dump, the built-in walkthroughs' titles, steps and alt texts through `walkthroughs::branded`, the trusted domains and extensions.json templates) the port says VSRustium; links and texts naming Microsoft's docs keep "VS Code", and so does Settings Import, where it names the other app. An unbundled run (`cargo run`) embeds an Info.plist with CFBundleName in `__TEXT,__info_plist` (build.rs), so the app menu names VSRustium there too (the Dock's label keeps the executable name, `vsrustium`). `--version` prints upstream's version, commit and arch lines, without a name, as upstream's does. Kept: the Keychain service `Code - OSS Secret Storage` (renaming it loses stored extension secrets) and the gallery's `User-Agent`/`X-Market-Client-Id` (Open VSX compatibility); setting descriptions and built-in extension texts stay upstream's. (2) Icon: `port/AppIcon.icon`; the bundle gets actool's Assets.car and AppIcon.icns. build.rs renders it and `port/AppIconInverted.icon` (orange background, glyph light in light mode and dark in dark mode) with Icon Composer's ictool, light and dark, into the binary. The port setting `window.appIcon` (`default` | `inverted`, config/port-settings.json) picks the Dock icon (`app_icon.rs`, `NSApplication.applicationIconImage`), the light or dark rendering after the system appearance, live; `default` in VSRustium.app restores the bundle's icon, and an unbundled run shows the rendered default. Finder and Launchpad keep the bundle icon. On macOS 27 the About sheet (NSAlert) shows no icon, as Code - OSS's does not (ui-pair, host lane). (3) Letterpress: the empty editor group draws `workbench/letterpress.svg` (the icon's bars and slash in one fill, cropped to the logo) in place of upstream's letterpress-*.svg, at the same size (256 px, 200 px in a part of several groups) and position, black at 0.3 (dark) and 0.1 (light), #3C3C3C (hc dark) and #D9D9D9 (hc light) as upstream's files paint it. Tests: `cargo test -p app product`, `menubar`, `command_palette`; `cargo test -p exthost session extension_validator extension_management`.+- Packaging (`port/tools/package-app`, `port/tools/app-smoke`): VSRustium.app with the release binary and bun in Contents/MacOS, the app files in Contents/Resources/app (the binary takes them as its root when it runs from a bundle; bun next to the executable wins over PATH), pnpm entries copied with their links (a built-in's dependency only when its shipped code requires, `require.resolve`s or imports it: upstream bundles every built-in and ships none, the port runs the unbundled `out`; mermaid-markdown-features' mermaid stack only feeds its prebuilt webviews; ripgrep-universal keeps the target's `bin/darwin-<arch>` only, as build/lib/copilot.ts; the app went from 817 MB to 366 MB, the update zip from 268 MB to 128 MB, VS Code 1.148.0 arm64 is 1.0 GB unpacked), Info.plist with the reference's 65 document types and the `vsrustium` URL scheme, every Mach-O signed with the hardened runtime (bun with allow-jit, allow-unsigned-executable-memory, disable-library-validation). The Studio has Gatekeeper assessments disabled, so `spctl -a` accepts any bundle there; package-app refuses to report it as a pass. The app icon is `port/AppIcon.icon` (Icon Composer: one black background, tinted and clear looks from macOS), compiled by actool into Assets.car and AppIcon.icns. Intel Macs (ARCH=x64, built on the arm64 Studio): the `x86_64-apple-darwin` release binary, bun's `bun-darwin-x64-baseline` release of the host's bun version (pinned with its sha256 in package-app; the baseline build runs without AVX2, on Intel Macs before Haswell that macOS 12 supports and under Rosetta before macOS 15), ripgrep's `darwin-x64`, and the native modules the shipped packages load (kerberos, @vscode/spdlog, @vscode/fs-copyfile, all N-API) rebuilt with `node-gyp rebuild --arch=x64` (node-gyp from port/tools/node-gyp's lockfile, installed with `npm ci`) from a scratch copy of their source package. package-app refuses a bundle with a Mach-O of another arch (`lipo -archs` of every file `file` names Mach-O), and as build/.moduleignore drops node-gyp's `build/Release/obj.target` and `.deps` (their object files are Mach-O of the host's arch). Universal builds are not made.+- Branding, intended port differences (Artur): (1) Name: every name the user sees is port/product.json's `nameLong`/`nameShort` (VSRustium), read by `product.rs` (app; before `product::load` the overlay alone answers) and `exthost::product_name` (init data `appName`, gallery and install messages). Where upstream hardcodes "VS Code", "Code" or the dev build's "Code - OSS" (install and engine messages, the external website and protocol url prompts, the system-wide keybinding warning, the Editor Playground text, the update commands' `nameShort` category in the reference dump, the built-in walkthroughs' titles, steps and alt texts through `walkthroughs::branded`, the trusted domains and extensions.json templates) the port says VSRustium; links and texts naming Microsoft's docs keep "VS Code", and so does Settings Import, where it names the other app. An unbundled run (`cargo run`) embeds an Info.plist with CFBundleName in `__TEXT,__info_plist` (build.rs), so the app menu names VSRustium there too (the Dock's label keeps the executable name, `vsrustium`). `--version` prints upstream's version, commit and arch lines, without a name, as upstream's does. Kept: the Keychain service `Code - OSS Secret Storage` (renaming it loses stored extension secrets) and the gallery's `User-Agent`/`X-Market-Client-Id` (Open VSX compatibility); setting descriptions and built-in extension texts stay upstream's. (2) Icon: `port/AppIcon.icon`, a slash with three code lines trailing it, their right ends cut parallel to the slash; the slash is an amber, orange and pink gradient, the lines violet to peach, on a black background in light and dark mode (it replaced an orange slash and three bars on a light or dark background); the bundle gets actool's Assets.car and AppIcon.icns. build.rs renders it and `port/AppIconInverted.icon` (the same shapes on the orange background, glyph light in light mode and dark in dark mode) with Icon Composer's ictool, light and dark, into the binary. The port setting `window.appIcon` (`default` | `inverted`, config/port-settings.json) picks the Dock icon (`app_icon.rs`, `NSApplication.applicationIconImage`), the light or dark rendering after the system appearance, live; `default` in VSRustium.app restores the bundle's icon, and an unbundled run shows the rendered default. Finder and Launchpad keep the bundle icon. On macOS 27 the About sheet (NSAlert) shows no icon, as Code - OSS's does not (ui-pair, host lane). (3) Letterpress: the empty editor group draws `workbench/letterpress.svg` (the icon's bars and slash in one fill, cropped to the logo) in place of upstream's letterpress-*.svg, at the same size (256 px, 200 px in a part of several groups) and position, black at 0.3 (dark) and 0.1 (light), #3C3C3C (hc dark) and #D9D9D9 (hc light) as upstream's files paint it. Tests: `cargo test -p app product`, `menubar`, `command_palette`; `cargo test -p exthost session extension_validator extension_management`.- File > New File... (`workbench/new_file.rs`, newFile.contribution.ts): `MenuId.NewFile` with the built-in Text File and `contributes.menus["file/newFile"]` (ipynb's New Jupyter Notebook), one entry runs directly, more show the picker by group with the source as description, a gear button to the Keyboard Shortcuts editor, and Create New File (name) for typed text.- Welcome page (`walkthroughs.rs` model, `workbench/welcome_page.rs` view; gettingStarted.ts, startupPage.ts, gettingStartedService.ts): the categories slide (Start, Recent, Walkthroughs with ranking, hidden categories, progress, the "Show welcome page on startup" checkbox), the details slide (steps, completion checkboxes, linked-text buttons and links, Mark Done, Next Section), media (svg, markdown with `setTheme:` and video in a webview, images per theme kind), step progress in `memento/gettingStartedService` with the completion events, and the startup page (`workbench.startupEditor`, the old `workbench.welcome.enabled`, `--skip-welcome`). Left out: the four Copilot setup steps, settings sync, SetupWeb, the remote and tunnel start entries (AI, sync, web, remote by decision). shortcut: `onView:` sees only the side bar's container, `onContext:` reads the `setContext` keys (each noted in the code). Every port GUI tool starts the port with `workbench.startupEditor: none` (as ref-user-data.ts does for the reference) and api-tests with `--skip-welcome` (as scripts/test-integration.sh).- View welcome content (`workbench/views_welcome.rs`, viewsWelcomeContribution.ts and viewPane.ts `ViewWelcomeController`): the Explorer's empty view and the Source Control view draw the workbench's registrations and every extension's `contributes.viewsWelcome` (git's 17 `scm` and 2 `explorer` entries) with `when`, `enablement`, `group@order` (with the contribViewsWelcome proposal) and the `default` entry, sorted as `compareViewContentDescriptors`. The key context gained `remoteName` (empty), `workspaceFolderCount`, `isWorkspaceTrustEnabled` and `isWorkspaceTrusted`. shortcut: the `wide` layout (pane over 640 px) is not drawn. `workbench.action.addRootFolder` is not ported (milestone 12), so "add a folder" runs a missing command.