Skip to content

fix(core): update icon build script - #215

Merged
coryrylan merged 2 commits into
mainfrom
topic-add-icon-fix
Aug 12, 2026
Merged

fix(core): update icon build script#215
coryrylan merged 2 commits into
mainfrom
topic-add-icon-fix

Conversation

@coryrylan

@coryrylan coryrylan commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Improvements
    • Improved icon sizing, centering, spacing, and viewBox alignment for more consistent rendering.
    • Refined artwork, dimensions, and stroke or fill styling across multiple icons.
    • Reduced unwanted whitespace while preserving intentional optical spacing.
    • Update lucide icons (plus, chevron-up, chevrons-up, x, message-circle-plus)
  • Bug Fixes
    • Improved SVG rendering consistency across supported icons.
  • Chores
    • Updated bundled dependency notices to reflect newer versions.

Signed-off-by: Cory Rylan <crylan@nvidia.com>
@coryrylan coryrylan self-assigned this Aug 12, 2026
@github-actions github-actions Bot added scope(core) scope(cli) dependencies Pull requests that update a dependency file labels Aug 12, 2026
@coryrylan coryrylan changed the title Topic add icon fix fix(core): update icon build script Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR revises SVG icon processing, updates icon artwork and rendering tests, adjusts icon build tracking, and refreshes bundled dependency notices for the root and CLI projects.

Changes

Icon pipeline

Layer / File(s) Summary
SVG processing and build tracking
projects/core/build/icons.js, projects/core/package.json
The build normalizes Lucide classes, simplifies SVG optimization, and repairs viewBoxes using browser geometry and raster analysis. Wireit tracks individual SVG inputs.
Icon registry artwork
projects/core/src/icon/server.ts
Existing SVG definitions are updated, and new filled and stroked icons are added.
Icon rendering and visual validation
projects/core/src/icon/icon.css, projects/core/src/icon/icon.test.visual.ts
The icon host uses explicit dimensions and flex centering. Visual tests check ghost space and curated optical spacing.

Dependency notices

Layer / File(s) Summary
Bundled dependency notice versions
NOTICE.md, projects/cli/NOTICE.md
The notices update @inquirer/prompts, marked, and ora versions in package listings and MIT attribution sections.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SVGInputs as SVG inputs
  participant IconsBuild as icons.js
  participant BrowserAnalysis as Browser geometry analysis
  participant VisualTests as icon.test.visual.ts
  SVGInputs->>IconsBuild: Provide icon SVGs
  IconsBuild->>BrowserAnalysis: Measure painted bounds
  BrowserAnalysis-->>IconsBuild: Return fitted viewBox
  IconsBuild->>VisualTests: Produce processed icon assets
  VisualTests->>VisualTests: Compare rendered grids
Loading

Possibly related PRs

  • NVIDIA/elements#212: Updates the same bundled dependency versions in the root and CLI notice files.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: updating the core icon build script and related icon processing.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch topic-add-icon-fix

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/build/icons.js`:
- Around line 302-318: Update the icon-processing loop around getPaintedBounds
to catch failures per icon, rethrow an error that includes the current name, and
guarantee div.remove() runs on both success and failure via a finally cleanup
path. Preserve the existing SVG bounds and result assignment behavior for
successful icons.

In `@projects/core/src/icon/icon.test.visual.ts`:
- Around line 19-27: Rename ICONS_WITH_GHOST_SPACE to ICONS_WITH_OPTICAL_SPACING
and update both references. Add a guard test in the icon visual test file that
reads icon.css, extracts the :host([name='...']) selectors from the
--nve-ref-scale-size: 0.8 optical-spacing rule, and asserts that the resulting
set exactly matches ICONS_WITH_OPTICAL_SPACING.

In `@projects/core/src/icon/server.ts`:
- Line 246: Update the star-half SVG entry to remove the undeclared
--stroke-color reference, replacing the right-half group’s stroke with
currentColor, then regenerate the icon output if this registry is generated.
Keep the existing half-star geometry and other stroke attributes unchanged.
- Line 33: Update the source add-comment.svg stroke scaling to match the
expected normalized icon proportions, then regenerate server.ts so the
add-comment entry reflects the updated SVG while preserving its existing artwork
and metadata.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 31df80a2-b128-4f90-968e-5eef77993c89

📥 Commits

Reviewing files that changed from the base of the PR and between 58a64b2 and b99fad3.

⛔ Files ignored due to path filters (35)
  • projects/core/.visual/icon.dark.png is excluded by !**/*.png
  • projects/core/.visual/icon.explicit-optical-spacing.png is excluded by !**/*.png
  • projects/core/.visual/icon.no-ghost-space.png is excluded by !**/*.png
  • projects/core/.visual/icon.png is excluded by !**/*.png
  • projects/core/.visual/star-rating.dark.png is excluded by !**/*.png
  • projects/core/.visual/star-rating.png is excluded by !**/*.png
  • projects/core/.visual/tag.dark.png is excluded by !**/*.png
  • projects/core/src/icon/icons/add-comment.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/add.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/arrow-cycle.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/arrow-stop.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/bell-stroke.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/bookmark-stroke.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/cancel.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/chevron.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/color-palette.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/copy.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/double-chevron.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/flag-stroke.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/flag.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/globe-alt-stroke.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/inspect.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/keyboard.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/looping.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/outline.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/placeholder.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/redo.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/split-horizontal.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/split-none.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/star-half.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/star-stroke.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/stop.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/stopwatch.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/truck.svg is excluded by !**/*.svg
  • projects/core/src/icon/icons/zoom-out.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • NOTICE.md
  • projects/cli/NOTICE.md
  • projects/core/build/icons.js
  • projects/core/package.json
  • projects/core/src/icon/icon.css
  • projects/core/src/icon/icon.test.visual.ts
  • projects/core/src/icon/server.ts

Comment thread projects/core/build/icons.js
Comment thread projects/core/src/icon/icon.test.visual.ts Outdated
Comment thread projects/core/src/icon/server.ts
Comment thread projects/core/src/icon/server.ts
- Updated icon files to improve SVG rendering and added new icons with explicit optical spacing
- Fix issue where inner optical scale was not respected relative to the intrinsic bounding box of the icon
- Fix issue with broken svgo optimization step
- Fix issue where bounding box relative to viewbox was incorrectly calculated creating clipping issues of certain icons
- Update icon build to support lucide icons (plus, chevron-up, chevrons-up, x, message-circle-plus)

Signed-off-by: Cory Rylan <crylan@nvidia.com>

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/build/icons.js`:
- Around line 318-323: Update the icon processing flow containing the browser
setup and page.evaluate operations so browser.close() executes in a finally
block on both success and failure paths. Preserve the existing error handling
and div cleanup, ensuring Chromium is closed even when setup or evaluation
rejects.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 1f5560cf-039e-452b-ba88-844b0b7a7fa9

📥 Commits

Reviewing files that changed from the base of the PR and between b99fad3 and cce4e89.

📒 Files selected for processing (2)
  • projects/core/build/icons.js
  • projects/core/src/icon/icon.test.visual.ts

Comment thread projects/core/build/icons.js
@johnyanarella
johnyanarella self-requested a review August 12, 2026 21:45
@coryrylan
coryrylan merged commit ad3d51c into main Aug 12, 2026
15 checks passed
@coryrylan
coryrylan deleted the topic-add-icon-fix branch August 12, 2026 23:06
@coryrylan

Copy link
Copy Markdown
Collaborator Author

🎉 This issue has been resolved in version 2.3.1 🎉

Changelog

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

Labels

dependencies Pull requests that update a dependency file released scope(cli) scope(core)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants