Skip to content

Conversation

gajeshbhat
Copy link
Contributor

@gajeshbhat gajeshbhat commented Sep 5, 2025

Done

This addresses user need for bandwidth awareness on metered connections by showing accurate download sizes for each channel, since different channels can have different package sizes.

How to QA

  1. Check out into my branch feat/show-package-size-1864 and run the server locally using dotrun
  2. Navigate to any snap details page (e.g., /firefox, /code, /discord)
  3. Click on the channel/version dropdown button (e.g., "latest/stable r1234") to open the channel map
  4. Click on "All versions" tab to see the full channel table
  5. Verify that the "Download Size" column appears between "Version" and "Published" columns
  6. Confirm that sizes are displayed in human-readable format (e.g., "50.0 MB", "1.2 GB")
  7. Test on different screen sizes - the Download Size column should be hidden on mobile/tablet views
  8. Try different snaps to see varying package sizes across different channels
  9. Verify that the size information matches what you'd expect for each package

Testing

  • This PR has tests
    • Added unit test test_package_size_in_channel_map that verifies size data is correctly included in channel map data structure and HTML output
    • Manual Test confirms (see the attached screen recording) the "Download Size" column header appears in the rendered HTML
    • All existing tests continue to pass

Issue / Card

Fixes #1864

Screenshots

Screenshots and a screencast have been added below showing the new Download Size column in the channel table across different snap packages.

Snapstore Download Size 0 Snapstore Download Size 1 Snapstore Download Size 2 Snapstore Download Size 3

Screencast of me running the changes locally on a server and Download Sizes column working

Screencast-Downoad-Size-Snapcraft-1864.webm

@webteam-app
Copy link

gajeshbhat is not a collaborator of the repo

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5353      +/-   ##
==========================================
- Coverage   66.80%   60.46%   -6.34%     
==========================================
  Files         113      224     +111     
  Lines        3714     5039    +1325     
  Branches      965      747     -218     
==========================================
+ Hits         2481     3047     +566     
- Misses       1098     1768     +670     
- Partials      135      224      +89     

see 257 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.

@gajeshbhat gajeshbhat force-pushed the feat/show-package-size-1864 branch from fc789e2 to 0121168 Compare September 5, 2025 01:46
@gajeshbhat gajeshbhat changed the title feat: Add download size display to channel table (#1864) feat(ui): Add download size display to channel table (#1864) Sep 5, 2025
@bartaz
Copy link
Member

bartaz commented Sep 5, 2025

Thanks @gajeshbhat. I'll pass it through copilot first and we'll add it to our maintenance review list. As this is not a bug fix, but a new feature with a UI change, we'll also get a UX to review it, to confirm if the approach is good.

Copy link
Contributor

@Copilot 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 "Download Size" column to the channel table in the snap details page, allowing users to see package sizes for each channel to make informed decisions on metered connections.

  • Adds a new column displaying download sizes in human-readable format (MB, GB) between Version and Published columns
  • Implements size formatting utility function using decimal (1000-based) units
  • Includes responsive design hiding the column on mobile/tablet views

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/store/tests_details.py Adds unit test verifying size data inclusion in channel map and HTML output
templates/store/snap-details/_channel_map.html Updates table header and row template to include Download Size column
static/js/public/snap-details/channelMap.ts Adds size property to interface and formatSize utility function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gajeshbhat
Copy link
Contributor Author

Thanks @gajeshbhat. I'll pass it through Copilot first, and we'll add it to our maintenance review list. As this is not a bug fix, but a new feature with a UI change, we'll also get a UX to review it, to confirm if the approach is good.

Thank you for taking a look at this @bartaz . Copilot comments were minor, and I have replied to them and likely won't require a code change. No worries about the time, I understand that you folks are busy with higher priority items. Let's also get the clear from UX. Happy to wait. Please feel free to let me know if you have any questions for me. Cheers.

@gajeshbhat gajeshbhat force-pushed the feat/show-package-size-1864 branch 2 times, most recently from fb2071d to a712bb1 Compare September 18, 2025 20:05
@gajeshbhat gajeshbhat force-pushed the feat/show-package-size-1864 branch from a712bb1 to 719e756 Compare September 29, 2025 18:23
- Add "Download Size" column to channel map table showing per-channel package sizes
- Implement human-readable size formatting (B, kB, MB, GB, TB) in JavaScript
- Update ChannelData TypeScript interface to include size field
- Add responsive design (hidden on mobile screens)
- Include comprehensive unit tests for size display functionality

Addresses user need for bandwidth awareness on metered connections by showing
accurate download sizes for each channel, since different channels can have
different package sizes.

Fixes canonical#1864
@gajeshbhat gajeshbhat force-pushed the feat/show-package-size-1864 branch from 719e756 to a1792c4 Compare October 18, 2025 05:54
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.

Suggestion: Show size of packages

3 participants