Skip to content

Conversation

@nielslyngsoe
Copy link
Member

Prepare for custom-made SVG icons

Copilot AI review requested due to automatic review settings November 28, 2025 10:43
@nielslyngsoe nielslyngsoe added the release/no-notes Not directly part of the release (updating README, build scripts, tests, etc.) label Nov 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reorganizes the icon structure by moving legacy icons into a dedicated folder and creating a new folder for custom SVG icons. It updates the icon-company.ts file with a new SVG definition and modifies the build system to support both legacy and custom icon paths.

  • Moved existing Umbraco icons to a legacy/ subfolder
  • Added support for a new custom/ folder for custom-made icons
  • Updated the icon build system to process icons from both locations

Reviewed changes

Copilot reviewed 3 out of 614 changed files in this pull request and generated 2 comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-company.ts Updates the company icon SVG with a new design
src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-dictionary.json Adds empty custom array and updates all icon file paths to include legacy/ prefix
src/Umbraco.Web.UI.Client/devops/icons/index.js Adds custom SVG directory support and updates glob patterns to match new folder structure

Comment on lines +148 to +150
} catch {
errors.push(`[Custom] Could not load file: '${path}'`);
console.log(`[Custom] Could not load file: '${path}'`);
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The catch block silently swallows errors without logging the actual error details. Consider capturing and logging the error parameter (e.g., catch (error)) to aid in debugging file loading issues.

Copilot uses AI. Check for mistakes.
if (fileJSON['custom']) {
fileJSON['custom'].forEach((iconDef) => {
if (iconDef.file && iconDef.name) {
const path = customSvgDirectory + '/' + iconDef.file;
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Use path joining utility instead of string concatenation. Consider using Node.js path.join() for more robust cross-platform path handling.

Suggested change
const path = customSvgDirectory + '/' + iconDef.file;
const path = path.join(customSvgDirectory, iconDef.file);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/no-notes Not directly part of the release (updating README, build scripts, tests, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants