Skip to content

Commit c316a8b

Browse files
authored
feat: update logo (#1289)
1 parent b48fec6 commit c316a8b

22 files changed

Lines changed: 72 additions & 66 deletions

apps/code/build/app-icon.icns

-373 KB
Binary file not shown.

apps/code/build/app-icon.ico

-161 KB
Binary file not shown.

apps/code/build/app-icon.png

-232 KB
Loading
163 KB
Loading
Lines changed: 17 additions & 7 deletions
Loading

apps/code/forge.config.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ChildProcess } from "node:child_process";
22
import { execSync } from "node:child_process";
3-
import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
3+
import { cpSync, existsSync, mkdirSync, rmSync, statSync } from "node:fs";
44
import path from "node:path";
55
import { MakerDMG } from "@electron-forge/maker-dmg";
66
import { MakerZIP } from "@electron-forge/maker-zip";
@@ -185,16 +185,20 @@ const config: ForgeConfig = {
185185
],
186186
hooks: {
187187
generateAssets: async () => {
188-
// Generate ICNS from source PNG (skip if already exists)
188+
const isNewer = (src: string, dest: string) =>
189+
!existsSync(dest) || statSync(src).mtimeMs > statSync(dest).mtimeMs;
190+
189191
if (
190192
existsSync("build/app-icon.png") &&
191-
!existsSync("build/app-icon.icns")
193+
isNewer("build/app-icon.png", "build/app-icon.icns")
192194
) {
193195
execSync("bash scripts/generate-icns.sh", { stdio: "inherit" });
194196
}
195197

196-
// Compile liquid glass icon to Assets.car (skip if already exists)
197-
if (existsSync("build/icon.icon") && !existsSync("build/Assets.car")) {
198+
if (
199+
existsSync("build/icon.icon") &&
200+
isNewer("build/icon.icon/icon.json", "build/Assets.car")
201+
) {
198202
execSync("bash scripts/compile-glass-icon.sh", { stdio: "inherit" });
199203
}
200204
},

apps/code/scripts/generate-icns.sh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,21 @@ fi
1717

1818
mkdir -p "$ICONSET_DIR"
1919

20-
# Scale factor for macOS icon guidelines: 832/1024 = 13/16 = 0.8125
21-
# This gives proper padding matching native macOS icons
22-
SCALE=0.8125
23-
24-
# Generate all required icon sizes with padding
25-
# Check if sips exists (macOS only)
2620
if ! command -v sips &> /dev/null; then
2721
echo "Warning: sips not found. Skipping ICNS generation (only supported on macOS)."
2822
exit 0
2923
fi
3024

3125
sips -z 16 16 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_16x16.png" > /dev/null
32-
sips -Z $(echo "16 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_16x16.png" --padToHeightWidth 16 16 > /dev/null
33-
3426
sips -z 32 32 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_16x16@2x.png" > /dev/null
35-
sips -Z $(echo "32 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_16x16@2x.png" --padToHeightWidth 32 32 > /dev/null
36-
3727
sips -z 32 32 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_32x32.png" > /dev/null
38-
sips -Z $(echo "32 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_32x32.png" --padToHeightWidth 32 32 > /dev/null
39-
4028
sips -z 64 64 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_32x32@2x.png" > /dev/null
41-
sips -Z $(echo "64 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_32x32@2x.png" --padToHeightWidth 64 64 > /dev/null
42-
4329
sips -z 128 128 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_128x128.png" > /dev/null
44-
sips -Z $(echo "128 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_128x128.png" --padToHeightWidth 128 128 > /dev/null
45-
4630
sips -z 256 256 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_128x128@2x.png" > /dev/null
47-
sips -Z $(echo "256 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_128x128@2x.png" --padToHeightWidth 256 256 > /dev/null
48-
4931
sips -z 256 256 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_256x256.png" > /dev/null
50-
sips -Z $(echo "256 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_256x256.png" --padToHeightWidth 256 256 > /dev/null
51-
5232
sips -z 512 512 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_256x256@2x.png" > /dev/null
53-
sips -Z $(echo "512 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_256x256@2x.png" --padToHeightWidth 512 512 > /dev/null
54-
5533
sips -z 512 512 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_512x512.png" > /dev/null
56-
sips -Z $(echo "512 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_512x512.png" --padToHeightWidth 512 512 > /dev/null
57-
5834
sips -z 1024 1024 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_512x512@2x.png" > /dev/null
59-
sips -Z $(echo "1024 * $SCALE" | bc | cut -d. -f1) "$ICONSET_DIR/icon_512x512@2x.png" --padToHeightWidth 1024 1024 > /dev/null
6035

6136
echo "Converting iconset to ICNS..."
6237

4.52 KB
Loading
-2.35 KB
Binary file not shown.

apps/code/src/renderer/assets/images/posthog-code-favicon-dark.svg

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)