Icons: developer icon manager#22437
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an icon “manager” dev UI and expands the icon registry metadata + search capabilities in the backoffice client, including a new Levenshtein-based fuzzy matching utility.
Changes:
- Extend icon definitions with
keywords,groups, andrelatedmetadata and propagate it through icon generation. - Add Levenshtein distance/similarity utilities and use them for improved fuzzy search in the icon picker modal (with debounced input handling).
- Add a Vite-driven dev-only “Icon Dictionary Manager” UI under
devops/icon-manager.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/vite.config.ts | Adds an additional HTML entry for the icon manager page to Vite build inputs. |
| src/Umbraco.Web.UI.Client/src/packages/core/utils/string/levenshtein/levenshtein.function.ts | Implements Levenshtein distance + normalized similarity helpers. |
| src/Umbraco.Web.UI.Client/src/packages/core/utils/string/levenshtein/levenshtein.function.test.ts | Unit tests for Levenshtein distance/similarity behavior. |
| src/Umbraco.Web.UI.Client/src/packages/core/utils/string/levenshtein/index.ts | Barrel export for the Levenshtein utilities. |
| src/Umbraco.Web.UI.Client/src/packages/core/utils/string/index.ts | Exposes Levenshtein utilities via the string utils barrel. |
| src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/types.ts | Extends UmbIconDefinition with optional keywords, groups, related. |
| src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts | Populates icon metadata (keywords/groups/related) for many icon definitions. |
| src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-search.function.ts | New icon search/scoring implementation (substring + fuzzy + related results). |
| src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-search.function.test.ts | Tests for icon search ranking, fuzzy matching, and related-icon inclusion. |
| src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.ts | Switches icon filtering to searchIcons() and debounces search input. |
| src/Umbraco.Web.UI.Client/package.json | Adds dev:icon-manager script to launch the icon manager page. |
| src/Umbraco.Web.UI.Client/devops/icons/todo_implement_this_data_thesaurus.json | Removes the previously staged thesaurus JSON file. |
| src/Umbraco.Web.UI.Client/devops/icons/index.js | Ensures generated icon JS includes keywords/groups/related metadata. |
| src/Umbraco.Web.UI.Client/devops/icon-manager/types.ts | Adds types for the icon manager UI (dictionary entries, managed icon model). |
| src/Umbraco.Web.UI.Client/devops/icon-manager/svg-utils.ts | Adds helper to convert Lucide icon node JSON into SVG markup. |
| src/Umbraco.Web.UI.Client/devops/icon-manager/icon-related-input.element.ts | UI component for editing an icon’s related icons list. |
| src/Umbraco.Web.UI.Client/devops/icon-manager/icon-manager.html | Adds the standalone HTML entrypoint for the icon manager UI. |
| src/Umbraco.Web.UI.Client/devops/icon-manager/icon-manager-app.element.ts | Implements the main icon manager app (picked/unpicked lists, editor, export). |
| src/Umbraco.Web.UI.Client/devops/icon-manager/icon-editor.element.ts | Implements icon metadata editor (name/keywords/groups/related/flags). |
| src/Umbraco.Web.UI.Client/devops/icon-manager/icon-card.element.ts | Implements icon grid card UI for browsing/picking icons. |
PR ReviewTarget: Adds a developer icon-manager tool for curating the icon dictionary, enriches ~800 icons with keywords/groups/related metadata, upgrades the icon-picker-modal search to a scored fuzzy-matching algorithm (Levenshtein), and promotes
Important
Suggestions
Approved with Suggestions for improvementThis is a well-structured feature addition with solid test coverage (Levenshtein unit tests + searchIcons integration tests) and a clean design. The main item to address before merging is the vite.config.ts entry that puts the devops tool into the production build. The rest are optional quality suggestions. Nice work! |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.ts # src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts # src/Umbraco.Web.UI.Client/src/packages/core/utils/string/fuzzy/fuzzy.function.ts
Merge this PR first: #22436
Vibe coded interface to manage icons
run it by typing
npm run dev:icon-managerMake changes in the UI, at last download the new JSON and replace it in the project, to make a PR with the changes.