Skip to content

feat: Forge brand icon as the default scaffolded app icon#30

Merged
LayerDynamics merged 3 commits into
mainfrom
feat-forge-branded-icon
Jun 8, 2026
Merged

feat: Forge brand icon as the default scaffolded app icon#30
LayerDynamics merged 3 commits into
mainfrom
feat-forge-branded-icon

Conversation

@LayerDynamics

Copy link
Copy Markdown
Owner

Replaces the procedural gradient placeholder from forge icon create with the real Forge brand icon, and wires a favicon set into the docs site.

Changes

  • crates/forge_cli/assets/forge-icon-1024.png — 1024×1024 brand master (ember-gradient rounded plate + crossed-hammers/anvil emblem + wordmark), embedded via include_bytes!.
  • bundler/icons.rsIconProcessor::create_placeholder now decodes the embedded master and resizes it, instead of drawing a blue→purple gradient. Rgba/RgbaImage are now #[cfg(windows)] (only save_wide uses them).
  • main.rsforge icon create messaging ("Forge-branded icon", "do not ship the Forge logo" guidance).
  • scripts/generate-brand-icon.sh — documented ImageMagick pipeline that builds the 1024 master + favicons from assets/forge.png.
  • Sitefavicon.svg/.ico/favicon-32.png/apple-touch-icon.png + astro.config.mjs favicon wiring; refreshed logo.svg and the example apps' assets/icon.png.

Verified

cargo fmt + clippy -D warnings clean on forge_cli; forge icon create produces a valid 1024×1024 RGBA PNG; site builds (91 pages).

This also unblocks the planned clap-derive CLI migration, which was waiting on main.rs being clean.

🤖 Generated with Claude Code

Replace the procedurally-generated gradient placeholder produced by
`forge icon create` with the real Forge brand icon, and add a matching
favicon set to the docs site.

- crates/forge_cli/assets/forge-icon-1024.png: the 1024x1024 brand master
  (ember-gradient rounded plate + crossed-hammers/anvil emblem + wordmark).
- bundler/icons.rs: `IconProcessor::create_placeholder` now decodes the
  embedded master (`include_bytes!`) and resizes it to the requested size,
  instead of drawing a blue→purple gradient. `Rgba`/`RgbaImage` are now only
  needed by the Windows-only `save_wide`, so their import is `#[cfg(windows)]`.
- main.rs: `forge icon create` messaging updated ("Forge-branded icon",
  "do not ship the Forge logo" guidance).
- scripts/generate-brand-icon.sh: regenerate the 1024 master + favicons from
  assets/forge.png via ImageMagick (documented source-of-truth pipeline).
- site: favicon.svg / favicon.ico / favicon-32.png / apple-touch-icon.png +
  astro.config.mjs favicon wiring; refreshed logo.svg and the example apps'
  assets/icon.png.

Verified: `cargo fmt`/`clippy -D warnings` clean on forge_cli; `forge icon
create` produces a valid 1024x1024 RGBA PNG; the site builds (91 pages).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @LayerDynamics, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the programmatically generated placeholder icon with a default Forge-branded icon by embedding a 1024x1024 PNG master of the Forge logo and updating the icon generator to resize it. It also adds a script to generate the brand icon and favicons, updates the CLI messages, and configures the Astro documentation site to use the new branding. Feedback on the changes suggests using the more idiomatic #[cfg(windows)] attribute instead of #[cfg(target_os = "windows")] for conditional compilation in icons.rs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread crates/forge_cli/src/bundler/icons.rs
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Comment thread crates/forge_cli/src/bundler/icons.rs Fixed
Commit 76bac20 (a gemini-code-assist suggestion) meant only to shorten
`#[cfg(target_os = "windows")]` to `#[cfg(windows)]`, but its diff also
deleted the unconditional `use image::{imageops::FilterType, DynamicImage,
ImageFormat};` line. Those three types are used unconditionally — DynamicImage
(the `source_image` field + the RGBA match), FilterType (`resize_exact`), and
ImageFormat (`save_with_format`) — so the crate failed to compile with E0412
"cannot find type FilterType in this scope" (caught by the clippy CI job).

Restore the import; keep the equivalent `#[cfg(windows)]` shorthand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LayerDynamics LayerDynamics merged commit 2b782bc into main Jun 8, 2026
20 checks passed
LayerDynamics added a commit that referenced this pull request Jun 8, 2026
…5.2) (#31)

## Summary

Phase **P5.2** of the docs-autogeneration pipeline: migrate the `forge`
CLI from a hand-rolled `env::args()` parser to **clap derive**, and
update the documentation-drift gate to track the new command model.

### CLI migration
- `forge_cli/src/main.rs` now uses `#[derive(Parser)] Cli` +
`#[derive(Subcommand)] enum Commands`, with dispatch in `main()`.
- Generated `--help` / `--version`, real clap error messages, and
per-subcommand help.
- **Contract preserved exactly**:
`dev`/`build`/`bundle`/`smelt`/`sign`/`icon`/`docs`; `-o/--out`,
`--embed`, `-i/--identity`, the `artifact` positional, `icon
create`/`validate`. Hand-written usage extras carried over via clap
`after_help`.
- `docs` keeps `trailing_var_arg` pass-through so its sub-flags still
forward to the docs generator unchanged.

### Drift-rule follow-through
The migration deleted the `forge <a|b|c>` usage banner that the
`cli-command` drift rule parsed. That rule is **re-pointed at the clap
`Commands` enum** (the new single source of truth): it brace-matches the
enum body, harvests top-level variant names, and applies clap's default
PascalCase→kebab-case rename to recover the exact subcommand names.
`forge smelt`-style "real subcommand but undocumented" detection keeps
working.

## Test plan
- [x] Documentation drift gate: **in sync, 0 issues**
- [x] `forge-docs-check`: **15/15** (incl. updated clap-enum fixture)
- [x] `forge_cli`: **15 unit + 10 characterization** pass
- [x] `cargo fmt --check` + `cargo clippy -D warnings` clean on both
crates

## Notes
- The characterization tests (P5.1) were intentionally rewritten: clap's
edge-case behavior (no-args, unknown subcommand, bad flag) now exits
non-zero with clap errors instead of the old hand-parser's exit-0 usage
print. The preserved command/flag/alias/positional surface is asserted
so a future change can't silently drop one.
- Independent of the open branding PR #30 (`feat-forge-branded-icon`);
the two main.rs changesets touch disjoint regions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants