Skip to content

fix(ui): include vuetify radiobox icons#6892

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

fix(ui): include vuetify radiobox icons#6892
Soulter merged 1 commit intoAstrBotDevs:masterfrom
RC-CHN:master

Conversation

@RC-CHN
Copy link
Member

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

Add the radiobox icons used indirectly by Vuetify internals to the required MDI subset so they are kept during font generation.

Regenerate the subset CSS and font files to prevent missing radio button icons at runtime.

fix of #6882 & #6881

Modifications / 改动点

问题由 #6532 引入,该PR为了优化前端资源体积,将MDI图标字体从387KB削减至12.7KB,但字体子集化脚本遗漏了Vuetify Radio组件的默认图标:mdi-radiobox-marked 和 mdi-radiobox-blank。

在 dashboard/scripts/subset-mdi-font.mjs 中手动添加这两个图标到必需图标列表,然后重新构建,即可解决该问题

  • 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

Bug Fixes:

  • Fix missing Vuetify radio button icons by including mdi-radiobox-blank and mdi-radiobox-marked in the MDI subset and regenerated assets.

Add the radiobox icons used indirectly by Vuetify internals
to the required MDI subset so they are kept during font
generation.

Regenerate the subset CSS and font files to prevent missing
radio button icons at runtime.
@auto-assign auto-assign bot requested review from LIghtJUNction and Soulter March 24, 2026 08:04
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 24, 2026
@gemini-code-assist
Copy link
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 a user interface bug where Vuetify radio button icons were not rendering correctly. The problem stemmed from an optimization introduced in a previous PR that aggressively subsetted the Material Design Icons (MDI) font, inadvertently excluding icons used by Vuetify's internal components. The fix involves updating the font subsetting script to explicitly include these essential radiobox icons and regenerating the necessary CSS and font files, thereby restoring the intended visual appearance of radio buttons.

Highlights

  • Missing Vuetify Radiobox Icons Fixed: Resolved an issue where mdi-radiobox-marked and mdi-radiobox-blank icons were missing from the MDI font subset, leading to incorrect display of Vuetify radio buttons.
  • MDI Font Subsetting Script Updated: Modified the subset-mdi-font.mjs script to explicitly include mdi-radiobox-blank and mdi-radiobox-marked in the set of required icons, ensuring they are always part of the generated font subset.
  • Regenerated MDI Subset Files: Updated materialdesignicons-subset.css and the corresponding font files to reflect the inclusion of the previously missing radiobox icons, increasing the icon count from 235 to 237.
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 lgtm This PR has been approved by a maintainer label Mar 24, 2026
@Soulter Soulter merged commit 364b620 into AstrBotDevs:master Mar 24, 2026
6 checks passed
@dosubot dosubot bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Mar 24, 2026
Copy link
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 reviewed your changes and they look great!


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
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 addresses an issue with missing radio button icons by explicitly including mdi-radiobox-blank and mdi-radiobox-marked in the MDI font subset. The approach of adding a REQUIRED_ICONS set in subset-mdi-font.mjs and initializing the usedIcons with it is a clean and effective solution. However, this change alters the behavior of the scanUsedIcons function, which now causes existing unit tests to fail. It's important to update the tests to reflect this new behavior to maintain the integrity of the test suite. I've left a specific comment regarding the necessary test updates.

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.

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. lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants