Skip to content

fix: bundle codicon font in Java Help Center webview#1658

Merged
chagong merged 1 commit into
microsoft:mainfrom
chagong:fix/help-center-codicons-1390
Jun 9, 2026
Merged

fix: bundle codicon font in Java Help Center webview#1658
chagong merged 1 commit into
microsoft:mainfrom
chagong:fix/help-center-codicons-1390

Conversation

@chagong

@chagong chagong commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #1390

In the Java Help Center (the welcome webview), some icons render as empty boxes/blanks on Linux. The affected icons are the codicon glyphs used in the navigation tabs and links:

  • NavigationPanel.tsxcodicon-gear, codicon-globe, codicon-mortar-board, codicon-rocket
  • SocialMediaPanel.tsxcodicon-book, codicon-github-inverted

The image-based icons (logo, tour screenshots, done checkmark) render fine because they are inlined as base64 by webpack.

Root cause

The welcome page stylesheet (src/welcome/assets/style.scss) only styles .codicon (size/margins) but never imports the codicon font CSS. It silently relied on the codicon font that VS Code auto-injects into webviews, which is not reliably present across platforms — so on Linux the glyphs fail to resolve.

Every other icon-using webview in this repo imports the font explicitly (e.g. project-settings, java-runtime, install-jdk, beginner-tips), so the welcome page was the lone exception.

Fix

Import @vscode/codicons/dist/codicon.css in the welcome stylesheet. The webpack config already inlines .ttf fonts as asset/inline, so the font is embedded directly into the bundle and works consistently on Linux, Windows, and macOS — independent of VS Code's injected font. The webview CSP already permits font-src ... data:.

@import "../../assets/vscode.scss";
@import "../../../node_modules/@vscode/codicons/dist/codicon.css";

Verification

  • webpack --config-name assets builds with no errors.
  • The output out/assets/welcome/index.js now contains an @font-face { font-family: "codicon"; ... format("truetype") } declaration with the font inlined as a base64 font/ttf data URL.

The welcome (Java Help Center) webview used codicon glyphs but never imported the codicon font CSS, relying on VS Code's auto-injected font. That font is not reliably available across platforms, so the icons rendered as empty boxes on Linux. Import @vscode/codicons so the font is inlined into the bundle, matching the other webviews in this repo.

Fixes microsoft#1390

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 pull request fixes missing Codicon glyphs in the Java Help Center (“welcome”) webview—particularly on Linux—by explicitly bundling the Codicon font CSS into the welcome page’s stylesheet instead of relying on VS Code’s implicit webview font injection.

Changes:

  • Import @vscode/codicons/dist/codicon.css from the welcome webview SCSS so the Codicon @font-face is included in the bundle.
  • Ensure the Codicon font is inlined via the existing webpack asset/inline font rule, making icon rendering consistent across platforms.

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

@chagong chagong merged commit cb06bcc into microsoft:main Jun 9, 2026
53 checks passed
@chagong chagong deleted the fix/help-center-codicons-1390 branch June 9, 2026 05:41
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.

Some icons in java help center can't be shown correctly with linux os

3 participants