Skip to content

Commit 93cb720

Browse files
feat(desktop): add channel-specific macOS DMG artwork
- Use Latest and Nightly DMG backgrounds with Retina rasterization - Resolve canonical production and development desktop icons - Update DMG sizing and add focused packaging coverage
1 parent 4002b72 commit 93cb720

16 files changed

Lines changed: 359 additions & 106 deletions
Lines changed: 34 additions & 0 deletions
Loading
Lines changed: 65 additions & 0 deletions
Loading
-183 KB
Binary file not shown.

‎apps/desktop/resources/dmg/dmg-background-signal.svg‎

Lines changed: 0 additions & 77 deletions
This file was deleted.
-655 KB
Binary file not shown.

‎apps/desktop/resources/icon.icns‎

-1.89 MB
Binary file not shown.

‎apps/desktop/resources/icon.ico‎

-279 KB
Binary file not shown.

‎apps/desktop/resources/icon.png‎

-313 KB
Binary file not shown.

‎apps/desktop/scripts/electron-launcher.mjs‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export const APP_BUNDLE_ID = isDevelopment
2020
? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}`
2121
: "com.t3tools.t3code";
2222
const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"];
23-
const LAUNCHER_VERSION = 14;
24-
const defaultIconPath = NodePath.join(desktopDir, "resources", "icon.icns");
23+
const LAUNCHER_VERSION = 15;
2524
const developmentMacIconPngPath = NodePath.join(
2625
repoRoot,
2726
"assets",
2827
"dev",
2928
"blueprint-macos-1024.png",
3029
);
30+
const productionMacIconPngPath = NodePath.join(repoRoot, "assets", "prod", "black-macos-1024.png");
3131
// oxlint-disable-next-line t3code/no-global-process-runtime -- Standalone launcher script has no Effect runtime.
3232
const hostPlatform = NodeOS.platform();
3333

@@ -165,15 +165,22 @@ function registerMacLauncherBundle(appBundlePath) {
165165
}
166166
}
167167

168-
function ensureDevelopmentIconIcns(runtimeDir) {
169-
const generatedIconPath = NodePath.join(runtimeDir, "icon-dev.icns");
168+
export function resolveMacLauncherIconPaths(runtimeDir, development = isDevelopment) {
169+
return {
170+
sourceIconPath: development ? developmentMacIconPngPath : productionMacIconPngPath,
171+
generatedIconPath: NodePath.join(runtimeDir, development ? "icon-dev.icns" : "icon-prod.icns"),
172+
};
173+
}
174+
175+
function ensureMacIconIcns(runtimeDir) {
176+
const { sourceIconPath, generatedIconPath } = resolveMacLauncherIconPaths(runtimeDir);
170177
NodeFS.mkdirSync(runtimeDir, { recursive: true });
171178

172-
if (!NodeFS.existsSync(developmentMacIconPngPath)) {
173-
return defaultIconPath;
179+
if (!NodeFS.existsSync(sourceIconPath)) {
180+
throw new Error(`Desktop macOS icon source is missing at ${sourceIconPath}`);
174181
}
175182

176-
const sourceMtimeMs = NodeFS.statSync(developmentMacIconPngPath).mtimeMs;
183+
const sourceMtimeMs = NodeFS.statSync(sourceIconPath).mtimeMs;
177184
if (
178185
NodeFS.existsSync(generatedIconPath) &&
179186
NodeFS.statSync(generatedIconPath).mtimeMs >= sourceMtimeMs
@@ -191,7 +198,7 @@ function ensureDevelopmentIconIcns(runtimeDir) {
191198
"-z",
192199
String(size),
193200
String(size),
194-
developmentMacIconPngPath,
201+
sourceIconPath,
195202
"--out",
196203
NodePath.join(iconsetDir, `icon_${size}x${size}.png`),
197204
]);
@@ -201,20 +208,14 @@ function ensureDevelopmentIconIcns(runtimeDir) {
201208
"-z",
202209
String(retinaSize),
203210
String(retinaSize),
204-
developmentMacIconPngPath,
211+
sourceIconPath,
205212
"--out",
206213
NodePath.join(iconsetDir, `icon_${size}x${size}@2x.png`),
207214
]);
208215
}
209216

210217
runChecked("iconutil", ["-c", "icns", iconsetDir, "-o", generatedIconPath]);
211218
return generatedIconPath;
212-
} catch (error) {
213-
console.warn(
214-
"[desktop-launcher] Failed to generate dev macOS icon, falling back to default icon.",
215-
error,
216-
);
217-
return defaultIconPath;
218219
} finally {
219220
NodeFS.rmSync(iconsetRoot, { recursive: true, force: true });
220221
}
@@ -297,7 +298,7 @@ function buildMacLauncher(electronBinaryPath) {
297298
const launcherBinaryPath = isDevelopment
298299
? developmentPaths.launcherBinaryPath
299300
: runtimeElectronBinaryPath;
300-
const iconPath = isDevelopment ? ensureDevelopmentIconIcns(runtimeDir) : defaultIconPath;
301+
const iconPath = ensureMacIconIcns(runtimeDir);
301302
const metadataPath = NodePath.join(runtimeDir, "metadata.json");
302303

303304
NodeFS.mkdirSync(runtimeDir, { recursive: true });

‎apps/desktop/scripts/electron-launcher.test.mjs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { assert, describe, it } from "vite-plus/test";
33
import {
44
makeDevelopmentLauncherScript,
55
resolveElectronBinaryPath,
6+
resolveMacLauncherIconPaths,
67
resolveMacLauncherPaths,
78
} from "./electron-launcher.mjs";
89

@@ -78,4 +79,14 @@ describe("electron development launcher", () => {
7879
);
7980
assert.notInclude(script, "node_modules/electron");
8081
});
82+
83+
it("derives launcher icons from canonical development and production assets", () => {
84+
const development = resolveMacLauncherIconPaths("/runtime", true);
85+
const production = resolveMacLauncherIconPaths("/runtime", false);
86+
87+
assert.match(development.sourceIconPath, /assets\/dev\/blueprint-macos-1024\.png$/);
88+
assert.equal(development.generatedIconPath, "/runtime/icon-dev.icns");
89+
assert.match(production.sourceIconPath, /assets\/prod\/black-macos-1024\.png$/);
90+
assert.equal(production.generatedIconPath, "/runtime/icon-prod.icns");
91+
});
8192
});

0 commit comments

Comments
 (0)