To show snaps in the “Featured Application” section in GNOME Software we have used the screenshot functionality to do this.
We currently look for a two screenshots uploaded with the name “banner.png” or “banner.jpg” and “banner-icon.png” or “banner-icon.jpg” and use these to promote this snap:
This is using these images:
When then hide these screenshots from the screenshots when viewing the snap details. Note that no other client would understand this and show these images as screenshots. GNOME Software is using a regular expression to match these files (since Django can add a suffix onto them):
This is obviously pretty hacky… So we’d like to pay down some technical debt.
What I propose we do:
- Check if any other clients are going to make use of this feature, and if so check the format of the banner and icon are suitable for these.
- Consider any additional information we would like to have for promoted apps. For example, the font colour is currently hard-coded to black but that would be probably be better configurable (as it is for existing promoted apps in GNOME Software).
- Add two new database fields for the banner images and the associated web UI to set these (this would be a variation of the screenshot code). Add any other fields as determined in step 2.
- Pass these banner URLs through snapd to the client.
- Migrate any existing apps to the new database format.
- Update GNOME Software to make use of the new format (synchronised with step 5).