Simplify tray: static template icon, click focuses the app
The setImage-swapped progress frames lost the template treatment on macOS and rendered black-on-dark once transfers started. Dial back per user decision: the tray is now just the glyph (template image set once at construction, never swapped) and clicking it activates the window — no menu, no progress effects. Removes everything that only served the fancy version: progress frames + generation, engine.aggregateProgress, the workspacesSync webview->bun channel (schema, send proxy, panels effect, handlers) and the activate-tab action. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+2
-21
@@ -1,7 +1,7 @@
|
||||
// Regenerate every raster icon asset from the SVG sources (dev-time only).
|
||||
// bun scripts/gen-icons.ts
|
||||
// Produces: assets/icon.png (1024), assets/icon.iconset/* (macOS app icon),
|
||||
// assets/tray/tray-44-template.png, assets/tray/progress/p{0..100}.png.
|
||||
// assets/tray/tray-44-template.png.
|
||||
import { mkdir } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { Resvg } from "@resvg/resvg-js";
|
||||
@@ -31,23 +31,4 @@ for (const size of [16, 32, 128, 256, 512]) {
|
||||
const trayGlyph = await Bun.file(path.join(assets, "tray", "tray-glyph.svg")).text();
|
||||
await writePng(path.join(assets, "tray", "tray-44-template.png"), trayGlyph, 44);
|
||||
|
||||
// ---- tray progress frames: faded arrows + centered bar filled to pct ----
|
||||
function progressSvg(pct: number): string {
|
||||
const trackX = 4;
|
||||
const trackW = 16;
|
||||
const fillW = (trackW * pct) / 100;
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<g fill="none" stroke="#000" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" opacity="0.35">
|
||||
<path d="M9.2 9.2 4.6 4.6m0 0v4.2m0-4.2h4.2"/>
|
||||
<path d="m14.8 14.8 4.6 4.6m0 0v-4.2m0 4.2h-4.2"/>
|
||||
</g>
|
||||
<rect x="${trackX}" y="10.7" width="${trackW}" height="2.6" rx="1.3" fill="#000" opacity="0.25"/>
|
||||
${fillW > 0 ? `<rect x="${trackX}" y="10.7" width="${fillW.toFixed(2)}" height="2.6" rx="1.3" fill="#000"/>` : ""}
|
||||
</svg>`;
|
||||
}
|
||||
|
||||
for (let pct = 0; pct <= 100; pct += 5) {
|
||||
await writePng(path.join(assets, "tray", "progress", `p${pct}.png`), progressSvg(pct), 44);
|
||||
}
|
||||
|
||||
console.log("icons regenerated: app iconset, tray template, 21 progress frames");
|
||||
console.log("icons regenerated: app iconset + tray template");
|
||||
|
||||
Reference in New Issue
Block a user