fix(menus): draw menu icons from the symbol sheet, not the dead CSS sprite - #203
Open
chrip wants to merge 1 commit into
Open
fix(menus): draw menu icons from the symbol sheet, not the dead CSS sprite#203chrip wants to merge 1 commit into
chrip wants to merge 1 commit into
Conversation
…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
requested review from
a user and
moodyjmz
and removed request for
a team
August 18, 2026 15:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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