SVG icon size in context menu

I used the Sidebar Links plugin to add a link in the sidebar of a folder, and specified “/plugin/cloudbees-bitbucket-branch-source/images/bitbucket-repository.svg” as the icon for the link. This looks OK in the sidebar. However, the same link also appears in the context menu of the folder, and there the icon is much larger than the icons of the other menu items. The DOM inspector of the Web browser shows the following in the context menu item:

<div class="jenkins-dropdown__item__icon"><img src="/jenkins/static/fa23dda1/plugin/cloudbees-bitbucket-branch-source/images/bitbucket-repository.svg" style="width: 48px; height: 48px; "></div>

The context menu is apparently formatted by the ModelObjectWithContextMenu.ContextMenu.from method running some Jelly view that uses core/src/main/resources/lib/layout/icon.jelly, which does <j:set var="iconMetadata" value="${h.tryGetIcon(src)}"/>. In the Script Console, Functions.tryGetIcon("/plugin/cloudbees-bitbucket-branch-source/images/bitbucket-repository.svg").getStyle() returns “width: 48px; height: 48px;”.

However, the Bitbucket Branch Source plugin does register the same SVG file for four sizes. Is it a bug that the correct size is not used automatically in the context menu, or is this not expected to work?

You might want to try to use a symbol, e.g. symbol-logo-bitbucket plugin-ionicons-api