Skip to content

feat: support image icons for apps and extensions - #3580

Merged
dschmidt merged 16 commits into
mainfrom
feat/image-icons
Oct 8, 2026
Merged

dschmidt merged 16 commits into
mainfrom
feat/image-icons

Conversation

@dschmidt

@dschmidt dschmidt commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Apps and extensions can declare an icon as an object. This lets them ship their own image instead of picking a name from the icon set.

icon: 'brush'                                               // icon name, as before
icon: { name: 'brush', fillType: 'line', color: '#e2725b' } // named icon
icon: { src: iconUrl, srcDark: iconDarkUrl }                // image icon
  • A string is always the name of an icon.
  • OcIcon gets an icon prop next to name and renders image icons as <img>.
  • The fillType and color of a named icon take precedence over the props of OcIcon.
  • All three forms share the type Icon, which every icon prop and declaration accepts.
  • The sibling fields iconFillType, iconColor and fillType are deprecated but still work. For apps and their file extensions they are merged into the icon when the app is registered, so they apply wherever the icon is shown.
  • In OcApplicationIcon an image icon fills the tile. With a color it sits in icon size on the colored tile.
  • The icon of app provider apps (e.g. Collabora) is declared as image icon, which replaces the URL detection in ActionMenuItem.
  • OcIcon resolves dark variants by icon name, so the file type icon mapping holds plain icons. getResourceIconName, IconType and its hasDarkVariant, fillsBox and uniqueIds fields are deprecated.

Door: two-way for the rendering, one-way for the Icon type, which becomes public API for extensions.

Blast radius: every place that renders a declared icon. Icons declared as strings render as before. App provider icons now also show up as file type icon for types without a built-in icon.

Related Issue

  • None

How Has This Been Tested?

  • test environment: local dev setup with Collabora
  • test case 1: unit tests for OcIcon, OcApplicationIcon, ActionMenuItem, ResourceIcon, the file type icon mapping and the external app
  • test case 2: Collabora icon in the "Open with" menu and as file type icon in the file list (manual)
  • not tested yet: an image icon in the app switcher and srcDark in the browser

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

OcIcon accepts an icon next to an icon name. A named icon carries
name, fill type and color, an image icon carries a source and an
optional dark source and is rendered as an image. The runtime provides
the dark state of the current theme.
An image icon fills the tile. With a primary color it is displayed in
icon size on the colored tile instead.
Apps and extensions can declare their icons as named icon or image
icon next to the plain icon name. A string is always the name of an
icon. The sibling fill type and color fields are deprecated in favor
of the named icon. The file type icon mapping passes image icons on,
and the icon url of app provider apps is declared as image icon
instead of being detected when rendering the action.
The components that only pass an icon on to OcIcon accept named icons
and image icons as well: OcAvatarItem, OcSection, OcSearchBar,
OcFileInput, the items of OcFloatingActionButton and OcBreadcrumb,
PlainCard and NoContentMessage. Their sibling fill type and color
props are deprecated in favor of the named icon.
Whether an icon ships a dark variant is a property of the icon set and
not of the place that declares the icon. OcIcon looks it up by name,
so the file type icon mapping holds plain icons and no longer needs a
type of its own. ResourceIcon, the mail attachment item and the upload
button no longer resolve the dark variant themselves.
… apps

The apps store merges the deprecated iconFillType and iconColor of an
app and its file extensions into their icon once. The apps list in the
admin settings, the "Open with" actions and the file type icon mapping
only read the icon and no longer pass the deprecated fields on.

The deprecated fields now apply wherever the icon is shown, like the
fields of a named icon do.
The sidebar panels, actions and file extensions of the host no longer
use the deprecated iconFillType field. The fill type of the vault lock
actions was the default and is dropped.
…e extensions

A file extension with an icon of its own and no fill type fell back to
the deprecated iconFillType of its app in the "Open with" actions. The
apps store merges that fallback into the icon as well.
…file extensions

A fill type belongs to the icon it was declared with. The deprecated
iconFillType of an app applies to the icon of the app and is inherited
together with it, but is not mixed into an icon that a file extension
declares itself.

This reverts commit d3ef500.
…ared with

The deprecated iconFillType and iconColor of a file extension are only
merged into an icon that the file extension declares itself. A file
extension without an icon inherits the icon of its app as is.
Registering a file extension for an unknown app made the file type icon
mapping and the "Open with" actions fail when they looked up the app.
The sidebar nav shows the active item with a filled icon. A named icon
with a fill type of its own took precedence and stopped following the
active state, so the nav item sets the fill type on the icon itself.

@JammingBen JammingBen left a comment

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.

Please also prepare a PR in the docs repo that adjusts the web extension system docs accordingly.

