Skip to content

feat: deprecate icon class APIs and add SVG alternatives - #67408

Draft
skjnldsv wants to merge 5 commits into
masterfrom
feature/deprecate-icon-class-apis
Draft

skjnldsv wants to merge 5 commits into
masterfrom
feature/deprecate-icon-class-apis

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Dec 2, 2026

Copy link
Copy Markdown
Member

Summary

The generated icon-* classes (dist/icons.css) still leak through a few public APIs. This deprecates them so we can drop the file later.

New: SimpleMenuAction::setIconSvgInline() for public page header actions, and typeIconSvg / getIconSvg() on OCP.Collaboration. Both render through NcIconSvgWrapper with currentColor, so the primary button doesn't need the invert filter for them. The public share page uses them already.

Deprecated with existing replacements: IWidget::getIconClass() (use IIconWidget::getIconUrl()), workflow iconClass (use icon), and icon classes in SearchResultEntry (pass a URL). Legacy dashboard panels now show iconUrl like API widgets do.

Nothing is removed. nc-vue's NcCollectionList still reads getIcon(), so files keeps registering its class for now.

TODO

  • Screenshots: public share header and dashboard panels, light and dark
  • Upgrade note in the developer manual (upgrade_to_36.rst)

Checklist

AI (if applicable)

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

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

SimpleMenuAction only took an icon CSS class, which needs the generated icons.css and an invert filter on the primary button. setIconSvgInline() takes SVG markup colored with currentColor. The icon class argument is deprecated.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
IIconWidget::getIconUrl() replaces it. Legacy panels now also show the icon URL when a widget provides one, like API widgets already do.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Adds typeIconSvg and OCP.Collaboration.getIconSvg(). typeIconClass and getIcon() are deprecated.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Workflow operation iconClass and icon classes in SearchResultEntry are deprecated in favor of icon URLs. TemplateFileCreator::setIconClass() now points to setIconSvgInline().

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Dec 2, 2026
@skjnldsv skjnldsv self-assigned this Dec 2, 2026
@skjnldsv skjnldsv added the pending documentation This pull request needs an associated documentation update label Dec 2, 2026

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

Labels

2. developing Work in progress AI assisted enhancement feature: dashboard pending documentation This pull request needs an associated documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant