Skip to content

Studio: lighten chat text weight on Linux to match macOS rendering - #7308

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
oobabooga:worktree-linux-font-weight
Jul 22, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
oobabooga:worktree-linux-font-weight

Conversation

@oobabooga

@oobabooga oobabooga commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

Studio's default Inter chat text renders heavier on Linux than the same build on macOS. The global -webkit-font-smoothing: antialiased only affects macOS rendering, so using weight 410 on both platforms does not produce the same visual weight.

Fix

Render assistant and user message text at weight 350 on desktop Linux. Detection uses the browser user agent because the backend may run on a different OS. Android is unchanged.

Font smoothing off, custom chat fonts, and custom interface fonts keep weight 410. The adjustment is specific to the default Inter font.

Weight 350 was selected by testing values from 300 through 410. It noticeably reduces the difference without making text look washed out.

Comparison

Same content and app CSS, rendered through the real code path.

macOS reference (weight 410):
1-macos-reference-w410

Linux before (weight 410):
2-linux-before-w410

Linux after (weight 350):
3-linux-after-w350

Verification

  • Production frontend build passes (tsc + vite).
  • Playwright against the compiled CSS confirms computed weight 350 on desktop Linux and 410 for every opt-out (smoothing off, custom chat font, custom interface font) and non-Linux clients.
  • Selecting a custom interface font through Appearance keeps chat at 410; resetting it returns chat to 350.
  • Rendered the same content through the real code path on Linux (FreeType) and a macOS machine (CoreText). By integrated ink, Linux text goes from +4.6% heavier than the macOS reference to +0.3%. Measured at 1x, where the gap is largest.

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

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.

Code Review

This pull request introduces desktop Linux detection to adjust font rendering. Specifically, it adds a render-linux class to the document element when desktop Linux is detected, and uses this class in CSS to adjust the font weight of chat messages to match macOS rendering. It also toggles a data-ui-font attribute on the document when a custom UI font is set. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@danielhanchen
danielhanchen merged commit 36ec2cc into unslothai:main Jul 22, 2026
36 checks passed
Souravrajvi0 added a commit to Souravrajvi0/unsloth that referenced this pull request Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants