Skip to content

feat(ui): Add warning signpost for old snaps#5352

Merged
edisile merged 4 commits intocanonical:mainfrom
gajeshbhat:feat/signpost-old-snaps-2988
Feb 16, 2026
Merged

feat(ui): Add warning signpost for old snaps#5352
edisile merged 4 commits intocanonical:mainfrom
gajeshbhat:feat/signpost-old-snaps-2988

Conversation

@gajeshbhat
Copy link
Copy Markdown
Contributor

@gajeshbhat gajeshbhat commented Sep 5, 2025

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

  • Backend Logic: Added is_snap_old() function to detect snaps older than 2 years
  • Date Formatting: Added convert_date_month_year() for cleaner "Month Year" format
  • UI Component: Added warning notification in snap details sidebar with orange left border
  • Styling: Custom CSS for clean notification appearance (no borders except orange left border)
  • Testing: Comprehensive test coverage for date logic and edge cases

Implementation Details

  • Threshold: Configurable (default: 2 years)
  • Message: "This snap in this channel hasn't been updated since [Month Year]. Contact the developer to ask for an update."
  • Positioning: Appears after "Last Updated" section in sidebar
  • Styling: Uses Vanilla CSS p-notification--caution with custom .old-snap-warning class

How to QA

Unit Testing

  • All existing tests pass
  • New tests added for is_snap_old() function
  • New tests added for convert_date_month_year() function
  • Manual testing completed on local development server

Prerequisites

  • Checkout to my Branch: feat/signpost-old-snaps-2988
  • Run the development server locally: dotrun

Test Cases

Snaps that SHOULD show the warning (2+ years old):

  • Visit http://localhost:8004/mumble - Should show a warning
  • Visit http://localhost:8004/hello - Should show a warning
  • Visit http://localhost:8004/wekan - Should show a warning

Snaps that should NOT show the warning (recently updated):

  • Visit http://localhost:8004/vault - Should NOT show warning
  • Visit http://localhost:8004/microk8s - Should NOT show warning

What to Look For

  1. Warning Appearance:

    • Orange left border (no other borders)
    • Warning icon
    • Clean, minimal styling
    • Horizontal line below for consistency
  2. Message Format:

    • "This snap in this channel hasn't been updated since [Month Year]. Contact the developer to ask for an update."
    • Month and year only (no specific day)
  3. Positioning:

    • Appears in right sidebar
    • After "Last Updated" section
    • Before "Contact" section (if present)

Edge Cases to Test

  • Try snaps with different update dates
  • Verify warning only appears for snaps 2+ years old
  • Check that recent snaps don't show the warning

Screenshots

Screenshots are attached below showing:

Warning displayed on old snaps (mumble, hello, wekan)

Screenshot from 2025-09-05 23-26-31 Screenshot from 2025-09-05 23-27-05 Screenshot from 2025-09-05 23-27-23

No warning on recently updated snaps (vault, microk8s)

Screenshot from 2025-09-05 23-27-51 Screenshot from 2025-09-05 23-28-06

Notes

  • The feature is backward compatible and doesn't affect existing functionality
  • Uses timezone-aware datetime functions to avoid deprecation warnings
  • Follows existing design patterns and styling conventions
  • The message can be easily customized by modifying the template

@webteam-app
Copy link
Copy Markdown

gajeshbhat is not a collaborator of the repo

@gajeshbhat gajeshbhat changed the title feat(snap-details-ui): Add warning signpost for snaps not updated in 2+ years feat(snap-details-ui): Add warning signpost for old snaps Sep 5, 2025
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 6c05c8c to 5d57e46 Compare September 5, 2025 00:47
@bartaz
Copy link
Copy Markdown
Member

bartaz commented Sep 5, 2025

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
Copy link
Copy Markdown

codecov Bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (b8b6b55) to head (509c41a).
⚠️ Report is 638 commits behind head on main.

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     

see 61 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bartaz bartaz requested a review from Copilot September 5, 2025 06:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread webapp/store/logic.py Outdated
bartaz
bartaz previously requested changes Sep 5, 2025
Comment thread static/sass/styles.scss Outdated
@gajeshbhat
Copy link
Copy Markdown
Contributor Author

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.

