Skip to content

fix: disk sizes like Finder and power on Macs without a battery - #114

Merged
henrikogaard merged 3 commits into
mainfrom
fix/disk-and-power
Oct 21, 2026
Merged

henrikogaard merged 3 commits into
mainfrom
fix/disk-and-power

Conversation

@henrikogaard

Copy link
Copy Markdown
Owner

Disk sizes

  • Capacity, free and used space use decimal units (1 GB = 1000^3) via a new fmt_disk_bytes: Overview card, Disk page and device detail, panel tile, nearly-full finding and alert. Memory stays binary. The menu-bar disk readout and widget export show rates and percentages only, so they are unchanged.
  • Free space reads NSURLVolumeAvailableCapacityForImportantUsageKey for / (Finder's available, purgeable included) and falls back to statfs when absent, zero or larger than the disk.
  • Disk page hero gets a used-versus-free bar.
  • Overview Disk card: headline, stats and sparkline now all describe activity (read + write); free, used and total sit beneath. Chosen over labelling the sparkline because the card has no caption slot and the sidebar and menu bar already show activity.

Power without a battery

  • When macOS confirms no battery, the Battery page is named Power (zap icon), stays in the sidebar, and shows whole-Mac power when reported, GPU power, CPU power from apps and the per-app list. Power card still opens this page. Smallest option: no new page or navigation.
  • Battery favorite and panel-tile choices are hidden on such Macs; a saved battery tile is dropped from the panel layout.
  • Whole-Mac power comes from the AppleSmartBattery service, which a desktop Mac lacks, so the page says so instead of showing a number. GPU and per-app power do not depend on a battery.

Verification

  • cargo test (also TIDEGAUGE_TEST_LANG=nb): 413 passed. cargo build --release ok. New tests: decimal formatting, free-space choice and fallback, page naming, choice filtering.
  • Native: this Mac, statfs free 582.3 GB (matches df -H), Finder-style free 613.3 GB (about 31 GB purgeable counted).
  • Skipped: rendered check pending (no GUI launched); not run on a desktop Mac. Repo-wide fmt and clippy already fail on main.

Disk capacity, free and used space use decimal units and count purgeable
space as available. The Overview Disk card shows activity throughout, and the
Disk page gains a used-versus-free bar. A Mac without a battery gets a Power
page with system, GPU and per-app power, and no Battery choices in settings.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:36:14.503320Z d5a2857 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5a2857c02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/menu_panel.rs Resolved
On a Mac without a battery a saved battery tile now shows as Power, and the
last-tile check in Settings counts only the tiles on offer.
# Conflicts:
#	CHANGELOG.md
#	src/settings.rs
#	src/ui.rs
@henrikogaard
henrikogaard merged commit e0e7e8f into main Oct 21, 2026
1 check passed
@henrikogaard
henrikogaard deleted the fix/disk-and-power branch October 21, 2026 12:05
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