Skip to content

fix(v3/cli): give generate icons its documented default paths#5825

Merged
leaanthony merged 1 commit into
masterfrom
fix/icons-defaults-clean
Jul 26, 2026
Merged

fix(v3/cli): give generate icons its documented default paths#5825
leaanthony merged 1 commit into
masterfrom
fix/icons-defaults-clean

Conversation

@taliesin-ai

@taliesin-ai taliesin-ai commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #5699. Supersedes #5753 — see below.

The fix

wails3 generate icons advertised input and output paths in its help text but had no defaults, so running it bare did nothing useful.

Three struct tags. The clir default: tag already works on this command — Sizes has carried one all along — so the other three fields just needed the same treatment.

Why not #5753

#5753 restructured the subcommand to set the defaults imperatively, and its CI is red on all three platforms. It references flags.GenerateIconsOptions, which does not exist anywhere in v3, while commands.GenerateIcons takes *IconsOptions. It also renamed a local task variable to Task, set each default in two places at once (struct tag and imperative assignment, so the two can silently diverge), and stripped the trailing newline from four Go files.

None of that is needed once you notice the tag mechanism already works. Worth closing #5753 in favour of this.

Verification

  • gofmt clean.
  • Built the CLI and ran the command, rather than inferring from the code:
  -input string
        The input image file (default "build/appicon.png")
  -macfilename string
        The output filename for the Mac icon bundle (default "build/darwin/icon.icns")
  -windowsfilename string
        The output filename for the Windows icon (default "build/windows/icon.ico")

Summary by CodeRabbit

  • Bug Fixes
    • Added default file paths for icon generation inputs and Windows/macOS output files.
    • Icon generation now works with standard paths when these options are omitted.

`wails3 generate icons` advertised input and output paths in its help text but
had no defaults, so running it bare produced nothing useful. Closes #5699.

The fix is three struct tags. The clir `default:` tag already works on this
command: `Sizes` has carried one all along and `-help` prints it, so the other
three fields simply needed the same treatment.

Verified: gofmt clean, and `wails3 generate icons -help` now prints
(default "build/appicon.png"), (default "build/windows/icon.ico") and
(default "build/darwin/icon.icns").

Supersedes the approach in #5753, which does not compile.

Claude-Session: https://claude.ai/code/session_01FigQqUQbNu9ngE4a2CSNm8
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 67c860f4-2fd4-4b1c-adab-f20cda253d8c

📥 Commits

Reviewing files that changed from the base of the PR and between 2e768db and 3a86602.

📒 Files selected for processing (1)
  • v3/internal/commands/icons.go

Walkthrough

The icon generation options now provide default paths for the source image, Windows icon, and macOS icon when omitted through CLI or Wails bindings.

Changes

Icon generation defaults

Layer / File(s) Summary
Define icon option defaults
v3/internal/commands/icons.go
IconsOptions now defaults input to build/appicon.png, Windows output to build/windows/icon.ico, and macOS output to build/darwin/icon.icns.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested labels: Bug, go, v3

Suggested reviewers: leaanthony

Poem

I’m a rabbit with icons to bake,
With defaults set for paths’ sake.
PNG in the build,
ICO and ICNS fulfilled—
One small hop, fewer flags to take!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the default-path fix for generate icons.
Description check ✅ Passed The description includes the issue reference, motivation, summary, and verification details, though some template sections are not fully filled.
Linked Issues check ✅ Passed The change adds the documented default values for input, Windows, and macOS icon paths, matching issue #5699.
Out of Scope Changes check ✅ Passed The PR is narrowly scoped to icon default-path tags and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/icons-defaults-clean

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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.

@leaanthony leaanthony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Three tags, and the help output confirms it rather than the code implying it. Right call to check whether the existing mechanism worked before accepting the restructure in #5753Sizes printing its default was the giveaway that the tag path was already wired up.

@leaanthony
leaanthony merged commit 5c0f1ce into master Jul 26, 2026
43 checks passed
@leaanthony
leaanthony deleted the fix/icons-defaults-clean branch July 26, 2026 11:42
leaanthony pushed a commit that referenced this pull request Jul 26, 2026
…nerate icons` its documented default paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v3] wails3 generate icons - default variable values

2 participants