Skip to content

feat(analyze): hidden-space insights in overview#664

Merged
tw93 merged 3 commits intotw93:mainfrom
sebastianbreguel:feat/analyze-hidden-space
Apr 1, 2026
Merged

feat(analyze): hidden-space insights in overview#664
tw93 merged 3 commits intotw93:mainfrom
sebastianbreguel:feat/analyze-hidden-space

Conversation

@sebastianbreguel
Copy link
Copy Markdown
Contributor

@sebastianbreguel sebastianbreguel commented Apr 1, 2026

Summary

Adds hidden-space insight entries to the mo analyze overview screen that surface disk usage in commonly overlooked locations. These appear alongside the standard directory entries (Home, App Library, Applications, System Library).

Many of these correspond to things mo clean already handles — this PR lets users see how much space each category uses before deciding to clean.

Discussed in #659 as features that fit naturally inside mo analyze.

New insight entries

Universal (everyone has these)

Entry Path Icon Cleanable with mo clean?
Old Downloads (90d+) ~/Downloads (files >90 days) 📥 Manual — user decides what to keep
iOS Backups ~/Library/.../MobileSync/Backup 📱 Manual — manage in Finder/iTunes
System Caches ~/Library/Caches 💾 Yes — mo clean clears user caches
System Logs ~/Library/Logs 📋 Yes — mo clean clears old logs
Homebrew Cache ~/Library/Caches/Homebrew 💾 Yes — brew cleanup / mo clean

Developer-specific (only shown if installed)

Entry Path Icon Cleanable with mo clean?
Xcode DerivedData ~/Library/Developer/Xcode/DerivedData 🔨 Yes — safe to delete, rebuilds on next build
Xcode Simulators ~/Library/Developer/CoreSimulator/Devices 📲 xcrun simctl delete unavailable
Xcode Archives ~/Library/Developer/Xcode/Archives 🔨 Manual — old build archives
Docker Data ~/Library/Containers/com.docker.docker/Data 🐳 docker system prune
Spotify Cache ~/Library/.../Spotify/PersistentCache 💾 Yes — mo clean handles app caches
JetBrains Cache ~/Library/Caches/JetBrains 💾 Yes — safe to delete
pip Cache ~/Library/Caches/pip 💾 pip cache purge
Gradle Cache ~/.gradle/caches 💾 Manual — gradle cleanBuildCache
CocoaPods Cache ~/Library/Caches/CocoaPods 💾 pod cache clean --all

Behavior

  • Entries only appear if their path exists on the machine
  • All entries open normally in analyze's directory view on Enter
  • Scanned concurrently alongside standard overview entries
  • 🧹 icon shown next to cleanable entries

Visual preview

  Analyze Disk
  Select a location to explore:

 ▶  1. ████████████████  45.2%  |  📁 Home                    210.5 GB
    2. ██████████░░░░░░  28.1%  |  📁 App Library             131.0 GB
    3. ████░░░░░░░░░░░░  10.3%  |  📁 Applications             48.0 GB
    4. ██░░░░░░░░░░░░░░   4.8%  |  📁 System Library           22.4 GB
    5. ██░░░░░░░░░░░░░░   3.2%  |  📲 Xcode Simulators         11.2 GB
    6. █░░░░░░░░░░░░░░░   2.4%  |  🔨 Xcode DerivedData         9.8 GB  🧹
    7. █░░░░░░░░░░░░░░░   2.1%  |  🐳 Docker Data               8.4 GB
    8. █░░░░░░░░░░░░░░░   1.8%  |  📥 Old Downloads (90d+)      7.0 GB
    9. █░░░░░░░░░░░░░░░   1.1%  |  💾 System Caches             4.2 GB  🧹
   10. ░░░░░░░░░░░░░░░░   0.4%  |  📱 iOS Backups               1.8 GB
   11. ░░░░░░░░░░░░░░░░   0.2%  |  💾 Homebrew Cache             0.9 GB  🧹
   12. ░░░░░░░░░░░░░░░░   0.1%  |  📋 System Logs               0.5 GB  🧹

Test plan

  • go build ./cmd/analyze/ — compiles cleanly
  • go vet ./cmd/analyze/ — no issues
  • go test ./cmd/analyze/ — all tests pass
  • New tests: TestCreateInsightEntries, TestInsightIcon, TestMeasureOldDownloads, TestMeasureInsightSizeFallsBackToOverview
  • Entries only appear when their path exists

Add insight entries to the analyze overview that surface disk usage
in commonly overlooked locations:

- iOS Backups (~/Library/.../MobileSync/Backup)
- Old Downloads (files >90 days in ~/Downloads)
- Mail Data (~/Library/Mail)
- Xcode DerivedData, Spotify Cache, JetBrains Cache, Docker Data
- node_modules total (scans all projects under home)
- Time Machine local snapshots

Each insight entry appears alongside the standard overview entries with
a distinctive icon. Virtual entries (node_modules total, Time Machine)
cannot be navigated into. All others open in the regular analyze view.
@sebastianbreguel sebastianbreguel requested a review from tw93 as a code owner April 1, 2026 03:56
Expand insight entries with cleanable paths that mo clean can handle:
- Trash, System Caches, System Logs, Homebrew Cache (universal)
- Xcode Simulators, Xcode Archives, pip/Gradle/CocoaPods cache (dev)

Only shown when the path exists on the machine.
Remove node_modules (all), Time Machine Local, Trash, and Mail Data
insight entries that fail due to permission-denied errors from du/find.
@tw93 tw93 merged commit a20d8bf into tw93:main Apr 1, 2026
9 checks passed
@tw93
Copy link
Copy Markdown
Owner

tw93 commented Apr 1, 2026

@sebastianbreguel Thanks for this, the hidden-space insight idea is solid and fits naturally into the overview.

Merged with two small follow-up fixes in 81c36e4:

  • Removed System Caches from the insight list. Since Homebrew Cache, JetBrains Cache, pip Cache, and CocoaPods Cache are all subdirectories of ~/Library/Caches, listing the parent alongside them was double-counting the same bytes in the visual percentages.
  • Hide zero-size entries after scanning. On machines that have never used Xcode Archives, Xcode DerivedData, or have no old downloads, those rows showed 0 B and added noise without providing actionable information. They are now filtered from the view once scanning completes.

The result is a cleaner list that only surfaces entries worth acting on.

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.

2 participants