Skip to content

fix(webui): add Noto Sans to global font-family stack for Cyrillic text#8205

Merged
Soulter merged 1 commit into
AstrBotDevs:masterfrom
Midwich:master
May 16, 2026
Merged

fix(webui): add Noto Sans to global font-family stack for Cyrillic text#8205
Soulter merged 1 commit into
AstrBotDevs:masterfrom
Midwich:master

Conversation

@Midwich
Copy link
Copy Markdown
Contributor

@Midwich Midwich commented May 16, 2026

PR #8015 added 'Noto Sans' to the Google Fonts link and CJK fallback list, but the font was placed at the end of $cjk-sans-fallback where browsers never reach it for Cyrillic text. The global $body-font-family also lacked 'Outfit' entirely, causing Vuetify to use CJK fonts as the primary face.

Changes:

  • Remove 'Noto Sans' from the end of $cjk-sans-fallback (it is not a CJK font)
  • Add 'Outfit' and 'Noto Sans' to $body-font-family before CJK fallbacks
  • Update .Outfit class in _container.scss to match the new stack

This ensures:

  • Latin text → Outfit
  • Cyrillic text → Noto Sans (loaded by vite-plugin-webfont-dl)
  • CJK text → Noto Sans SC / PingFang SC etc.

Fixes follow-up to #8015.

Modifications / 改动点

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

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

Verified via browser DevTools → Network → Fonts: Noto Sans is now loaded alongside Outfit and Noto Sans SC. Cyrillic text renders correctly with Noto Sans glyphs.


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

Adjust global font-family stacks so Latin text uses Outfit, Cyrillic text uses Noto Sans, and CJK text continues to use appropriate CJK fonts.

Bug Fixes:

  • Ensure Cyrillic text renders with Noto Sans instead of falling back to CJK fonts.

Enhancements:

  • Set Outfit and Noto Sans as primary fonts in the global body font stack and align the .Outfit utility class with the new stack.

@auto-assign auto-assign Bot requested review from Fridemn and advent259141 May 16, 2026 08:15
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels May 16, 2026
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 updates the font configuration by adding 'Outfit' and 'Noto Sans' to the global font stack and refining the CJK fallback list. A review comment suggests replacing a hardcoded font stack in the container layout with the newly defined $body-font-family variable to ensure consistency and reduce duplication.

body {
.Outfit {
font-family: 'Outfit', $cjk-sans-fallback, sans-serif !important;
font-family: 'Outfit', 'Noto Sans', $cjk-sans-fallback, sans-serif !important;
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

To improve maintainability and ensure consistency across the application, use the $body-font-family variable instead of hardcoding the font stack again. Since the stack defined here is now identical to the global default, referencing the variable prevents future discrepancies if the font stack is updated in _variables.scss.

    font-family: $body-font-family !important;
References
  1. Avoid code duplication by refactoring shared logic or values into reusable variables or functions.

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 found 1 issue, and left some high level feedback:

  • In the .Outfit class you now duplicate the same font stack as $body-font-family; consider referencing $body-font-family (or a dedicated $outfit-font-family variable) to keep the stack defined in a single place and avoid future divergence.
  • Since Noto Sans is now part of the global $body-font-family, it may be worth scanning for any other hardcoded font-family declarations that still reference the old stack so they don’t accidentally bypass the updated fallback behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `.Outfit` class you now duplicate the same font stack as `$body-font-family`; consider referencing `$body-font-family` (or a dedicated `$outfit-font-family` variable) to keep the stack defined in a single place and avoid future divergence.
- Since `Noto Sans` is now part of the global `$body-font-family`, it may be worth scanning for any other hardcoded `font-family` declarations that still reference the old stack so they don’t accidentally bypass the updated fallback behavior.

## Individual Comments

### Comment 1
<location path="dashboard/src/scss/layout/_container.scss" line_range="83" />
<code_context>
 body {
   .Outfit {
-    font-family: 'Outfit', $cjk-sans-fallback, sans-serif !important;
+    font-family: 'Outfit', 'Noto Sans', $cjk-sans-fallback, sans-serif !important;
   }
 }
</code_context>
<issue_to_address>
**suggestion:** Reuse the `$body-font-family` variable here to keep font stacks consistent and easier to maintain.

This rule now hardcodes the same stack as `$body-font-family`. Using `font-family: $body-font-family !important;` here will keep `.Outfit` in sync with the global body font and avoid future divergence if the stack changes.
</issue_to_address>

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.

Comment thread dashboard/src/scss/layout/_container.scss Outdated
PR AstrBotDevs#8015 added 'Noto Sans' to the Google Fonts link and CJK fallback list,
but the font was placed at the end of $cjk-sans-fallback where browsers
never reach it for Cyrillic text. The global $body-font-family also lacked
'Outfit' entirely, causing Vuetify to use CJK fonts as the primary face.

Changes:
- Remove 'Noto Sans' from the end of $cjk-sans-fallback (it is not a CJK font)
- Add 'Outfit' and 'Noto Sans' to $body-font-family before CJK fallbacks
- Update .Outfit class in _container.scss to match the new stack

This ensures:
- Latin text → Outfit
- Cyrillic text → Noto Sans (loaded by vite-plugin-webfont-dl)
- CJK text → Noto Sans SC / PingFang SC etc.

Fixes follow-up to AstrBotDevs#8015.
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 16, 2026
@Soulter Soulter merged commit b3381c6 into AstrBotDevs:master May 16, 2026
21 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. lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants