Skip to content

include special icons for the monaco flyout#11251

Merged
srietkerk merged 5 commits intomasterfrom
srietkerk/serial-icon
Apr 9, 2026
Merged

include special icons for the monaco flyout#11251
srietkerk merged 5 commits intomasterfrom
srietkerk/serial-icon

Conversation

@srietkerk
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for “brand” (special/font) icons in the Monaco flyout heading so that category icons render with the correct icon font, aligning Monaco flyout visuals with the Blockly toolbox behavior.

Changes:

  • Introduces a brandIcons lookup in monacoFlyout.tsx to detect brand-font glyphs.
  • Applies a conditional brandIcon CSS class to the Monaco flyout heading icon when the icon is a brand glyph.

Comment thread webapp/src/monacoFlyout.tsx Outdated
Comment thread webapp/src/monacoFlyout.tsx
Comment thread webapp/src/monacoFlyout.tsx Outdated
const { name, ns, color, icon, groups, selectedBlock } = this.state;
const rgb = pxt.toolbox.getAccessibleBackground(pxt.toolbox.convertColor(color || (ns && pxt.toolbox.getNamespaceColor(ns)) || "255"));
const iconClass = `blocklyTreeIcon${icon ? (ns || icon).toLowerCase() : "Default"}`.replace(/\s/g, "");
const isBrandIcon = icon && icon in brandIcons;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

teeny but in has some weird semantics / typically lean towards avoiding in favor of .hasOwnProperty. Almost certainly shouldn't impact anything in this case so feel free to ignore if don't feel like it~

Image

@srietkerk srietkerk merged commit 1c7b2c7 into master Apr 9, 2026
20 checks passed
@srietkerk srietkerk deleted the srietkerk/serial-icon branch April 9, 2026 17:35
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.

Serial icon missing in Python/JavaScript editor

3 participants