Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dashboard/scripts/subset-mdi-font.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const UTILITY_CLASSES = new Set([
"mdi-18px", "mdi-24px", "mdi-36px", "mdi-48px",
]);

// Icons used indirectly by Vuetify internals, so they won't appear in src/ static scans.
const REQUIRED_ICONS = new Set([
"mdi-radiobox-blank",
"mdi-radiobox-marked",
]);

// Regex to match individual icon class definitions in MDI CSS
export const ICON_CLASS_PATTERN = /\.(mdi-[a-z][a-z0-9-]*)::before\s*\{\s*content:\s*"\\([0-9A-Fa-f]+)"\s*;?\s*}/g;

Expand All @@ -53,7 +59,7 @@ export function* collectFiles(dir, exts) {
/** Scan source files and return a Set of used mdi-* icon names. */
export function scanUsedIcons(sourceFiles) {
const iconPattern = /mdi-[a-z][a-z0-9-]*/g;
const usedIcons = new Set();
const usedIcons = new Set(REQUIRED_ICONS);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change correctly initializes the usedIcons set with the required icons. However, it alters the behavior of scanUsedIcons, which will now always include the icons from REQUIRED_ICONS in its result. This breaks existing unit tests for this function in dashboard/tests/subsetMdiFont.test.mjs that assert the size of the returned set (e.g., expecting an empty set when no icons are found in files). Please update the relevant tests to account for this new behavior to ensure the test suite remains accurate and passes.

for (const file of sourceFiles) {
const content = readFileSync(file, "utf-8");
for (const match of content.matchAll(iconPattern)) {
Expand Down
10 changes: 9 additions & 1 deletion dashboard/src/assets/mdi-subset/materialdesignicons-subset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Auto-generated MDI subset – 235 icons */
/* Auto-generated MDI subset – 237 icons */
/* Do not edit manually. Run: pnpm run subset-icons */

@font-face {
Expand Down Expand Up @@ -744,6 +744,14 @@
content: "\F0432";
}

.mdi-radiobox-blank::before {
content: "\F043D";
}

.mdi-radiobox-marked::before {
content: "\F043E";
}

.mdi-refresh::before {
content: "\F0450";
}
Expand Down
Binary file not shown.
Binary file not shown.
Loading