fix: inset mac app icons onto the macOS icon grid - #480
Merged
Conversation
Apple's macOS icon template centres an 824x824 body in a 1024x1024 canvas, so every icon macOS draws beside ours - in the Dock, the command-tab switcher, Mission Control - leaves that margin. jDeploy wrote the source artwork into every icns slice edge to edge, which renders about a quarter wider than its neighbours at the same slot size. #475 is what exposed it: before the full slice family, macOS treated the single-slice icns as legacy and shrank it onto a plate, which supplied a margin by accident. With a complete family macOS draws the artwork as authored, so a full-bleed source now shows at full slot width. Measure the source by its opaque bounds rather than its canvas, so an icon already authored to the template is passed through untouched and one that carries part of the margin is scaled the rest of the way rather than twice over. Sources too small to fill any slice we emit keep their single native slice unchanged - insetting artwork that small would leave nothing of it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133NB1qceV5MzfvRzdVPxm5
shannah
marked this pull request as ready for review
September 8, 2026 20:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
An installed jDeploy app's icon renders visibly larger than the apps beside it in the command-tab switcher, the Dock and Mission Control.
Apple's macOS icon template centres an 824×824 body in a 1024×1024 canvas — every icon macOS draws next to ours leaves that margin. jDeploy wrote the source artwork into every icns slice edge to edge, so at the same slot size it renders ~24% wider (1024/824) than its neighbours.
Why it showed up now
Before #475, macOS treated the single-slice icns as legacy and shrank it onto a plate — that supplied a margin by accident. With the full slice family in place macOS draws the artwork as authored, so a full-bleed source now shows at full slot width. #479 fixed the small-slice scrambling but not the size, which is why the icon came back uncorrupted and still oversized.
Approach
MacBundler.writeIcnsnow runs the source throughfitToIconGridbefore cutting slices:icon-grid.pngmatches the existing thumbnail cleanup pattern, so it is removed with the rest.Measured on jDeploy's own default
icon.png(512×512, full bleed): artwork now spans 409×412 of the 512 canvas ≈ 80.1%, against 512×512 (100%) before.Testing
MacBundlerIconTestgains three cases; all 237 shared-module tests pass.insetsFullBleedArtworkOntoTheIconGrid— fails on the pre-fix code (expected: <824.0> but was: <1024.0>), and also checks the artwork is centred.leavesArtworkThatAlreadySitsOnTheGridAlone— a 700-of-1024 source comes through at 700.removesTheGridFittedSource— no leftover intermediate.Delivery
The fix is in
shared, so it reaches an installed.appthrough whichever component builds that bundle — the CLI at publish time for prebuilt platform bundles and for the local install paths, orjdeploy-installerwhen the installer builds the bundle on the end user's machine. The installer-built route tracks its own npm release rather than the CLI's:jdeploy-installer@latestis 6.1.5, whoseMacBundlerstill has the pre-#475 single-slicecreateThumbnails(File, File), so that route only picks this up once a release carries it.🤖 Generated with Claude Code
https://claude.ai/code/session_0133NB1qceV5MzfvRzdVPxm5