Skip to content

fix(menus): draw menu icons from the symbol sheet, not the dead CSS sprite - #203

Open
chrip wants to merge 1 commit into
mainfrom
fix/issue-313-menu-icons
Open

fix(menus): draw menu icons from the symbol sheet, not the dead CSS sprite#203
chrip wants to merge 1 commit into
mainfrom
fix/issue-313-menu-icons

Conversation

@chrip

@chrip chrip commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Every dropdown menu item that declares an icon showed an empty box, in all editors. Common.UI.Button was migrated to the SVG symbol sheet; Common.UI.MenuItem was not, and still emitted

<span class="menu-item-icon btn-...">

whose only paint came from apps//main/resources/less/sprites -- files that no longer exist, positioning PNGs the build no longer produces. The artwork was never missing: every symbol the menus ask for is already in the shipped icons.svg.

Common.UI.menuItemIconMarkup() now returns the same that Button prints, and every menu template calls it. uni-scale is what tells bigscaling.less the svg is valid at any device pixel ratio.

A class that is not a sprite name still gets a span, because some of them are not icons at all -- ColorButton's "Automatic" swatch and the border-colour pickers use it as a coloured block.

Six templates outside MenuItem hardcoded the same span and are switched over too: the editing-mode menu in Header, the thumbnail-size sliders in Writer and the PDF editor, and the form zoom items in FormsTab and FormSettings.

setIconCls looked for use.zoom-int, the class applyScaling gives the svg it injects at ratio > 2. The template's own carries no class, so it now matches either.

#file-menu-panel hid svg.menu-item-icon and showed the span, which was right when the span was the icon and is backwards now.

Measured in Writer at devicePixelRatio 1, before -> after: 92 empty spans -> 92 rendered svgs, 3 spans left (the colour swatches). Verified in Writer, Spreadsheet and Presentation: context menus, the File menu, the editing-mode menu and the colour menus.

Fixes Euro-Office/DocumentServer#313

Assisted-by: ClaudeCode:claude-opus-5

…prite

Every dropdown menu item that declares an icon showed an empty box, in
all editors. Common.UI.Button was migrated to the SVG symbol sheet;
Common.UI.MenuItem was not, and still emitted

    <span class="menu-item-icon btn-...">

whose only paint came from apps/<editor>/main/resources/less/sprites --
files that no longer exist, positioning PNGs the build no longer
produces. The artwork was never missing: every symbol the menus ask for
is already in the shipped icons.svg.

Common.UI.menuItemIconMarkup() now returns the same
<svg class="menu-item-icon uni-scale"><use href="#btn-..."></svg> that
Button prints, and every menu template calls it. uni-scale is what tells
bigscaling.less the svg is valid at any device pixel ratio.

A class that is not a sprite name still gets a span, because some of
them are not icons at all -- ColorButton's "Automatic" swatch and the
border-colour pickers use it as a coloured block.

Six templates outside MenuItem hardcoded the same span and are switched
over too: the editing-mode menu in Header, the thumbnail-size sliders in
Writer and the PDF editor, and the form zoom items in FormsTab and
FormSettings.

setIconCls looked for `use.zoom-int`, the class applyScaling gives the
svg it injects at ratio > 2. The template's own <use> carries no class,
so it now matches either.

#file-menu-panel hid svg.menu-item-icon and showed the span, which was
right when the span was the icon and is backwards now.

Measured in Writer at devicePixelRatio 1, before -> after:
92 empty spans -> 92 rendered svgs, 3 spans left (the colour swatches).
Verified in Writer, Spreadsheet and Presentation: context menus, the
File menu, the editing-mode menu and the colour menus.

Fixes Euro-Office/DocumentServer#313

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
@chrip
chrip requested a review from a team as a code owner August 18, 2026 15:06
@chrip
chrip requested review from a user and moodyjmz and removed request for a team August 18, 2026 15:06
@chrip
chrip requested review from MonaAghili and j-base64 August 31, 2026 07:29
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.

Dropdown menu items still render icons the old way — every menu icon is blank (all editors)

1 participant