Skip to content

Scale panel fonts with VS's Environment Font size - #21

Open
DaveTseng2019 wants to merge 1 commit into
firish:mainfrom
DaveTseng2019:main
Open

Scale panel fonts with VS's Environment Font size#21
DaveTseng2019 wants to merge 1 commit into
firish:mainfrom
DaveTseng2019:main

Conversation

@DaveTseng2019

@DaveTseng2019 DaveTseng2019 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Panel and compose-dialog text now binds to VS's Environment Font size (VsFonts.EnvironmentFontSizeKey) instead of hardcoded point values, so it tracks Tools > Options > Environment > Fonts and Colors live.
  • Adds FontScale (BindRoot for the panel root, Bind for descendants at a relative ratio) used throughout ClaudeToolWindowControl and ComposeDialog.

Test plan

  • Open the Claude Code panel at VS's default Environment Font size (10pt) and confirm the size hierarchy still reads correctly: header title ("Claude Code") largest, status/edits/debug/latest/session/pending lines mid-size, endpoint line and activity feed entries smallest/caption-sized, "ACTIVITY" section label smallest+bold
  • Open the Compose dialog from the panel and confirm its text sizes look consistent with the panel (no orphaned hardcoded sizes left over)
  • Change Tools > Options > Environment > Fonts and Colors > Environment Font size (e.g. 10pt -> 14pt) while the panel is open and confirm every text element above rescales live, in proportion, without truncation/clipping or layout breakage
  • Repeat the font-size change with the Compose dialog open to confirm it also rescales live
  • Spot-check the monospace activity-feed text specifically, since it uses a different FontFamily than the rest of the panel — confirm it still scales with the same ratio and doesn't fall out of alignment with neighboring text

🤖 Generated with Claude Code

Replace hardcoded FontSize values in the panel and compose dialog with
bindings relative to VsFonts.EnvironmentFontSizeKey, so text follows the
user's Tools > Options > Environment > Fonts and Colors setting live
instead of staying fixed regardless of DPI/accessibility preferences.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 6, 2026 06:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the extension’s WPF UI (the Claude panel and compose dialog) to scale text with Visual Studio’s Environment Font size (VsFonts.EnvironmentFontSizeKey) instead of using hardcoded font point values, so the UI tracks Tools > Options > Environment > Fonts and Colors live.

Changes:

  • Added FontScale helper to bind a root element’s FontSize to VS’s environment font size, and scale descendants by ratio.
  • Updated ClaudeToolWindowControl to use FontScale for headers, status lines, cards, feed, attachment chips, and buttons.
  • Updated ComposeDialog to bind its root font size and scale the token estimate line relative to the root.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/ClaudeCodeVS/Ui/FontScale.cs Introduces BindRoot (VS env font binding) and Bind (ratio scaling via ancestor binding) for code-built WPF UI.
src/ClaudeCodeVS/Ui/ComposeDialog.cs Binds dialog font size to VS environment font and applies relative scaling for the estimate text.
src/ClaudeCodeVS/Ui/ClaudeToolWindowControl.cs Replaces hardcoded FontSize usage with ratio-based scaling across panel UI elements (including buttons and log/feed lines).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DaveTseng2019

Copy link
Copy Markdown
Author

@firish 這個 PR 有空的話麻煩看一下,謝謝!

@firish

firish commented Aug 7, 2026

Copy link
Copy Markdown
Owner

@DaveTseng2019 Thanks for the PR. I'm traveling over the next few days, but will review, test, and merge as soon as I am back.

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.

3 participants