Skip to content

fix(dashboard): include missing vuetify mdi icons#6970

Merged
RC-CHN merged 1 commit intoAstrBotDevs:masterfrom
RC-CHN:master
Mar 26, 2026
Merged

fix(dashboard): include missing vuetify mdi icons#6970
RC-CHN merged 1 commit intoAstrBotDevs:masterfrom
RC-CHN:master

Conversation

@RC-CHN
Copy link
Copy Markdown
Member

@RC-CHN RC-CHN commented Mar 26, 2026

Export the required icon set and expand it with icons used by Vuetify internals that are not detected by static source scans.

Regenerate the MDI subset assets and update tests to assert that all required icons are always included and deduplicated.

Modifications / 改动点

在dashboard/scripts/subset-mdi-font.mjs中导入vuetify隐式依赖的icon以解决图标缺失问题

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

image

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Ensure the dashboard MDI icon subset always includes Vuetify’s implicit icon dependencies and remains deduplicated.

Bug Fixes:

  • Include Vuetify’s internally used MDI icons in the generated subset to prevent missing icons in the dashboard UI.

Enhancements:

  • Export the set of required Vuetify icons and use it in tests to guarantee all required icons are present without duplication.
  • Regenerate the MDI subset CSS to add the newly required icons and reflect the expanded icon set.

Tests:

  • Strengthen subset generation tests to assert that all required icons are always included, even when not referenced in source files, and that duplicates are removed.

Export the required icon set and expand it with icons used by
Vuetify internals that are not detected by static source scans.

Regenerate the MDI subset assets and update tests to assert that
all required icons are always included and deduplicated.
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 26, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves the issue of missing Material Design Icons (MDI) in the dashboard by explicitly defining and including a broader range of icons that Vuetify internally relies upon. This ensures a complete and consistent visual experience across the application, preventing UI glitches caused by absent icons.

Highlights

  • Expanded Required Icons: Significantly increased the list of "REQUIRED_ICONS" in "subset-mdi-font.mjs" to include a comprehensive set of icons implicitly used by Vuetify internals, which were previously not detected by static scans.
  • Regenerated MDI Subset: Updated the "materialdesignicons-subset.css" file to incorporate the newly added icons, resolving previously missing icon issues in the dashboard.
  • Enhanced Icon Subset Tests: Modified the "subsetMdiFont.test.mjs" to import the "REQUIRED_ICONS" set and assert that all necessary icons are always included and correctly deduplicated in the generated subset.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot Bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Mar 26, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The REQUIRED_ICONS set is getting fairly large; consider grouping it into semantically named subsets (e.g. pagination, alerts, selection controls) or adding brief comments per block so future maintainers can see why each group of icons is required by Vuetify internals.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `REQUIRED_ICONS` set is getting fairly large; consider grouping it into semantically named subsets (e.g. pagination, alerts, selection controls) or adding brief comments per block so future maintainers can see why each group of icons is required by Vuetify internals.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request expands the set of required Material Design Icons (MDI) by adding numerous new icons to dashboard/scripts/subset-mdi-font.mjs and updating the corresponding CSS. The REQUIRED_ICONS variable is now exported, and the test suite dashboard/tests/subsetMdiFont.test.mjs has been refactored to use this exported set for more comprehensive and maintainable icon scanning and deduplication tests. Feedback suggests sorting the REQUIRED_ICONS list for better maintainability and simplifying several test assertions for conciseness and robustness.

Comment on lines 38 to +72
"mdi-radiobox-blank",
"mdi-radiobox-marked",
"mdi-menu-down",
"mdi-menu-right",
"mdi-check-circle",
"mdi-information",
"mdi-alert-circle",
"mdi-close-circle",
"mdi-chevron-down",
"mdi-chevron-up",
"mdi-chevron-left",
"mdi-chevron-right",
"mdi-check",
"mdi-close",
"mdi-checkbox-marked",
"mdi-checkbox-blank-outline",
"mdi-minus-box",
"mdi-circle",
"mdi-arrow-up",
"mdi-arrow-down",
"mdi-menu",
"mdi-pencil",
"mdi-star-outline",
"mdi-star",
"mdi-star-half-full",
"mdi-cached",
"mdi-page-first",
"mdi-page-last",
"mdi-unfold-more-horizontal",
"mdi-paperclip",
"mdi-plus",
"mdi-minus",
"mdi-calendar",
"mdi-eyedropper",
"mdi-cloud-upload",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For improved maintainability, it's good practice to keep long lists like this sorted. Please sort the icons in REQUIRED_ICONS alphabetically. This makes it much easier to check for duplicates or find a specific icon in the future.

    "mdi-alert-circle",
    "mdi-arrow-down",
    "mdi-arrow-up",
    "mdi-cached",
    "mdi-calendar",
    "mdi-check",
    "mdi-check-circle",
    "mdi-checkbox-blank-outline",
    "mdi-checkbox-marked",
    "mdi-chevron-down",
    "mdi-chevron-left",
    "mdi-chevron-right",
    "mdi-chevron-up",
    "mdi-circle",
    "mdi-close",
    "mdi-close-circle",
    "mdi-cloud-upload",
    "mdi-eyedropper",
    "mdi-information",
    "mdi-menu",
    "mdi-menu-down",
    "mdi-menu-right",
    "mdi-minus",
    "mdi-minus-box",
    "mdi-page-first",
    "mdi-page-last",
    "mdi-paperclip",
    "mdi-pencil",
    "mdi-plus",
    "mdi-radiobox-blank",
    "mdi-radiobox-marked",
    "mdi-star",
    "mdi-star-half-full",
    "mdi-star-outline",
    "mdi-unfold-more-horizontal"

Comment on lines +87 to +89
for (const requiredIcon of REQUIRED_ICONS) {
assert.ok(icons.has(requiredIcon));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This loop is redundant. The assert.deepEqual(icons, expectedIcons) on line 91 already verifies that all required icons are present in the icons set. Removing this loop will make the test more concise without losing any coverage.

Comment on lines +114 to +117
for (const requiredIcon of REQUIRED_ICONS) {
assert.ok(icons.has(requiredIcon));
}
assert.equal(icons.size, REQUIRED_ICONS.size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

These assertions can be simplified. Instead of iterating through all required icons and then checking the size, you can use a single assert.deepEqual to compare the resulting icons set with the REQUIRED_ICONS set directly. This is more concise and robust, as it verifies both the content and size in one step.

  assert.deepEqual(icons, REQUIRED_ICONS);

Comment on lines 127 to 132
const icons = [...scanUsedIcons(collectFiles(tmp, ['.vue']))];
assert.equal(icons.filter(icon => icon === 'mdi-radiobox-marked').length, 1);
assert.ok(icons.includes('mdi-radiobox-blank'));
assert.equal(icons.filter(icon => icon === requiredIcon).length, 1);
for (const builtInRequiredIcon of REQUIRED_ICONS) {
assert.ok(icons.includes(builtInRequiredIcon));
}
assert.ok(icons.includes('mdi-home'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This test's logic can be greatly simplified. Since scanUsedIcons returns a Set, which handles deduplication automatically, you don't need to convert it to an array and check for duplicates manually. A single assert.deepEqual against an expected Set is a much cleaner and more direct way to verify that all expected icons are present and correctly deduplicated.

  const icons = scanUsedIcons(collectFiles(tmp, ['.vue']));
  const expectedIcons = new Set([...REQUIRED_ICONS, 'mdi-home']);
  assert.deepEqual(icons, expectedIcons);

@RC-CHN RC-CHN merged commit c1fa05e into AstrBotDevs:master Mar 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant