feat(ui): Add warning signpost for old snaps#5352
Conversation
|
gajeshbhat is not a collaborator of the repo |
6c05c8c to
5d57e46
Compare
|
Thanks again @gajeshbhat. I'll pass it through copilot first and we'll add it to our maintenance review list. With feature requests like this, we usually get them through UX first, before even starting implementation. While your suggestion is OK, it hasn't been decided where such notification should be added, what should it say, how old snap needs to be for it to show up. That said, we can use your PR to discuss these with UX during review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5352 +/- ##
==========================================
- Coverage 66.80% 0 -66.81%
==========================================
Files 113 0 -113
Lines 3714 0 -3714
Branches 965 0 -965
==========================================
- Hits 2481 0 -2481
+ Misses 1098 0 -1098
+ Partials 135 0 -135 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a warning notification system for snap packages that haven't been updated in over 2 years, helping users identify potentially outdated or unmaintained snaps.
- Added backend logic to detect old snaps and format dates appropriately
- Implemented UI notification component in the snap details sidebar
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| webapp/store/snap_details_views.py | Integrates old snap detection into snap details context |
| webapp/store/logic.py | Implements core functions for detecting old snaps and date formatting |
| tests/store/tests_public_logic.py | Adds comprehensive test coverage for new date and old snap logic |
| templates/store/snap-details/_details.html | Adds warning notification UI component to snap details sidebar |
| static/sass/styles.scss | Adds custom styling for the old snap warning notification |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Thanks for taking a look @bartaz . Yes, I do remember seeing the |
5d57e46 to
07d256e
Compare
a434581 to
53a0829
Compare
53a0829 to
25f90a3
Compare
25f90a3 to
687ff8e
Compare
e07aeea to
ea05e2c
Compare
ea05e2c to
4a59aa1
Compare
27403bc to
d62b840
Compare
|
Hey @bartaz , Hope you have been well. Any chance we can get a review from UI/UX for this PR ? |
0e38842 to
cbc1ba9
Compare
da5889d to
84e8a3e
Compare
|
Retriggerd CI using |
84e8a3e to
7953a7d
Compare
7953a7d to
e30a716
Compare
e30a716 to
17071de
Compare
17071de to
29d8c75
Compare
edisile
left a comment
There was a problem hiding this comment.
Hi there! Thanks for reaching out and sorry for taking so long to reply. Unfortunately we couldn't get a proper formal UX review, but we received some informal comments I reported here along with a few things I noticed
29d8c75 to
d73c93c
Compare
Thank you @edisile for taking the time to review this PR. I have made some changes based on the review feedback. As changes are not of larger scope, I think a minor UX comment should suffice instead of the full review. Please let me know if you have any question. Cheers.
On a side note, I also have similar smaller UI feature PR that's been waiting for a while now, if you can kindly take a look, that would be helpful : #5353 . Thanks again and Cheers. |
|
@gajeshbhat thank you! The tests should work now if you rebase on main |
f580ae1 to
94fd8d0
Compare
Thank you. |
- Add is_snap_old() function to detect snaps older than 2 years - Add convert_date_month_year() for cleaner date formatting - Display warning notification on snap details for old snaps - Use simple "Month Year" format for better readability - Add custom styling with orange left border for consistency - Include comprehensive test coverage for date logic - Message: "This snap in this channel hasn't been updated since [Month Year]. Contact the developer to ask for an update." Fixes canonical#2988
Signed-off-by: Gajesh Bhat <gajeshbht@gmail.com>
- Changed notification message to vague 'hasn't been updated in a while' - Simplified is_snap_old to return boolean instead of dictionary - Removed convert_date_month_year function (no longer needed) - Updated all tests to work with boolean return value - Fixed test_is_snap_old_exactly_two_years timestamp to match exactly 2 years
96b34b4 to
509c41a
Compare
requested change has already been addressed
Done
Adds a warning notification on snap detail pages for snaps that haven't been updated in over 2 years, helping users identify potentially outdated or unmaintained snaps.
Fixes #2988
Changes
is_snap_old()function to detect snaps older than 2 yearsconvert_date_month_year()for cleaner "Month Year" formatImplementation Details
p-notification--cautionwith custom.old-snap-warningclassHow to QA
Unit Testing
is_snap_old()functionconvert_date_month_year()functionPrerequisites
feat/signpost-old-snaps-2988dotrunTest Cases
Snaps that SHOULD show the warning (2+ years old):
http://localhost:8004/mumble- Should show a warninghttp://localhost:8004/hello- Should show a warninghttp://localhost:8004/wekan- Should show a warningSnaps that should NOT show the warning (recently updated):
http://localhost:8004/vault- Should NOT show warninghttp://localhost:8004/microk8s- Should NOT show warningWhat to Look For
Warning Appearance:
Message Format:
Positioning:
Edge Cases to Test
Screenshots
Screenshots are attached below showing:
Warning displayed on old snaps (mumble, hello, wekan)
No warning on recently updated snaps (vault, microk8s)
Notes