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
fix(desktop): bake a light caption plate behind the DMG app label
Elian Doran4edab1d277d4
diff --git a/apps/desktop/electron-forge/dmg-background/README.md b/apps/desktop/electron-forge/dmg-background/README.mdindex 4c6c918abc..ec9d89e327 100644--- a/apps/desktop/electron-forge/dmg-background/README.md+++ b/apps/desktop/electron-forge/dmg-background/README.md@@ -29,29 +29,37 @@ reads `background.png`/`@2x`). Kept reproducible from source so it isn't a myste- **PNG + `@2x` for Retina.** appdmg auto-packages `background.png` and `[email protected]` into amulti-resolution TIFF. Finder *is* Retina-aware (unlike Squirrel's loading window), so it renders crisp.- **One image per channel, not per theme.** Like the splash, the background is baked and doesn't follow- Finder's light/dark mode — but as a full dark surface it reads fine either way.+ Finder's light/dark mode. Crucially, **setting a background picture forces Finder to render the window in+ light mode**, so the icon captions are drawn in **black in both light and dark system themes** — not the+ white-on-dark you might expect in Dark mode. And the caption colour is Finder's alone: the DMG format has+ no label-colour field (the `icvp` icon-view plist appdmg/ds-store write exposes only icon size, positions,+ window size, and background). appdmg also can't ship separate dark/light backgrounds (only tools like+ DropDMG can). So we keep the app caption legible with the light label plate described under *Design*.## Design- Reuses the installer splash's brand language: the same dark surface and a soft glow tinted from thetrillium's three leaves (green/orange/red — purple for nightly). The drag arrow is a muted neutralgrey, kept quiet so it doesn't compete with the icons.-- The two subtle "tiles" mark where Finder drops the real icons (app on the left, `/Applications`- alias on the right). Each tile is tall enough (156 × 178) to hold its 128 px icon *and* the caption- Finder draws beneath it, so the caption lands on the flat face rather than tucking under the rounded- bottom corners. The icon **centers** must line up with the `contents` coordinates in `forge.config.ts`.- Those coordinates use a **top-left** origin, y increasing downward, with `(x, y)` being the icon center- — Finder's `.DS_Store` `Iloc` convention (confirmed by appdmg's own example, where `y: 344` sits near- the *bottom* of the window). So the `contents` y is measured from the top, not `windowHeight - y`. The- tiles span **y 122..300**; `contents` uses **y = 200**, seating the icon in the upper part with the- caption in the lower third.-- **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" labels under the real icons.+- The icons sit directly on the dark surface (no tiles), app on the left and `/Applications` alias on the+ right, with the drag arrow between them. Their **centers** must line up with the `contents` coordinates+ in `forge.config.ts`, which use a **top-left** origin, y increasing downward, with `(x, y)` the icon+ center — Finder's `.DS_Store` `Iloc` convention (confirmed by appdmg's own example, where `y: 344` sits+ near 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**.+- **Light label plate — the Firefox DMG trick.** Because a background picture forces Finder to draw the+ captions in black (in both themes) and we can't override that colour, a light rounded **plate is baked+ into the background** under where Finder draws the "Trilium Notes" caption, so its black text stays+ legible on the dark surface. Only the app is plated: its name is a+ fixed-width brand string, whereas the localized `/Applications` name varies in width — and the folder is+ self-evident, so (like Firefox) its caption is left unplated. The plate position tracks the icon center,+ so keep it in sync if `contents` y changes; fine-tune on a macOS build like the icon positions.+- **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.## 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,- seated in the tiles in `background.html` (156 × 178, spanning y 122..300) — keep these in sync with the- tile positions in `background.html` and the `contents` in the maker config.+- `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 and the label plate 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 a1932e0491..da5784ddad 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 64e1c140cd..794b6874a9 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 c0030995b0..170ea56ca6 100644--- a/apps/desktop/electron-forge/dmg-background/background.html+++ b/apps/desktop/electron-forge/dmg-background/background.html@@ -49,20 +49,24 @@}.variant-nightly .badge { display: inline-block; }- /* Drop platforms — subtle tiles holding each icon AND the label Finder draws beneath- it. Tall enough (icon 128 + gap + caption) that the caption sits on the flat face- rather than tucking under the rounded bottom corners. Icon centers land at y = 200- (see `contents` in forge.config.ts); the caption falls in the lower third. */- .platform {+ /* Light label plate baked behind the app caption — the Firefox DMG trick. A background+ picture forces Finder to render the window in light mode, so it draws icon captions in+ black in BOTH light and dark themes — illegible on this dark surface, and the DMG has no+ label-colour field to override it. So we bake a light pill under where Finder draws the+ "Trilium Notes" caption (icon center y = 200, so the caption lands ~y = 278). Only the+ app is plated: its name is a fixed-width brand,+ whereas the localized /Applications name varies in width — and the folder is self-evident,+ so like Firefox we leave it unplated. Plate position needs a macOS build to fine-tune,+ same as the icon `contents`. */+ .plate {position: absolute;- width: 156px; height: 178px;- top: 122px;- border-radius: 28px;- background: rgba(255, 255, 255, 0.035);- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);+ top: 266px; height: 24px;+ border-radius: 12px;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);}- .platform.app { left: 102px; }- .platform.apps { left: 382px; }+ .plate.app { left: 116px; width: 128px; }+ .variant-stable .plate { background: #e9eaee; }+ .variant-nightly .plate { background: #ece2f4; }/* Muted neutral arrow — a functional cue, kept quiet so the icons carry the colour(the ambient glow already reuses the brand palette). Channel-agnostic. Vertically@@ -98,8 +102,7 @@<span class="word">Trilium <span class="notes">Notes</span><span class="badge">NIGHTLY</span></span></div>- <div class="platform app"></div>- <div class="platform apps"></div>+ <div class="plate app"></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"diff --git a/apps/desktop/electron-forge/dmg-background/background.png b/apps/desktop/electron-forge/dmg-background/background.pngindex e1de4bffb5..400538b2e4 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 171dad97fe..65e52d8398 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.mjs b/apps/desktop/electron-forge/dmg-background/preview.mjsindex a4859b8f6a..b2b89fcb71 100644--- a/apps/desktop/electron-forge/dmg-background/preview.mjs+++ b/apps/desktop/electron-forge/dmg-background/preview.mjs@@ -130,10 +130,14 @@ function buildHtml() {.content .bg { position: absolute; inset: 0; width: ${WIDTH}px; height: ${HEIGHT}px; }.item { position: absolute; width: ${ICON}px; height: ${ICON}px; transform: translate(-50%, -50%); }.item .icon { width: ${ICON}px; height: ${ICON}px; display: block; }+ /* A background picture forces Finder to render the window in light mode, so it draws the+ captions in black in BOTH light and dark themes (not white-on-dark) — which is why this+ preview renders them black. The app label reads because it sits on the light plate baked+ into the background; the Applications label stays dark on the dark surface, as it does in+ the real DMG (and in Firefox's). */.item .label {position: absolute; left: 50%; top: ${ICON + 6}px; transform: translateX(-50%);- white-space: nowrap; font-size: 13px; font-weight: 500; color: #f4f5f7;- text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);+ white-space: nowrap; font-size: 13px; font-weight: 500; color: #1d1d1f;}</style><div class="stage"><div class="win">diff --git a/apps/desktop/electron-forge/dmg-background/preview.png b/apps/desktop/electron-forge/dmg-background/preview.pngindex 20efe1f83f..27d25417c1 100644Binary files a/apps/desktop/electron-forge/dmg-background/preview.png and b/apps/desktop/electron-forge/dmg-background/preview.png differ