fix(core): update icon build script - #215
Conversation
Signed-off-by: Cory Rylan <crylan@nvidia.com>
📝 WalkthroughWalkthroughThe 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. ChangesIcon pipeline
Dependency notices
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (35)
projects/core/.visual/icon.dark.pngis excluded by!**/*.pngprojects/core/.visual/icon.explicit-optical-spacing.pngis excluded by!**/*.pngprojects/core/.visual/icon.no-ghost-space.pngis excluded by!**/*.pngprojects/core/.visual/icon.pngis excluded by!**/*.pngprojects/core/.visual/star-rating.dark.pngis excluded by!**/*.pngprojects/core/.visual/star-rating.pngis excluded by!**/*.pngprojects/core/.visual/tag.dark.pngis excluded by!**/*.pngprojects/core/src/icon/icons/add-comment.svgis excluded by!**/*.svgprojects/core/src/icon/icons/add.svgis excluded by!**/*.svgprojects/core/src/icon/icons/arrow-cycle.svgis excluded by!**/*.svgprojects/core/src/icon/icons/arrow-stop.svgis excluded by!**/*.svgprojects/core/src/icon/icons/bell-stroke.svgis excluded by!**/*.svgprojects/core/src/icon/icons/bookmark-stroke.svgis excluded by!**/*.svgprojects/core/src/icon/icons/cancel.svgis excluded by!**/*.svgprojects/core/src/icon/icons/chevron.svgis excluded by!**/*.svgprojects/core/src/icon/icons/color-palette.svgis excluded by!**/*.svgprojects/core/src/icon/icons/copy.svgis excluded by!**/*.svgprojects/core/src/icon/icons/double-chevron.svgis excluded by!**/*.svgprojects/core/src/icon/icons/flag-stroke.svgis excluded by!**/*.svgprojects/core/src/icon/icons/flag.svgis excluded by!**/*.svgprojects/core/src/icon/icons/globe-alt-stroke.svgis excluded by!**/*.svgprojects/core/src/icon/icons/inspect.svgis excluded by!**/*.svgprojects/core/src/icon/icons/keyboard.svgis excluded by!**/*.svgprojects/core/src/icon/icons/looping.svgis excluded by!**/*.svgprojects/core/src/icon/icons/outline.svgis excluded by!**/*.svgprojects/core/src/icon/icons/placeholder.svgis excluded by!**/*.svgprojects/core/src/icon/icons/redo.svgis excluded by!**/*.svgprojects/core/src/icon/icons/split-horizontal.svgis excluded by!**/*.svgprojects/core/src/icon/icons/split-none.svgis excluded by!**/*.svgprojects/core/src/icon/icons/star-half.svgis excluded by!**/*.svgprojects/core/src/icon/icons/star-stroke.svgis excluded by!**/*.svgprojects/core/src/icon/icons/stop.svgis excluded by!**/*.svgprojects/core/src/icon/icons/stopwatch.svgis excluded by!**/*.svgprojects/core/src/icon/icons/truck.svgis excluded by!**/*.svgprojects/core/src/icon/icons/zoom-out.svgis excluded by!**/*.svg
📒 Files selected for processing (7)
NOTICE.mdprojects/cli/NOTICE.mdprojects/core/build/icons.jsprojects/core/package.jsonprojects/core/src/icon/icon.cssprojects/core/src/icon/icon.test.visual.tsprojects/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>
b99fad3 to
cce4e89
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
projects/core/build/icons.jsprojects/core/src/icon/icon.test.visual.ts
|
🎉 This issue has been resolved in version 2.3.1 🎉 |
Summary by CodeRabbit