@JammingBen JammingBen left a comment

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.

Great stuff, thanks! 👍

@dschmidt
dschmidt enabled auto-merge (squash) October 8, 2026 09:36
@dschmidt
dschmidt merged commit 4b6a4c0 into main Oct 8, 2026
31 checks passed
@dschmidt
dschmidt deleted the feat/image-icons branch October 8, 2026 09:47
@openclouders openclouders mentioned this pull request Oct 8, 2026
1 task
openclouders pushed a commit that referenced this pull request Oct 8, 2026
* feat(design-system): support image icons in OcIcon

OcIcon accepts an icon next to an icon name. A named icon carries
name, fill type and color, an image icon carries a source and an
optional dark source and is rendered as an image. The runtime provides
the dark state of the current theme.

* feat(design-system): support image icons in OcApplicationIcon

An image icon fills the tile. With a primary color it is displayed in
icon size on the colored tile instead.

* feat: accept image icons in app and extension declarations

Apps and extensions can declare their icons as named icon or image
icon next to the plain icon name. A string is always the name of an
icon. The sibling fill type and color fields are deprecated in favor
of the named icon. The file type icon mapping passes image icons on,
and the icon url of app provider apps is declared as image icon
instead of being detected when rendering the action.

* docs(design-system): document named icons and image icons

* feat: accept image icons in the remaining icon props

The components that only pass an icon on to OcIcon accept named icons
and image icons as well: OcAvatarItem, OcSection, OcSearchBar,
OcFileInput, the items of OcFloatingActionButton and OcBreadcrumb,
PlainCard and NoContentMessage. Their sibling fill type and color
props are deprecated in favor of the named icon.

* refactor: resolve dark icon variants by icon name in OcIcon

Whether an icon ships a dark variant is a property of the icon set and
not of the place that declares the icon. OcIcon looks it up by name,
so the file type icon mapping holds plain icons and no longer needs a
type of its own. ResourceIcon, the mail attachment item and the upload
button no longer resolve the dark variant themselves.

* refactor: merge deprecated icon fields into the icon when registering apps

The apps store merges the deprecated iconFillType and iconColor of an
app and its file extensions into their icon once. The apps list in the
admin settings, the "Open with" actions and the file type icon mapping
only read the icon and no longer pass the deprecated fields on.

The deprecated fields now apply wherever the icon is shown, like the
fields of a named icon do.

* refactor: declare the fill type of host icons in the icon

The sidebar panels, actions and file extensions of the host no longer
use the deprecated iconFillType field. The fill type of the vault lock
actions was the default and is dropped.

* fix: apply the deprecated fill type of an app to the icons of its file extensions

A file extension with an icon of its own and no fill type fell back to
the deprecated iconFillType of its app in the "Open with" actions. The
apps store merges that fallback into the icon as well.

* refactor: clarify the app color fallback of file type icons

* revert: apply the deprecated fill type of an app to the icons of its file extensions

A fill type belongs to the icon it was declared with. The deprecated
iconFillType of an app applies to the icon of the app and is inherited
together with it, but is not mixed into an icon that a file extension
declares itself.

This reverts commit d3ef500.

* refactor: apply deprecated icon fields only to the icon they are declared with

The deprecated iconFillType and iconColor of a file extension are only
merged into an icon that the file extension declares itself. A file
extension without an icon inherits the icon of its app as is.

* fix: ignore file extensions of apps that are not registered

Registering a file extension for an unknown app made the file type icon
mapping and the "Open with" actions fail when they looked up the app.

* fix: keep the active state of sidebar nav icons that declare a fill type

The sidebar nav shows the active item with a filled icon. A named icon
with a fill type of its own took precedence and stopped following the
active state, so the nav item sets the fill type on the icon itself.

* fix: keep the resource icon helpers as deprecated instead of removing them

* fix: resolve dark variants by icon name in the deprecated getResourceIconName
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
dschmidt added a commit to metadist/synaplan-opencloud that referenced this pull request Oct 8, 2026
Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.
orgaralf pushed a commit to metadist/synaplan-opencloud that referenced this pull request Oct 20, 2026
…er (#48)

Use the brand icon endpoint as an image icon for the Synaplan group in the file context menu and for the app. The app switcher tile is coloured, so it always asks for the dark theme variant (the light bird).

Image icons need OpenCloud 9.0.0 (opencloud-eu/web#3580). The installed 8.1.0 types only know icon names, hence the cast in useSynaplanBrandIcon; it goes away with the 9.0.0 bump. On 8.1.0 hosts the icon renders empty.

Merged before the OpenCloud 9.0.0 bump, both entries have no icon on every released OpenCloud.
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.

2 participants