Skip to content

fix(scoop-info): improve installed size display to show app + user data combined - #6651

Open
B67687 wants to merge 3 commits into
ScoopInstaller:developfrom
B67687:fix/scoop-info-size-display
Open

fix(scoop-info): improve installed size display to show app + user data combined#6651
B67687 wants to merge 3 commits into
ScoopInstaller:developfrom
B67687:fix/scoop-info-size-display

Conversation

@B67687

@B67687 B67687 commented May 1, 2026

Copy link
Copy Markdown

Summary

Improve the scoop info -v installed size display by combining app files and persisted data into a single Application line, reducing confusion about what counts toward the installed footprint.

Motivation and Context

Users were confused by seeing separate large values for the current version and persisted data, which made it look like Scoop was double-counting storage. Grouping them under a single application total makes the output easier to reason about while still preserving the breakdown.

Relates to #4840.

Changes

  • Combine Current version and Persisted data into a single Application line
  • Show the breakdown inline as (X app + Y user data)
  • Rename Cached downloads to Download cache
  • Right-align the size values in a fixed-width column for more consistent output
  • Add -ErrorAction SilentlyContinue while enumerating files to avoid noisy failures on unusual file types
  • Add a focused regression test covering the installed-size formatting helper

Before

Installed size : Current version:  660.4 MB
                 Persisted data:   2.9 GB
                 Cached downloads: 213.2 MB
                 Total:            3.7 GB

After

Installed size : Application:        3.5 GB (660.4 MB app + 2.9 GB user data)
                 Download cache:   213.2 MB
                 Total:              3.7 GB

After (when old versions are present)

Installed size : Application:        3.5 GB (660.4 MB app + 2.9 GB user data)
                 Old versions:      50.0 MB
                 Download cache:   213.2 MB
                 Total:              3.8 GB

Old versions is shown only when it is non-zero.

How Has This Been Tested?

  • Manually verified scoop info -v output on an app with large persisted data
  • Confirmed the new Application label and inline breakdown render as expected
  • Confirmed Old versions appears only when present
  • Confirmed -ErrorAction SilentlyContinue suppresses errors on non-standard file types
  • Ran Invoke-Pester -Path .\test\Scoop-Core.Tests.ps1 -ExcludeTagFilter Windows -CI with Pester 5.7.1

Checks

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly. Console output change, docs in the Wiki
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Summary by CodeRabbit

  • Bug Fixes

    • Suppressed filesystem errors during verbose installed-size calculation.
    • Simplified verbose size display: combined application files and persisted data into a single "Application" line with optional app/user-data breakdown.
    • Renamed "Cached downloads" to "Download cache".
    • Improved alignment and multi-line formatting of verbose size output.
  • Tests

    • Added tests covering installed-size formatting and verbose output.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5e1229f4-83ee-4720-b460-1f932aabc499

📥 Commits

Reviewing files that changed from the base of the PR and between a5d6e13 and 84e940d.

📒 Files selected for processing (1)
  • test/Scoop-Core.Tests.ps1
✅ Files skipped from review due to trivial changes (1)
  • test/Scoop-Core.Tests.ps1

Walkthrough

Adds aligned installed-size formatting helpers, uses them unconditionally in verbose scoop-info output, suppresses filesystem enumeration errors during recursive size summation, adds Pester tests for the formatter, and updates CHANGELOG.md.

Changes

Installed size output enhancement

Layer / File(s) Summary
Formatting helpers
lib/core.ps1
Add format_installed_size_line($label, $size, $suffix = '') and format_installed_size($currentSize, $persistedSize, $cacheSize, $oldVersionsSize) to produce aligned multi-line installed-size text and omit zero-valued optional sections.
Size enumeration & wiring
libexec/scoop-info.ps1
Add -ErrorAction SilentlyContinue to recursive Get-ChildItem ... -Recurse -File and always call format_installed_size(...) with fileTotals[1]..[4] to set $item.'Installed size'.
Tests
test/Scoop-Core.Tests.ps1
Add Describe 'format_installed_size' with It tests covering single-line output, multi-line aligned output with app/user-data breakdown, inclusion of "Old versions", omission of persisted-data suffix when user-data is zero, and a regex-format assertion.
Changelog
CHANGELOG.md
Add [Unreleased] → Bug Fixes entry describing installed-size aggregation into an “Application” line with breakdown, rename of "Cached downloads" → "Download cache", and filesystem error suppression.

