Package name in sidebar (and also near the title, if necessary)#5602
Package name in sidebar (and also near the title, if necessary)#5602
Conversation
b875c87 to
5cd1d1b
Compare
5cd1d1b to
9b95e3b
Compare
|
I agree with the rationale of being more explicit with package names that differ too much from their titles, and that it needs to be more visible to help users find clues on whether or not they want to trust that application. |
|
I added some styles to implement an adaptive font size based on the length of the package name; for most snaps the font will be as close as possible to the rest of the title and won't wrap awkwardly anymore, but for those snaps with long names the font will shrink in order to fit the whole name on one line |
4500b65 to
15ef016
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves snap detail page trust signals by making the registered package name more visible: always in the details sidebar, and conditionally next to the title when the title-to-name normalization suggests they may not match.
Changes:
- Added “Package name” section to the snap details sidebar.
- Passed
package_nameinto the package header macro and conditionally rendered it next to the title with a tooltip when the normalized title differs. - Added responsive SCSS to scale the displayed package name near the title based on available width.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| templates/store/snap-details/_details.html | Displays the package name in the details sidebar. |
| templates/store/package_header/_package_header.html | Passes package_name through to the header data macro. |
| templates/store/package_header/_package_header_data.html | Conditionally renders package name near the H1 with tooltip when title normalization differs. |
| static/sass/_snapcraft_snap-details.scss | Adds styling/container-query logic to scale the near-title package name. |
| {{ package_header_data(package_title=snap_title, | ||
| package_name=package_name, | ||
| icon_url=icon_url, |
Done
package_title.replace(" ", "-").lower() != package_nameHow to QA
Testing
Security
Issue / Card
Fixes WD-33034
Screenshots
UX Approval
The idea behind this change is to mitigate the risk of fraudulent packages: by making it clear when a snap's title and its name don't match, users will hopefully be able to avoid installing malicious snaps.
To achieve this, adding the package name to the details sidebar is a good first step, but this sidebar isn't always immediately visible on first scroll (e.g. snaps with screenshots/videos), meaning this measure isn't very effective IMO. Adding the package name near the title at the top of the page, on the other hand, makes the mismatch between name and title easier to spot.
Other ideas to consider/explore: