Skip to content

feat: implement accurate application sizes and byte-accurate progress metrics (Fixes #531)#533

Open
prem22k wants to merge 6 commits intopop-os:masterfrom
prem22k:feature/app-size-details
Open

feat: implement accurate application sizes and byte-accurate progress metrics (Fixes #531)#533
prem22k wants to merge 6 commits intopop-os:masterfrom
prem22k:feature/app-size-details

Conversation

@prem22k
Copy link
Copy Markdown

@prem22k prem22k commented Apr 28, 2026

Fixes #531, #398

This pull request implements comprehensive application size reporting and high-fidelity installation progress tracking across the COSMIC Store. It transitions the store from simple percentage-based reporting to a byte-accurate system that provides users with transparent download and installation metrics.

Key Changes across Commits:

1. Model & Data Structures (1cc5336)

  • AppInfo Expansion: Added download_size and installed_size metrics to the core AppInfo struct.
  • AppStream Parsing: Implemented logic to resolve these metrics dynamically from AppStream XML release data.

2. Backend Integration (810b4f1, fa228ef)

  • Flatpak: Integrated libflatpak's InstalledRefExt to extract byte-accurate installation sizes.
  • PackageKit: Expanded the D-Bus intercept handler to capture package details and sizes dynamically from the system daemon's GetDetails signal.

3. UI & Localization (8e115e1, 5c0ce0b)

  • Responsive Size Widget: Added a new UI component in src/view.rs to display app sizes.
  • I18n: Added the size key and fallback strings to support the new UI across all localizations.

4. Advanced Metrics & Reliability (36fca34)

  • Byte-Accurate Progress: Refactored the backend progress system from f32 percentages to a Progress struct. This enables the UI to show real-time transfer stats (e.g., 58 MB / 180 MB) in the footer and operations drawer.
  • Unified Size Logic: Implemented a "max-value" logic for sizes to prevent UI "jumping" (e.g., download vs. installed size discrepancies).
  • Metadata Persistence: Added merging logic in update_apps to ensure byte-accurate metrics persist even when switching between different application sources or backends.
  • Robust Parsing Fallback: Added a fallback for AppStream markup parsing to ensure descriptions are visible even if upstream XML is malformed.

Technical Notes:

  • Standardized all size reporting to decimal (base-1000) units (MB/GB) to align with industry standards (e.g., Flathub).
  • The Progress bar now uses byte-weighted calculations for accurate multi-app progress.

AI Disclosure:

This contribution was developed with the assistance of an AI coding assistant. All changes—especially the Progress struct refactor and metadata merging logic—have been thoroughly reviewed, verified for correctness, and tested in a local environment.

Visual Changes

Screenshot_2026-04-28_23-39-36 Screenshot_2026-04-28_23-39-54 Screenshot_2026-04-28_23-40-06 Screenshot_2026-04-28_23-40-49 Screenshot_2026-04-28_23-40-54
  • I have disclosed use of any AI generated code in my commit messages.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

prem22k added 5 commits April 28, 2026 21:30
- Introduces `download_size` and `installed_size` fields.
- Parses size metadata from AppStream XML releases.

AI Disclosure: Parts of this code were generated with the assistance of an AI coding assistant. The logic has been fully reviewed and understood by the author.
Fixes pop-os#531

Signed-off-by: prem22k <premsai224k@gmail.com>
- Extracts `installed_size` using `libflatpak`'s `InstalledRefExt`.
- Accumulates dependency sizes in the `system_packages` (Flatpak Runtimes) virtual package.

AI Disclosure: Parts of this code were generated with the assistance of an AI coding assistant. The logic has been fully reviewed and understood by the author.
Fixes pop-os#531

Signed-off-by: prem22k <premsai224k@gmail.com>
- Expands `TransactionDetails` to include `size`.
- Extracts `size` dynamically from the D-Bus `Details` signal.

AI Disclosure: Parts of this code were generated with the assistance of an AI coding assistant. The logic has been fully reviewed and understood by the author.
Fixes pop-os#531

Signed-off-by: prem22k <premsai224k@gmail.com>
- Implements a responsive `size_widget`.
- Displays `download_size` and `installed_size` accurately formatted in MB.
- Integrates visually alongside the existing downloads widget in grid layouts.

AI Disclosure: Parts of this code were generated with the assistance of an AI coding assistant. The logic has been fully reviewed and understood by the author.
Fixes pop-os#531

Signed-off-by: prem22k <premsai224k@gmail.com>
- Appends `size = Size` across all 71 localization files to support the new size widget.

AI Disclosure: Parts of this code were generated with the assistance of an AI coding assistant. The logic has been fully reviewed and understood by the author.
Fixes pop-os#531

Signed-off-by: prem22k <premsai224k@gmail.com>
Copilot AI review requested due to automatic review settings April 28, 2026 16:11
@prem22k prem22k marked this pull request as draft April 28, 2026 16:25
This commit unifies application size reporting and installation progress across the COSMIC Store.

Key changes:
- Unified Size Logic: Displays a single, contextual size (download or installed) in the app detail view using decimal (base-1000) units.
- Byte-Accurate Progress: Upgraded the progress reporting system from simple percentages to a struct carrying byte metrics, enabling accurate progress bars and download statistics in the footer and operations drawer.
- Backend Reliability: Improved AppStream metadata parsing to be more robust against malformed XML and ensured metadata persistence when switching between application sources.
- Prioritized Backend Data: Actual installed/download sizes from Flatpak/PackageKit backends are now prioritized over AppStream estimates.

AI Disclosure: This contribution was developed with AI assistance. All changes have been thoroughly reviewed, verified for correctness, and tested in a local environment.

Co-authored-by: AI assistant (code reviewed and verified by author)
@prem22k prem22k changed the title feat: display application and dependency sizes in detail view (Fixes #531) feat: implement accurate application sizes and byte-accurate progress metrics (Fixes #531) Apr 28, 2026
@prem22k prem22k marked this pull request as ready for review April 28, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Store show the size of the applications in detail view

1 participant