Thanks for taking a look @bartaz . Yes, I do remember seeing the Dev Ready label on some issues where the UX had been discussed, but as this is a minor change, I assumed that could be done during the PR review. Apologies for not checking early. Happy to work with UX to decide the place, the message and duration to display the warning. Will resolve other comments and wait for the suggestions on this. Thanks for pointing it out. Cheers.

@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 5d57e46 to 07d256e Compare September 6, 2025 06:06
@gajeshbhat gajeshbhat requested a review from bartaz September 6, 2025 06:12
@gajeshbhat gajeshbhat changed the title feat(snap-details-ui): Add warning signpost for old snaps feat(ui): Add warning signpost for old snaps Sep 14, 2025
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch 2 times, most recently from a434581 to 53a0829 Compare September 18, 2025 20:05
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 53a0829 to 25f90a3 Compare September 29, 2025 18:24
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 25f90a3 to 687ff8e Compare October 18, 2025 05:55
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch 2 times, most recently from e07aeea to ea05e2c Compare October 29, 2025 07:05
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from ea05e2c to 4a59aa1 Compare November 16, 2025 00:25
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch 2 times, most recently from 27403bc to d62b840 Compare November 26, 2025 19:48
@gajeshbhat
Copy link
Copy Markdown
Contributor Author

Hey @bartaz , Hope you have been well. Any chance we can get a review from UI/UX for this PR ?

@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch 4 times, most recently from 0e38842 to cbc1ba9 Compare December 4, 2025 05:31
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch 2 times, most recently from da5889d to 84e8a3e Compare December 13, 2025 19:47
@gajeshbhat
Copy link
Copy Markdown
Contributor Author

Retriggerd CI using git commit --amend --no-edit && git push --forceand the Inclusive naming check passes now.

@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 84e8a3e to 7953a7d Compare December 30, 2025 01:01
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 7953a7d to e30a716 Compare January 15, 2026 04:18
@gajeshbhat
Copy link
Copy Markdown
Contributor Author

@bartaz @edisile Any chance UI/UX can review this ? Happy to answer questions or help update the PR if required.

@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from e30a716 to 17071de Compare January 16, 2026 04:21
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 17071de to 29d8c75 Compare January 30, 2026 15:04
Copy link
Copy Markdown
Contributor

@edisile edisile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread static/sass/styles.scss Outdated
Comment thread templates/store/snap-details/_details.html Outdated
Comment thread webapp/store/snap_details_views.py Outdated
Comment thread templates/store/snap-details/_details.html Outdated
Comment thread webapp/store/logic.py Outdated
Comment thread webapp/store/logic.py Outdated
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 29d8c75 to d73c93c Compare February 7, 2026 05:41
@gajeshbhat
Copy link
Copy Markdown
Contributor Author

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

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.

  1. CI check for test-python is failing. I ran this test locally on upstream/main and it is failing as well. Let me know if you folks fix it, I will rebase/
  2. Inclusive naming check fails intermittently. I have raised a ticket for this before on this repo (Intermittent Failure in canonical/inclusive-naming@main Action #5531 (comment)) and the original repo that hosts this check
  3. Black linter was throwing errors (https://github.com/canonical/snapcraft.io/actions/runs/21775757077/job/62831944315) on CI (after rebase, on files I did not touch), I ran the linter locally and updated the lint checks and now its passing.

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.

@edisile
Copy link
Copy Markdown
Contributor

edisile commented Feb 11, 2026

@gajeshbhat thank you! The tests should work now if you rebase on main

Comment thread templates/store/snap-details/_details.html Outdated
Comment thread webapp/store/logic.py
Comment thread webapp/store/logic.py Outdated
Comment thread tests/store/tests_public_logic.py
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from f580ae1 to 94fd8d0 Compare February 11, 2026 20:45
@gajeshbhat gajeshbhat requested a review from edisile February 12, 2026 01:21
Copy link
Copy Markdown
Contributor

@edisile edisile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@gajeshbhat
Copy link
Copy Markdown
Contributor Author

Looks good!

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
@gajeshbhat gajeshbhat force-pushed the feat/signpost-old-snaps-2988 branch from 96b34b4 to 509c41a Compare February 12, 2026 21:45
@edisile edisile dismissed bartaz’s stale review February 16, 2026 10:36

requested change has already been addressed

@edisile edisile merged commit 3458caf into canonical:main Feb 16, 2026
10 checks passed
@edisile edisile mentioned this pull request Feb 20, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider signposting old snaps?

6 participants