Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(desktop): drop DMG wordmark banner, recenter icons, add Nightly badge
Elian Doranbd93531e3359
diff --git a/apps/desktop/electron-forge/dmg-background/README.md b/apps/desktop/electron-forge/dmg-background/README.mdindex 748f5da4dc..7b20f30b2d 100644--- a/apps/desktop/electron-forge/dmg-background/README.md+++ b/apps/desktop/electron-forge/dmg-background/README.md@@ -15,13 +15,13 @@ built and visually verified on macOS** (`appdmg` is `os: [darwin]` and isn't ins`contents` icon coordinates in `forge.config.ts` are a best effort matched to the artwork; fine-tunethem on a real macOS build.-`preview.png` is a faithful mock of the assembled Finder window: the real app icon (`icon.icns`) and-the real macOS Applications-folder icon composited at the same `contents` coordinates the DMG uses,-under a reconstructed Finder title bar, with the icon labels Finder draws. On macOS the two icons are-rendered from their `.icns` via `sips` (pixel-perfect); off macOS it falls back to the flat logo and a-drawn folder so the script still runs anywhere. It is **reference only** — appdmg never uses it (it only-reads `background.png`/`@2x`). Kept reproducible from source so it isn't a mystery image; regenerate with-`pnpm --filter desktop generate-dmg-preview`.+`preview.png` (stable) and `preview-dev.png` (nightly) are faithful mocks of the assembled Finder window:+the real app icon (`icon.icns` / `icon-dev.icns`) and the real macOS Applications-folder icon composited at+the same `contents` coordinates the DMG uses, under a reconstructed Finder title bar, with the captions+Finder draws. On macOS the icons are rendered from their `.icns` via `sips` (pixel-perfect); off macOS it+falls back to the flat logo and a drawn folder so the script still runs anywhere. They are **reference+only** — appdmg never uses them (it only reads `background.png`/`@2x`). Kept reproducible from source so+they aren't mystery images; regenerate with `pnpm --filter desktop generate-dmg-preview`.## How it differs from the Windows splash@@ -42,21 +42,23 @@ reads `background.png`/`@2x`). Kept reproducible from source so it isn't a myste- **Light surface, reused verbatim from the in-app setup screen** (`apps/client/src/setup.css`, lighttheme): soft indigo/purple/blue radial glows over the near-white left-pane base (`#f2f2f2`). The lightsurface keeps Finder's forced-black captions legible on their own. The same gradient is used for both- channels; **nightly** is distinguished only by the purple leaf mark and the NIGHTLY badge. The wordmark- is dark (`#2b3038`, muted `#7c828c` for "Notes"), and the drag arrow is a muted neutral grey, kept quiet- so it doesn't compete with the icons.+ channels. The drag arrow is a muted neutral grey, kept quiet so it doesn't compete with the icons.+- **No wordmark banner.** The Finder title bar (volume name + icon) and the app icon already carry the+ brand, so a baked wordmark would just triplicate it — the surface stays clean with only the icons,+ arrow, and captions Finder draws.- The icons sit directly on the surface (no tiles/plates), app on the left and `/Applications` alias on theright, with the drag arrow between them. Their **centers** must line up with the `contents` coordinatesin `forge.config.ts`, which use a **top-left** origin, y increasing downward, with `(x, y)` the iconcenter — Finder's `.DS_Store` `Iloc` convention (confirmed by appdmg's own example, where `y: 344` sitsnear the *bottom* of the window). So the `contents` y is measured from the top, not `windowHeight - y`.- `contents` uses **y = 200** (near the vertical middle), so Finder draws the captions at **~y = 278**.-- **No baked text beyond the "Trilium Notes" wordmark** (a brand name, not translated). The DMG ships one- image for every locale, so there is no localized instruction line — the arrow conveys the action, and- Finder draws the app name and "Applications" captions under the real icons.+ `contents` uses **y = 182**, centering the icon + caption pair vertically now that no banner sits above+ them; Finder draws the captions at **~y = 262**.+- **Nightly badge.** The only baked text: a `Nightly` badge on the nightly background (`background-dev.png`),+ centered under the app icon just below where Finder draws the app caption (~y = 282). Stable ships no+ baked text at all, so there is no localized instruction line — the arrow conveys the action.## Output contract- 640 × 400 pt window; `background.png` is 640 × 400, `[email protected]` is 1280 × 800.-- `iconSize` 128; app icon centered at (180, 200), Applications at (460, 200) in **top-left** coords —- keep in sync with the `contents` in the maker config.+- `iconSize` 128; app icon centered at (180, 182), Applications at (460, 182) in **top-left** coords —+ keep in sync with the `contents` in the maker config (and the nightly badge position in `background.html`).diff --git a/apps/desktop/electron-forge/dmg-background/background-dev.png b/apps/desktop/electron-forge/dmg-background/background-dev.pngindex 527217785c..9b25644507 100644Binary files a/apps/desktop/electron-forge/dmg-background/background-dev.png and b/apps/desktop/electron-forge/dmg-background/background-dev.png differdiff --git a/apps/desktop/electron-forge/dmg-background/[email protected] b/apps/desktop/electron-forge/dmg-background/[email protected]index f7a73767e0..bb4b9a0e51 100644Binary files a/apps/desktop/electron-forge/dmg-background/[email protected] and b/apps/desktop/electron-forge/dmg-background/[email protected] differdiff --git a/apps/desktop/electron-forge/dmg-background/background.html b/apps/desktop/electron-forge/dmg-background/background.htmlindex 05ac8f8f35..3770e4ab2e 100644--- a/apps/desktop/electron-forge/dmg-background/background.html+++ b/apps/desktop/electron-forge/dmg-background/background.html@@ -5,23 +5,22 @@<title>Trilium DMG background</title><style>html, body { margin: 0; padding: 0; }- /* 640 x 400 pt window. Real app icon + /Applications alias are placed on top by- Finder (via `contents` coords in forge.config), centered on the two platforms;- Finder also draws their text labels, so none are baked in here. Brand language- reused from the installer splash: the same dark surface, plus a soft glow and a- drag arrow tinted from the trillium's leaves. ?variant=nightly swaps to purple. */- /* Light surface reused VERBATIM from the in-app setup screen (apps/client/src/setup.css,- light theme): soft indigo/purple/blue glows over the near-white left-pane base (#f2f2f2).- A light background keeps Finder's icon captions — which it forces to black for any DMG- with a background picture — legible without a baked label plate. Same gradient for both- channels; nightly is distinguished only by the purple leaf mark and the NIGHTLY badge. */+ /* 640 x 400 pt window. Finder places the real app icon + /Applications alias on top (via+ the `contents` coords in forge.config) and draws their text captions, so no icons or+ captions are baked here — only the surface, a drag arrow, and (nightly only) a badge under+ the app caption. No wordmark banner: the Finder title bar and the app icon already carry+ the brand, so a baked wordmark would just triplicate it. */.bg {position: relative;width: 640px;height: 400px;overflow: hidden;font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;- color: #2b3038;+ /* Light surface reused VERBATIM from the in-app setup screen (apps/client/src/setup.css,+ light theme): soft indigo/purple/blue glows over the near-white left-pane base (#f2f2f2).+ A light background keeps Finder's icon captions — which it forces to black for any DMG+ with a background picture — legible without a baked label plate. Same gradient for both+ channels; nightly is distinguished by the purple app icon and the Nightly badge below. */background:radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),@@ -29,59 +28,30 @@#f2f2f2;}- .brand {- position: absolute;- top: 40px; left: 0; right: 0;- display: flex; align-items: center; justify-content: center; gap: 13px;- }- .brand svg { width: 44px; height: 44px; display: block; }- .brand .word { font-size: 25px; font-weight: 600; letter-spacing: 0.01em; }- .brand .word .notes { font-weight: 350; color: #7c828c; }- .brand .badge {- display: none;- font-size: 11px; font-weight: 700; letter-spacing: 0.14em;- color: #ffffff; background: #8146b8; border-radius: 3px; padding: 2px 7px 3px;- transform: translateY(-2px);- }- .variant-nightly .badge { display: inline-block; }-/* Muted neutral arrow — a functional cue, kept quiet so the icons carry the colour.- Channel-agnostic. Vertically centered on the icon centers (y = 200). */- .arrow { position: absolute; top: 177px; left: 274px; width: 92px; height: 46px; }+ Channel-agnostic. Vertically centered on the icon centers (y = 182). */+ .arrow { position: absolute; top: 159px; left: 274px; width: 92px; height: 46px; }- /* No instructional text: the DMG ships one baked image for every locale, and the- arrow plus Finder's own icon labels already convey "drag to Applications". */-- /* Leaf fills — stable are the exact nine from icon-color.svg; nightly are purple ramps. */- .variant-stable .g1 { fill: #95c980; } .variant-stable .g2 { fill: #72b755; } .variant-stable .g3 { fill: #4fa52b; }- .variant-stable .r1 { fill: #ee8c89; } .variant-stable .r2 { fill: #e96562; } .variant-stable .r3 { fill: #e33f3b; }- .variant-stable .o1 { fill: #efb075; } .variant-stable .o2 { fill: #e99547; } .variant-stable .o3 { fill: #e47b19; }- .variant-nightly .g1 { fill: #b18ad6; } .variant-nightly .g2 { fill: #9159c4; } .variant-nightly .g3 { fill: #6e2ea8; }- .variant-nightly .r1 { fill: #cdb2e4; } .variant-nightly .r2 { fill: #b08fd6; } .variant-nightly .r3 { fill: #9668c2; }- .variant-nightly .o1 { fill: #c09fe0; } .variant-nightly .o2 { fill: #a276cf; } .variant-nightly .o3 { fill: #8146b8; }+ /* Nightly badge, baked under the app caption on the nightly channel only. The app icon is+ centered at x = 180, y = 182, so Finder draws its caption at ~y = 262 and the badge sits+ just below at ~y = 282. Fine-tune the top on a macOS build, like the icon `contents`. */+ .beta-badge {+ display: none;+ position: absolute;+ left: 180px; top: 276px; transform: translateX(-50%);+ font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;+ color: #ffffff; background: #8146b8; border-radius: 4px; padding: 2px 9px 3px;+ }+ .variant-nightly .beta-badge { display: block; }</style></head><body><div class="bg" id="bg">- <div class="brand">- <svg viewBox="0 0 256 256" aria-hidden="true">- <path class="g1" d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z"/>- <path class="g2" d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z"/>- <path class="g3" d="m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z"/>- <path class="o1" d="m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z"/>- <path class="o2" d="m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z"/>- <path class="o3" d="m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z"/>- <path class="r1" d="m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z"/>- <path class="r2" d="m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z"/>- <path class="r3" d="m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z"/>- </svg>- <span class="word">Trilium <span class="notes">Notes</span><span class="badge">NIGHTLY</span></span>- </div>-<svg class="arrow" viewBox="0 0 92 46" aria-hidden="true"><path d="M6 23 H74 M56 7 L80 23 L56 39" fill="none" stroke="#767d88"stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/></svg>+ <div class="beta-badge">Nightly</div></div><script>const params = new URLSearchParams(location.search);diff --git a/apps/desktop/electron-forge/dmg-background/background.png b/apps/desktop/electron-forge/dmg-background/background.pngindex d33d269156..8155e2b838 100644Binary files a/apps/desktop/electron-forge/dmg-background/background.png and b/apps/desktop/electron-forge/dmg-background/background.png differdiff --git a/apps/desktop/electron-forge/dmg-background/[email protected] b/apps/desktop/electron-forge/dmg-background/[email protected]index b845ea84c8..822779b9b3 100644Binary files a/apps/desktop/electron-forge/dmg-background/[email protected] and b/apps/desktop/electron-forge/dmg-background/[email protected] differdiff --git a/apps/desktop/electron-forge/dmg-background/preview-dev.png b/apps/desktop/electron-forge/dmg-background/preview-dev.pngnew file mode 100644index 0000000000..ba1c3a7afbBinary files /dev/null and b/apps/desktop/electron-forge/dmg-background/preview-dev.png differdiff --git a/apps/desktop/electron-forge/dmg-background/preview.mjs b/apps/desktop/electron-forge/dmg-background/preview.mjsindex b43ff00c5b..c1b8884824 100644--- a/apps/desktop/electron-forge/dmg-background/preview.mjs+++ b/apps/desktop/electron-forge/dmg-background/preview.mjs@@ -1,17 +1,16 @@/**- * Renders preview.png — a faithful mock of the assembled DMG Finder window, so the- * "what the DMG looks like" reference is reproducible from source rather than a mystery- * committed image. Regenerate with: pnpm --filter desktop generate-dmg-preview+ * Renders the DMG preview(s) — faithful mocks of the assembled Finder window, one per channel+ * (preview.png for stable, preview-dev.png for nightly), so the "what the DMG looks like"+ * reference is reproducible from source. Regenerate with: pnpm --filter desktop generate-dmg-preview*- * This is documentation only: appdmg never sees it (it uses background.png/@2x).+ * Documentation only: appdmg never sees these (it uses background.png/@2x).*- * PIXEL FIDELITY. The icon positions here mirror the REAL DMG exactly, read back from a- * built disk image's `.DS_Store`:- * - Finder `Iloc` records use a TOP-LEFT origin, y increasing downward, and (x, y) is- * the icon CENTER. (Confirmed by appdmg's own example: y=344 sits near the *bottom*.)- * - So the `contents` coordinates in forge.config.ts are top-left, NOT bottom-left.- * The window chrome (title bar, traffic lights, title) is drawn by Finder/macOS, not by- * appdmg — it is reconstructed here only so the reference reads as a real window.+ * PIXEL FIDELITY. The icon positions mirror the REAL DMG, read back from a built disk image's+ * `.DS_Store`: Finder `Iloc` records use a TOP-LEFT origin, y down, and (x, y) is the icon CENTER+ * (confirmed by appdmg's own example: y=344 sits near the *bottom*). So the `contents` coordinates+ * in forge.config.ts are top-left, not bottom-left. The window chrome (title bar, traffic lights,+ * title, volume-icon mark) is drawn by Finder/macOS, not appdmg — reconstructed here only so the+ * reference reads as a real window.*/import { execFileSync } from "child_process";import { existsSync, mkdtempSync, rmSync, writeFileSync } from "fs";@@ -30,27 +29,32 @@ const HEIGHT = 400;const ICON = 128; // forge.config `iconSize`const TITLEBAR = 28; // Finder-drawn chrome (illustrative)const MARGIN = 44; // transparent padding around the window for its drop shadow+const ICON_Y = 182; // icon centers; keep in sync with `contents` in forge.config.ts-// Icon CENTERS in Finder's top-left content coordinates. Same values as the `contents`-// entries in forge.config.ts — these are what a real build writes into .DS_Store.-const APP = { x: 180, y: 200, label: "Trilium Notes" };-const APPS = { x: 460, y: 200, label: "Applications" };--const bgHref = pathToFileURL(path.join(DMG_DIR, "background.png")).href;+const APP = { x: 180, label: "Trilium Notes" };+const APPS = { x: 460, label: "Applications" };const APPLICATIONS_ICNS = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ApplicationsFolderIcon.icns";-// The trillium leaf mark (stable palette), reused from background.html for the title bar.-const TRILLIUM_MARK = `<svg viewBox="0 0 256 256" aria-hidden="true">- <path fill="#95c980" d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z"/>- <path fill="#72b755" d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z"/>- <path fill="#4fa52b" d="m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z"/>- <path fill="#efb075" d="m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z"/>- <path fill="#e99547" d="m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z"/>- <path fill="#e47b19" d="m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z"/>- <path fill="#ee8c89" d="m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z"/>- <path fill="#e96562" d="m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z"/>- <path fill="#e33f3b" d="m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z"/>-</svg>`;+// Leaf `d` paths for the title-bar volume-icon mark (order: g1 g2 g3 o1 o2 o3 r1 r2 r3), plus the+// stable and nightly fills — reused from background.html's mark.+const LEAF_PATHS = [+ "m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z",+ "m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z",+ "m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z",+ "m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z",+ "m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z",+ "m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z",+ "m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z",+ "m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z",+ "m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z"+];+const STABLE_LEAVES = ["#95c980", "#72b755", "#4fa52b", "#efb075", "#e99547", "#e47b19", "#ee8c89", "#e96562", "#e33f3b"];+const NIGHTLY_LEAVES = ["#b18ad6", "#9159c4", "#6e2ea8", "#c09fe0", "#a276cf", "#8146b8", "#cdb2e4", "#b08fd6", "#9668c2"];++const VARIANTS = [+ { bg: "background.png", icns: "icon.icns", pngFallback: "128x128.png", leaves: STABLE_LEAVES, out: "preview.png" },+ { bg: "background-dev.png", icns: "icon-dev.icns", pngFallback: "128x128-dev.png", leaves: NIGHTLY_LEAVES, out: "preview-dev.png" }+];// Drawn stand-in used only when the real macOS Applications icon isn't available.const FOLDER_FALLBACK = `<svg class="icon" viewBox="0 0 128 128" aria-hidden="true">@@ -62,30 +66,25 @@ const FOLDER_FALLBACK = `<svg class="icon" viewBox="0 0 128 128" aria-hidden="tr<path fill="url(#ff)" d="M1 50 h126 v51 a13 13 0 0 1 -13 13 H14 a13 13 0 0 1 -13 -13 z"/></svg>`;-// Render the real macOS icons the DMG actually shows when generating on a Mac (the app's-// .icns squircle and the system Applications-folder icon). Off macOS `sips` is missing, so-// fall back to the flat logo / a drawn folder — the script still runs on any OS.const work = mkdtempSync(path.join(tmpdir(), "dmg-preview-"));-const appIconHref =- extractIcns(path.join(APP_ICON_DIR, "icon.icns"), work, "app.png") ??- pathToFileURL(path.join(APP_ICON_DIR, "png", "128x128.png")).href;const appsIconHref = extractIcns(APPLICATIONS_ICNS, work, "applications.png");-// Serve the HTML from a file:// origin so the browser allows the file:// image resources.-const htmlPath = path.join(work, "preview.html");-writeFileSync(htmlPath, buildHtml());-const browser = await chromium.launch();try {const page = await browser.newPage({viewport: { width: WIDTH + 2 * MARGIN, height: HEIGHT + TITLEBAR + 2 * MARGIN },deviceScaleFactor: 2});- await page.goto(pathToFileURL(htmlPath).href);- await page.waitForLoadState("networkidle");- const outputPath = path.join(DMG_DIR, "preview.png");- await page.screenshot({ path: outputPath, omitBackground: true });- console.log(outputPath);+ for (const variant of VARIANTS) {+ // Serve the HTML from a file:// origin so the browser allows the file:// image resources.+ const htmlPath = path.join(work, `${variant.out}.html`);+ writeFileSync(htmlPath, buildHtml(variant));+ await page.goto(pathToFileURL(htmlPath).href);+ await page.waitForLoadState("networkidle");+ const outputPath = path.join(DMG_DIR, variant.out);+ await page.screenshot({ path: outputPath, omitBackground: true });+ console.log(outputPath);+ }} finally {await browser.close();rmSync(work, { recursive: true, force: true });@@ -105,7 +104,17 @@ function extractIcns(icns, workDir, outName) {}}-function buildHtml() {+/** The trillium leaf mark for the title bar, coloured for the given channel. */+function trilliumMark(leaves) {+ const paths = LEAF_PATHS.map((d, i) => `<path fill="${leaves[i]}" d="${d}"/>`).join("");+ return `<svg viewBox="0 0 256 256" aria-hidden="true">${paths}</svg>`;+}++function buildHtml(variant) {+ const bgHref = pathToFileURL(path.join(DMG_DIR, variant.bg)).href;+ const appIconHref =+ extractIcns(path.join(APP_ICON_DIR, variant.icns), work, `app-${variant.out}.png`) ??+ pathToFileURL(path.join(APP_ICON_DIR, "png", variant.pngFallback)).href;const appsGlyph = appsIconHref ? `<img class="icon" src="${appsIconHref}">` : FOLDER_FALLBACK;return `<!doctype html><meta charset="utf-8"><style>html, body { margin: 0; padding: 0; background: transparent; }@@ -141,14 +150,14 @@ function buildHtml() {<div class="stage"><div class="win"><div class="titlebar"><span class="lights"><i class="r"></i><i class="y"></i><i class="g"></i></span>- <span class="title">${TRILLIUM_MARK} Trilium Notes</span>+ <span class="title">${trilliumMark(variant.leaves)} Trilium Notes</span></div><div class="content"><img class="bg" src="${bgHref}">- <div class="item" style="left:${APP.x}px;top:${APP.y}px">+ <div class="item" style="left:${APP.x}px;top:${ICON_Y}px"><img class="icon" src="${appIconHref}"><div class="label">${APP.label}</div></div>- <div class="item" style="left:${APPS.x}px;top:${APPS.y}px">+ <div class="item" style="left:${APPS.x}px;top:${ICON_Y}px">${appsGlyph}<div class="label">${APPS.label}</div></div></div>diff --git a/apps/desktop/electron-forge/dmg-background/preview.png b/apps/desktop/electron-forge/dmg-background/preview.pngindex b4f31a6a54..4f376110f3 100644Binary files a/apps/desktop/electron-forge/dmg-background/preview.png and b/apps/desktop/electron-forge/dmg-background/preview.png differdiff --git a/apps/desktop/electron-forge/forge.config.ts b/apps/desktop/electron-forge/forge.config.tsindex fa818de965..08e071b826 100644--- a/apps/desktop/electron-forge/forge.config.ts+++ b/apps/desktop/electron-forge/forge.config.ts@@ -161,12 +161,12 @@ const config: ForgeConfig = {window: { size: { width: 640, height: 400 } }},// Icon CENTERS in Finder's .DS_Store Iloc coordinate space: top-left origin,- // y increasing downward. y=200 sits the icon in the upper part of each tile in- // background.html, leaving room for the caption Finder draws below it (the tiles- // span y 122..300). Verify on a macOS build (appdmg is darwin-only).+ // y increasing downward. y=182 centers the icon + its caption pair vertically in+ // the window (there is no baked banner above them). Verify on a macOS build+ // (appdmg is darwin-only).contents: (opts: { appPath: string }) => [- { x: 180, y: 200, type: "file", path: opts.appPath },- { x: 460, y: 200, type: "link", path: "/Applications" }+ { x: 180, y: 182, type: "file", path: opts.appPath },+ { x: 460, y: 182, type: "link", path: "/Applications" }]}},