claude-code - 💡(How to fix) Fix Claude Code extension webview renders poorly in code-server (browser-based VS Code) [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51970Fetched 2026-04-23 07:40:03
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2closed ×1
RAW_BUFFERClick to expand / collapse

Environment

  • code-server: 4.116.0 (Code 1.116.0)
  • Claude Code extension: 2.1.114
  • Comparison: VS Code desktop (native) on the same machine renders the extension perfectly

Problem

The Claude Code extension's webview panel renders poorly when accessed through code-server (browser-based VS Code). Specific issues:

  • Oversized icons: The magnifying glass and other icons render at a disproportionately large size, dominating the panel
  • Tiny buttons: Action buttons are very small and difficult to click, especially on touch devices
  • Cramped layout: The overall layout feels squeezed, with poor use of available space
  • Mobile browsers: The experience is especially bad on mobile — touch targets are far too small to reliably tap

The same extension version renders correctly in the native VS Code desktop app, so the issue appears specific to the code-server/browser environment.

Likely Cause

The webview CSS relies on VS Code CSS variables (e.g., --vscode-*) which code-server may not fully populate or may map to different values. Additionally, there doesn't appear to be any responsive CSS handling for smaller viewports or non-standard DPI scaling that browsers introduce.

Suggestion

  • Test the extension webview in code-server (and potentially other browser-based VS Code environments like vscode.dev or GitHub Codespaces)
  • Add responsive CSS with appropriate media queries for smaller viewports
  • Ensure touch targets meet minimum sizing (48x48px per WCAG guidelines) for mobile/tablet use
  • Avoid hard assumptions about icon/font sizing that may not hold outside the native Electron shell

extent analysis

TL;DR

Update the extension's webview CSS to include responsive design elements and ensure compatibility with code-server's rendering of VS Code CSS variables.

Guidance

  • Review the webview CSS to identify hardcoded values that may not be compatible with code-server, and replace them with relative values or media queries.
  • Test the extension in various browser-based VS Code environments, including code-server, vscode.dev, and GitHub Codespaces, to ensure consistent rendering.
  • Implement responsive CSS using media queries to handle smaller viewports and non-standard DPI scaling.
  • Verify that touch targets meet the minimum sizing requirement of 48x48px as per WCAG guidelines for improved mobile and tablet usability.

Example

/* Example media query for smaller viewports */
@media only screen and (max-width: 768px) {
  /* Adjust icon and button sizes for smaller screens */
  .icon {
    font-size: 16px;
  }
  .button {
    min-width: 48px;
    min-height: 48px;
  }
}

Notes

The provided solution focuses on updating the CSS to improve compatibility and responsiveness. However, the root cause may also involve differences in how code-server populates VS Code CSS variables, which may require additional investigation.

Recommendation

Apply the suggested workaround by updating the extension's webview CSS to include responsive design elements, as this is likely to improve the rendering issues in code-server and other browser-based VS Code environments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING