Skip to content

fix: use rounded app AO icon in Electron#431

Open
nikhilachale wants to merge 2 commits into
aoagents:mainfrom
nikhilachale:electron-icon
Open

fix: use rounded app AO icon in Electron#431
nikhilachale wants to merge 2 commits into
aoagents:mainfrom
nikhilachale:electron-icon

Conversation

@nikhilachale

Copy link
Copy Markdown

Description

This PR updates the Electron app icon handling so the app uses our AO icon consistently instead of showing the default Electron icon or a hard square icon in the macOS Dock.

Changes

Code Updates

  • Added macOS runtime Dock icon support in frontend/src/main.ts
    • Implemented app.dock.setIcon(...) to set the Dock icon at runtime
    • Ensures the correct icon displays in the macOS Dock during development and packaged builds

Icon Asset Updates

  • Reused existing windowIconPath() resolution

    • Dev mode: loads frontend/assets/icon.png
    • Packaged builds: loads from process.resourcesPath/icon.png
    • Maintains consistency across build modes
  • Updated icon assets with rounded corners

    • Modified frontend/assets/icon.png to have transparent corners
    • Replaced opaque square background with transparent pixels
    • Regenerated platform-specific icon assets:
      • frontend/assets/icon.ico (Windows)
      • frontend/assets/icon.icns (macOS, if applicable)

Why This Change?

Problem

  • BrowserWindow({ icon }) works for Windows/Linux window and taskbar icons
  • macOS ignores BrowserWindow.icon for the Dock icon display
  • Without explicit runtime configuration, the Dock showed:
    • Electron's default icon
    • Hard square appearance (opaque background)
    • Stale/unrounded icon during development

Solution

  1. macOS Dock requires app.dock.setIcon(...) at runtime

    • The Dock icon is a separate entity from the window icon on macOS
    • Must be set after app.whenReady() and before window creation
  2. Transparent corners for proper appearance

    • PNG corners are now transparent instead of opaque
    • Provides the rounded, polished look expected on modern macOS
  3. Consistent icon resolution

    • Reuses existing windowIconPath() logic
    • Ensures dev and packaged builds both use the correct asset

Screenshots / Evidence

Screenshot 2026-06-30 at 10 51 09 Screenshot 2026-06-30 at 10 51 03 Screenshot 2026-06-30 at 10 50 47

Closes #430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Electron app shows default Dock icon instead of AO app icon

1 participant