Plasmoid icon isn't displayed on the tooltip

I moved from Kubuntu 20.04 to 24.04 and now porting my self-made plasmoids to the new system. I noticed that plasmoid’s icon which was shown on tooltip isn’t shown anymore when I use the same code as in 20.04.
I checked updated guidelines here and switched from metadata.desktop to metadata.json. There I set parameter "Icon": "org.kde.plasma.test" and copied an appropriate icon to /usr/share/icons/breeze/applets/256/org.kde.plasma.test.svg.
Then I wrote a simple code which used to work before:

import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents

Item {
    Plasmoid.toolTipMainText: "Main Text"
    Plasmoid.toolTipSubText: "Sub Text"
    // Plasmoid.icon: 'car'

    Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
    Plasmoid.compactRepresentation: PlasmaComponents.Label {
        text: "Test Label"
    }
}

Text label and both text strings on tooltip are shown properly, but the icon is missing. I tried running the plasmoid with plasmoidviewer and directly on the panel. My icon is shown only in the dialog “Add widgets”.
AFAIR it was enough to declare Icon in metadata file in previous Plasma versions and it worked in tooltips.
I tried to declare the icon right in the QML code using Plasmoid.icon, then tried another SVG icon from the breeze theme I’m using, but that didn’t change anything.
Am I missing something or tooltips don’t show icons anymore?

You’re not missing anything; this was an intentional change made several years ago. We reasoned that showing the icon in the tooltip was redundant, since the very same icon was usually shown 1cm away from the tooltip. No need to show the same thing twice in the same context.

Thanks for the explanation. I see your reasoning.
Indeed, this icon looks redundant in the case when the plasmoid displays an icon on the panel. But in the cases when it displays some text (e.g. weather plasmoid or time plasmoid) or some graph, then the tooltip looks the appropriate place for plasmoid’s icon.
I suppose, that if the Plasmoid.icon doesn’t work anymore, the sole way to add some icon to the tooltip is to use Plasmoid.toolTipItem object and construct the tooltip manually using Image and PlasmaComponents.Label inside this object.

The Plasmoid.icon property still works fine; it’s only the tooltip that no longer looks at it. It’s still used for the CompactRepresentation’s icon. So yeah, if you want a tooltip with an icon, you’ll need to roll your own.

But I would recommend against doing so only to re-add an icon in the place where the icon used to live; this will just result in your widget’s tooltip looking inconsistent with all the tooltips of all the other widgets. It will also mean that changes over time to the default tooltip appearance won’t carry over to your custom implementation, so it will drift even more out of consistency over time without active maintenance from you.