Skip to content

feat: provide consistent icons for frontend usage - #66224

Draft
susnux wants to merge 3 commits into
masterfrom
feat/core-icons
Draft

susnux wants to merge 3 commits into
masterfrom
feat/core-icons

Conversation

@susnux

@susnux susnux commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Provide Nextcloud consistent icons.
This allows to reduce bundle size of every app as we now can use a cached sprite sheet of the 200-500 most used icons and load the remaining icons only if needed (nextcloud org uses ~230 icons in total currently).
Also in a follow up we could allow branding icons and those would be used directly with all apps.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Add a build script that turns an icon set sprite into static assets:
one file per icon under core/img/icons, a sprite with the most used
icons and a manifest with a content hash for cache busting.

The single icon files work as image source, CSS mask and as target of
an SVG `<use>` element. The sprite content is a placeholder until the
icon usage across apps has been analysed.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Add the public IIconManager to resolve icon names to URLs of the static
icon files, e.g. for APIs returning icons to clients.

Provide the icon URL template, the sprite URL and the list of sprite
icons as `core/icons` initial state, so the frontend can resolve icon
names without bundling any icon.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Copy the icon files of the package instead of splitting a full sprite,
keep previous icon names working by copying aliased icons and only
build the sprite and the manifest in server.

The package is not published yet, the devDependency is added once it
is available. Until then link it locally (npm link).

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@CarlSchwan

Copy link
Copy Markdown
Member

does this means a network request per icon?

@susnux

susnux commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

does this means a network request per icon?

Only if you want some rare icon.

There are two things:

  1. a sprite of most used icons (performance wise < 800 icons, in all Nextcloud apps we use ~300 so basically all used icons)
  2. individual icons

If a icon is in the sprite use that one, so basically everthing is using the cached sprite.
If you need an icon not in the sprite it causes 1 network request, but should never happen.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: consistent icon system across apps and server

3 participants