Sequence Diagram(s)

sequenceDiagram
  participant scoop-info
  participant format_installed_size
  participant console_output
  scoop-info->>format_installed_size: format_installed_size(current,persisted,cache,old)
  format_installed_size->>console_output: formatted lines (Application, Old versions?, Download cache?, Total)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • niheaven

Poem

🐰 I hopped through bytes with softer tread,
Quieted errors that used to spread,
Application, cache, old bits aligned,
Neat columns formed where totals are signed,
I nibble zeros till the sums are fed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: improving the installed size display in scoop-info to combine application files and user data, which is the primary objective of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@B67687

B67687 commented May 1, 2026

Copy link
Copy Markdown
Author

This is more opinionated lol but what do yall think

@B67687
B67687 changed the base branch from master to develop May 2, 2026 00:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
CHANGELOG.md (1)

5-5: 💤 Low value

Consider a more descriptive changelog entry.

The current entry mentions combining sizes but doesn't capture all the changes mentioned in the PR summary: renaming "Cached downloads" to "Download cache", the parenthetical breakdown format, or the -ErrorAction SilentlyContinue addition. Consider expanding to:

- **scoop-info:** Clarify verbose installed size output by combining application files and persisted data into a single "Application" line with breakdown, rename "Cached downloads" to "Download cache", and suppress filesystem errors ([`#4840`](https://github.com/ScoopInstaller/Scoop/issues/4840))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 5, Update the CHANGELOG.md entry for scoop-info to the
more descriptive line: state that verbose installed size now combines
application files and persisted data into a single "Application" line with a
parenthetical breakdown, that "Cached downloads" was renamed to "Download
cache", and that filesystem errors are suppressed via -ErrorAction
SilentlyContinue; reference the PR number (`#4840`) in the entry as shown in the
suggested text.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 302: Replace the truncated placeholder entry `- **chore:** Upda...
trimmed for brevity` in the Bug Fixes section for v0.2.3 with the full, original
changelog line; locate the entry by searching for the v0.2.3 heading and the
exact placeholder string, then restore the complete original text from the
repository history or backup (or the author’s original commit message) so the
changelog contains the full, valid changelog entry instead of the trimmed
placeholder.

---

Nitpick comments:
In `@CHANGELOG.md`:
- Line 5: Update the CHANGELOG.md entry for scoop-info to the more descriptive
line: state that verbose installed size now combines application files and
persisted data into a single "Application" line with a parenthetical breakdown,
that "Cached downloads" was renamed to "Download cache", and that filesystem
errors are suppressed via -ErrorAction SilentlyContinue; reference the PR number
(`#4840`) in the entry as shown in the suggested text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef09b13d-40b6-49e6-97e2-cd5d8e66ca9d

📥 Commits

Reviewing files that changed from the base of the PR and between 85e82dc and 39190fa.

📒 Files selected for processing (1)
  • CHANGELOG.md

Comment thread CHANGELOG.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 1-7: Remove the duplicate "## [Unreleased]" heading by keeping a
single "## [Unreleased]" section, then move the bug-fix bullet (the scoop-info
bullet about "Clarify verbose installed size...") so it appears under the
retained "### Bug Fixes" list; ensure there is only one "## [Unreleased]"
heading and one "### Bug Fixes" block, and delete the redundant trailing
duplicated heading and any blank lines so the changelog markdown is well-formed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cde0edaf-644a-4204-8e8d-a5d6d5a4fb55

📥 Commits

Reviewing files that changed from the base of the PR and between 39190fa and 7cdc8fd.

📒 Files selected for processing (1)
  • CHANGELOG.md

Comment thread CHANGELOG.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
libexec/scoop-info.ps1 (1)

177-200: ⚡ Quick win

Add a regression test for the new verbose installed-size layout.

This block now encodes multiple presentation and arithmetic rules (Application merge/breakdown, conditional rows, label rename, unchanged Total), so a focused output regression test would prevent drift.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libexec/scoop-info.ps1` around lines 177 - 200, Add a regression test that
validates the verbose "Installed size" output produced from the $fileTotals ->
$fileSizeOutput logic: exercise cases for (a) typical app with app+user data
(ensure "Application:    " line shows combined size and the "(X app + Y user
data)" breakdown), (b) when old versions exist (ensure "Old versions:   "
appears only if $fileTotals[4] != 0), (c) when download cache exists (ensure
"Download cache: " appears only if $fileTotals[3] != 0), and (d) Total
calculation remains unchanged (verify "Total:          " equals
filesize($fileTotals[0] + $fileTotals[2] + $fileTotals[3])). Use the same
formatting helpers (filesize, PadLeft, and newline join that populates
$item.'Installed size') and assert the full multi-line string exactly to catch
presentation or arithmetic regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@libexec/scoop-info.ps1`:
- Around line 177-200: Add a regression test that validates the verbose
"Installed size" output produced from the $fileTotals -> $fileSizeOutput logic:
exercise cases for (a) typical app with app+user data (ensure "Application:    "
line shows combined size and the "(X app + Y user data)" breakdown), (b) when
old versions exist (ensure "Old versions:   " appears only if $fileTotals[4] !=
0), (c) when download cache exists (ensure "Download cache: " appears only if
$fileTotals[3] != 0), and (d) Total calculation remains unchanged (verify
"Total:          " equals filesize($fileTotals[0] + $fileTotals[2] +
$fileTotals[3])). Use the same formatting helpers (filesize, PadLeft, and
newline join that populates $item.'Installed size') and assert the full
multi-line string exactly to catch presentation or arithmetic regressions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24d861d5-6979-44a7-b3c5-fceaf81fd918

📥 Commits

Reviewing files that changed from the base of the PR and between cfb8586 and 9b6f804.

📒 Files selected for processing (1)
  • libexec/scoop-info.ps1

@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews resumed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/core.ps1`:
- Around line 354-365: The "Application" line always appends the "($(filesize
$currentSize) app + $(filesize $persistedSize) user data)" suffix even when
$persistedSize is 0; change the code that builds the Application line (where
$appSize is computed and format_installed_size_line is called) to only include
that suffix when $persistedSize -gt 0, otherwise call format_installed_size_line
with just the app size/label; keep using the existing variables ($currentSize,
$persistedSize, $appSize) and the format_installed_size_line helper so the
output shows "Application: X (Y app + Z user data)" only when persisted data
exists.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1d26f27-9d81-4a1f-a263-4b964bad3e67

📥 Commits

Reviewing files that changed from the base of the PR and between cfb8586 and 0e7843d.

📒 Files selected for processing (3)
  • lib/core.ps1
  • libexec/scoop-info.ps1
  • test/Scoop-Core.Tests.ps1
✅ Files skipped from review due to trivial changes (1)
  • test/Scoop-Core.Tests.ps1

Comment thread lib/core.ps1
…ta combined

Improve the 'scoop info -v' installed size display by combining app files
and persisted data into a single 'Application' line, reducing confusion
about what counts toward the installed footprint.

- Combine 'Current version' and 'Persisted data' into 'Application' line
- Show breakdown in parentheses: (X app + Y user data)
- Rename 'Cached downloads' to 'Download cache'
- Right-align size values in a fixed-width column
- Add -ErrorAction SilentlyContinue to suppress filesystem errors
- Add regression tests for installed-size formatting

Closes ScoopInstaller#4840
@B67687
B67687 force-pushed the fix/scoop-info-size-display branch from e659e85 to 081ec4b Compare May 12, 2026 09:22
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews resumed.

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.

1 participant