Skip to content

Panel layout: scale fonts with VS's Environment Font, drop the duplicate title, wrap the toolbar - #25

Open
DaveTseng2019 wants to merge 2 commits into
firish:mainfrom
DaveTseng2019:fix/panel-layout
Open

Panel layout: scale fonts with VS's Environment Font, drop the duplicate title, wrap the toolbar#25
DaveTseng2019 wants to merge 2 commits into
firish:mainfrom
DaveTseng2019:fix/panel-layout

Conversation

@DaveTseng2019

Copy link
Copy Markdown

Re-submission of the panel-layout half of the now-closed #21 and #24, split out so each PR is one reviewable topic.

What

1. Fonts follow VS's Environment Font size (Ui/FontScale.cs)
The panel hard-coded pixel sizes, so it ignored Tools > Options > Environment > Fonts and Colors and stayed tiny (or huge) whenever the user had scaled the IDE. Every panel font is now derived from the shell's Environment Font, and ComposeDialog follows the same scale.

2. Duplicate panel title removed
The tool window frame already renders "Claude Code" in its tab; the control drew a second copy right below it. Removed the redundant one.

3. Toolbar wraps instead of clipping
The toolbar was a DockPanel with Clear/Output docked right, which pre-claims width and clipped the Launch buttons mid-text at narrow panel widths. It is now one flat WrapPanel - every button stays whole and reachable at any width. Right-alignment wasn't worth losing the buttons.

Notes

  • No behavior change outside the panel's own layout.
  • Release build clean; the remaining warnings are pre-existing and unrelated.
  • Verified in the Experimental hive at several panel widths and at a scaled Environment Font.

🤖 Generated with Claude Code

DaveTseng2019 and others added 2 commits August 8, 2026 11:13
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>
The tool window's own Caption already shows "Claude Code" in the tab, so
the panel's own header duplicated it. The Launch/External console buttons
also got clipped instead of wrapping when the panel was docked narrower
than they fit, unlike the checkbox row below them.

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

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 improves the Visual Studio tool window panel’s layout and typography so it integrates better with the host IDE’s look-and-feel. It introduces a small WPF helper that derives all panel font sizes from VS’s Environment Font size, removes redundant in-panel title rendering, and updates the toolbar layout so controls remain accessible at narrow widths.

Changes:

  • Added Ui/FontScale.cs to bind a panel root to VsFonts.EnvironmentFontSizeKey and scale descendant elements by ratio.
  • Updated ComposeDialog and ClaudeToolWindowControl to use FontScale instead of hardcoded FontSize values.
  • Removed the duplicate “Claude Code” header line and replaced the toolbar DockPanel with a WrapPanel to avoid button clipping.

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 New helper for binding UI font sizes to VS Environment Font size and scaling descendants proportionally.
src/ClaudeCodeVS/Ui/ComposeDialog.cs Binds dialog font sizing to VS Environment Font and replaces hardcoded font sizes with scaled ratios.
src/ClaudeCodeVS/Ui/ClaudeToolWindowControl.cs Removes redundant title, converts toolbar to wrapping layout, and replaces hardcoded font sizes with scaled ratios across the panel.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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