Skip to content

Comments

fix: macOS icon sizes and organize assets folder#296

Open
buraian wants to merge 2 commits intorequestly:masterfrom
buraian:chore/fix-macos-icon-sizes
Open

fix: macOS icon sizes and organize assets folder#296
buraian wants to merge 2 commits intorequestly:masterfrom
buraian:chore/fix-macos-icon-sizes

Conversation

@buraian
Copy link

@buraian buraian commented Feb 19, 2026

Fixes #153

Summary

  • Fixed oversized/blurry icons in macOS dock and app switcher by regenerating icon.icns with all required Retina sizes
  • Added prep-icons.sh script to generate icon.icns from AppIcon.png
  • Added README.md documenting all asset files
  • Removed unused files (AppIcon.icns, icon.svg)

Test Plan

  • Build and package the app on macOS
  • Verify dock icon displays correctly at normal size
  • Verify app switcher icon displays correctly
  • Verify tray icon displays correctly on Retina displays

Screenshot Verification

Screenshot 2026-02-19 at 3 03 18 PM Screenshot 2026-02-19 at 3 07 10 PM

Summary by CodeRabbit

  • Documentation

    • Added comprehensive assets directory documentation detailing icon files, platform-specific assets, directory layout, and instructions to regenerate macOS icons.
  • Chores

    • Added an automated icon-generation script to produce macOS icon assets from a single source image with validation and clean-up.

- Add prep-icons.sh script to generate icon.icns from AppIcon.png
- Add README.md documenting asset files
- Regenerate icon.icns with proper Retina sizes for dock/app switcher
- Delete unused files (AppIcon.icns, icon.svg)
@CLAassistant
Copy link

CLAassistant commented Feb 19, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Adds assets/README.md documenting the assets directory layout, icon files (AppIcon.png, platform-specific icons, templates), auxiliary files (entitlements.mac.plist, requirement.rqset, assets.d.ts), an ASCII tree, and instructions to regenerate macOS icons. Adds assets/prep-icons.sh, a shell script that validates AppIcon.png, creates a temporary .iconset with multiple sizes via sips (including @2x variants), converts it to .icns with iconutil, cleans up, and prints success; exits on errors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing macOS icon sizes and organizing the assets folder with documentation and automation scripts.
Linked Issues check ✅ Passed The PR directly addresses issue #153 by regenerating the icon.icns with correct Retina sizes and adding automation scripts to prevent future sizing issues.
Out of Scope Changes check ✅ Passed All changes are within scope: icon regeneration and Retina size fixes address the core issue, while assets documentation and prep script support long-term icon maintenance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
assets/prep-icons.sh (2)

9-12: Consider adding a macOS platform guard near the top.

sips and iconutil are macOS-only. Running the script on Linux produces a confusing command not found error rather than a clear message.

♻️ Proposed fix
+if [ "$(uname)" != "Darwin" ]; then
+  echo "Error: This script requires macOS (sips and iconutil are macOS-only tools)"
+  exit 1
+fi
+
 SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/prep-icons.sh` around lines 9 - 12, Add a macOS platform guard at the
top of the script to check the OS (e.g., using uname or $OSTYPE) and exit with a
clear error if not Darwin, so macOS-only commands like sips and iconutil are not
invoked on Linux; modify the script around the existing variables (SCRIPT_DIR,
SOURCE, OUTPUT, ICONSET) to perform the check before any sips/iconutil usage and
print a descriptive message such as "This script requires macOS (Darwin) — sips
and iconutil are not available" before exiting with a non-zero status.

7-7: Add an EXIT trap to ensure cleanup on early failure.

With set -e, if any sips call fails, execution jumps past Line 44, leaving a partial ICONSET directory behind. The next run's rm -rf recovers, but an EXIT trap is cleaner.

♻️ Proposed fix
 set -e
+trap 'rm -rf "$ICONSET"' EXIT

With this in place, the explicit rm -rf on Line 44 can be kept or removed (becomes a no-op).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/prep-icons.sh` at line 7, Add an EXIT trap to remove the temporary
ICONSET directory on any early exit: after ICONSET is defined in the script,
install a trap like trap 'rm -rf "$ICONSET"' EXIT so any failure (e.g., a
failing sips call) will clean up the partial ICONSET; ensure ICONSET is exported
or in scope for the trap and keep or remove the explicit rm -rf at the end as
desired.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@assets/README.md`:
- Line 5: The markdown directory-tree fenced block is missing a language tag
which triggers MD040; edit the README's directory-tree fenced code block that
contains "assets/" (the block with the three backticks) and change the opening
fence to include the text language identifier (```text) so the block becomes a
fenced code block with a language tag, then keep the closing triple backticks
as-is to silence the markdownlint warning.

---

Nitpick comments:
In `@assets/prep-icons.sh`:
- Around line 9-12: Add a macOS platform guard at the top of the script to check
the OS (e.g., using uname or $OSTYPE) and exit with a clear error if not Darwin,
so macOS-only commands like sips and iconutil are not invoked on Linux; modify
the script around the existing variables (SCRIPT_DIR, SOURCE, OUTPUT, ICONSET)
to perform the check before any sips/iconutil usage and print a descriptive
message such as "This script requires macOS (Darwin) — sips and iconutil are not
available" before exiting with a non-zero status.
- Line 7: Add an EXIT trap to remove the temporary ICONSET directory on any
early exit: after ICONSET is defined in the script, install a trap like trap 'rm
-rf "$ICONSET"' EXIT so any failure (e.g., a failing sips call) will clean up
the partial ICONSET; ensure ICONSET is exported or in scope for the trap and
keep or remove the explicit rm -rf at the end as desired.

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.

In the macOS dock, the app icon appears slightly larger.

2 participants