appstream
appstream copied to clipboard
Allow tagging screenshots as mobile
As suggested in an issue filed against gnome-software, it would be slightly useful if screenshots in a metainfo file could have an attribute which indicates whether they’re of the full-size application, or of its smaller mobile UI.
If that information was present, we could prioritise showing the screenshots of the mobile version of an app, when gnome-software is running on a mobile device.
We can’t reliably work this out from the existing screenshot metadata, as smaller (pixel-wise) screenshots might be of dialogues or things which aren’t the main window in mobile mode.
This would only be useful for adaptive apps, and people can always scroll through the screenshots to find mobile ones, so it’s not a particularly urgent feature request.
I fear we'll hit the same constraints here as we've found in other places when trying to name different sizes, e.g. #335. Instead, we could leave it up to software centers to decide how to sort/arrange screenshots without deciding what constitutes "mobile" again in AppStream. For example, is a Steam Deck mobile? Is a large folding phone with a square aspect ratio? Are 7" portrait tablets mobile?
Instead, might it make sense to:
- Recommend app developers don't include screenshots of dialogs without the full UI behind it, in part so:
- Software centers can sort screenshots presented to users by ones that match the logical display size (and possibly aspect ratio)
I believe this is similar to how at least the Google Play Store on Android works, where it will sort screenshots to show the closest match to your current display first while still showing other screenshots in the carousel (e.g. you'll see phone screenshots on a small phone, but then keep swiping and you see larger tablet screenshots).
There is no need to specify when a Device is mobile or not in the Appstream specification. Just specify that a Screenshot can have a mobile variant. The Appcenters could use e.g. the Shell to determine if it's mobile or not. If you use e.g. Plasma mobile, you have most likely a mobile device. If you are using the normal Plasma Desktop, you have most likely a Desktop device.
There is no need to specify when a Device is mobile or not in the Appstream specification. Just specify that a Screenshot can have a mobile variant. The Appcenters could use e.g. the Shell to determine if it's mobile or not. If you use e.g. Plasma mobile, you have most likely a mobile device. If you are using the normal Plasma Desktop, you have most likely a Desktop device.
Yes, that’s what I had in mind.
The only addition to the spec needed here (I think) is something like component_size="{xsmall,small,medium,..}"
on <screenshot/>
elements. The value/semantics of the attribute should probably match whatever gets decided in #335, for all the same reasons as the decision making there. I’m also not tied to component_size
as the attribute name, it’s just a quick suggestion.
Instead, might it make sense to:
Recommend app developers don't include screenshots of dialogs without the full UI behind it, in part so:
Software centers can sort screenshots presented to users by ones that match the logical display size (and possibly aspect ratio)
I don’t think that’ll work in general because, even if point 1 is followed, apps may have multiple non-dialog windows which have different natural sizes.
I wonder how much this overlaps with the screenshot environment proposal (https://github.com/ximion/appstream/issues/304) - if the environment is plasma:mobile
or gnome:phosh
we'd kind of have the information already.
If we need to go even more detailed here, a screenshot would need to be coupled to a display_length
: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations-display_length
But the human-readable names are deprecated, as nobody can agree on what they actually mean and the some GNOME designers found them not useful.
So, in that case we'd need to couple the screenshot
(or just the screenshow image
s?) to a display_length
which would be any integer value. With that, I think we would be fairly accurate, but I think setting that value correctly will be quite a challenge for anybody writing metadata!
I wonder how much this overlaps with the screenshot environment proposal (https://github.com/ximion/appstream/issues/304) - if the environment is plasma:mobile or gnome:phosh we'd kind of have the information already.
It would be better to tag a screenshot as mobile without needing a list of all mobile enviroments. Something like this:
<image mode="mobile">https://exmaple.com/image.png</image>
The software centers can decide by itself, if the mobile screenshot should be preferred. This can be done by checking the enviroment or if the software center itself currently in mobile mode. That decision belongs to the software center authors.
No. AppStream has no definition of what "mobile" is, and I really don't want to maintain one. And telling software center authors to "figure it out yourself" without any clear guidance will just lead to more problems down the road, with software centers interpreting the same thing differently and upstream authors confused as to what kind of screenshot they should actually put there to look good everywhere, and issues like how to prevent tablet UIs being shown on phones. Believe me, we've done something like that in the past already and it was terrible. I'd rather discuss a little longer and find a declarative way for this, rather than doing a thing quickly that looks straightforward at first glance but will cause problems later (at which point we can't easily remove it anymore).
I think mobile is when programs run in mobile mode. This is currently bound to the Window size. You can see that when resizing some Gnome and KDE programs. At a specific size (I don't know a number), the Layout completely changes to a mobile Layout with a bottom bar. I don't know if this size is the same on all Apps. Currently the Software Centers of the 2 Mayor DEs KDE and Gnome have a mobile mode. So whats with this definition: If the Software Center itself in mobile mode, it should show the mobile Screenshots.
I wonder how much this overlaps with the screenshot environment proposal (#304) - if the environment is
plasma:mobile
orgnome:phosh
we'd kind of have the information already.
Yes, that would work well. Then instead of getting gnome-software to prioritise screenshots which are ‘mobile’ sized when the user is running gnome-software on a mobile system, it would instead prioritise whatever screenshots are for the same desktop environment as the user is currently running. That would solve the ‘mobile’ case and would also improve the user experience for screenshots of dark themes, different desktop environments, etc.
FYI https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1697#note_1837659