Repository navigation
Expand Mac system metrics and uptime tiles - #16
Conversation
fdussert
left a comment
There was a problem hiding this comment.
Thanks a lot for this, Florian! It's a solid contribution. The disk fix is a real improvement: on current main the Mac disk reads the sealed system volume (about 14 GB "used"), and picking /System/Volumes/Data gives the number people expect. The macmon reader is careful: fixed paths, execFile with an argument list, a timeout and maxBuffer, coalesced calls, a freshness check on the sample, and no made-up temperature when there is no sensor. A failed reading never takes the other metrics down with it, and the tests cover all of that. The uptime tile also belongs in core: it works on any Mac with nothing to install. Typecheck and the full test suite pass on my side.
Could you split this into two PRs?
- (a) Disk, RAM, swap and uptime on the system channel, the disk and memory tiles, and the uptime tile. This is plain macOS with nothing to install, and once the points below are fixed it should go in quickly. One commit per concern inside it would be ideal (system channel + disk/memory tiles, then the uptime tile).
- (b) macmon temperatures, as a separate PR, opt-in.
Running a third-party binary the user never pointed Fremkit at, even from fixed paths and even read-only, is something the core should only do when asked. Please put it behind an explicit setting (a checkbox in the admin, in the spirit of privacy.claudeAccountUsage), off by default, so nothing is spawned until the user turns it on.
For (a):
-
Disk tile layout regression (
widgets/disk/index.html). At the default 16×4 size (160 px) with three volumes, the bars vanish: in a flex column withoverflow-y:auto, the.barelements shrink to 0 height. The third volume is also clipped. On main, three volumes fit. The bold 24 px "N GB available" line under each volume roughly doubles the height of each row. Could the available space go into the existing muted row instead (for example "698 GB / 926 GB · 140 GB free"), with the centred layout kept? On APFS, several volumes in the same container also repeat the same free space, which is another reason to keep it compact. -
Disk numbers. On the Data volume,
usedcounts only that volume whilesizeis the whole container, so "698 GB / 926 GB" plus "140 GB available" doesn't add up. For the Mac disk, reportingused = size - availablewould be consistent. Note also thatdf/statfsleave out purgeable space, so the value will be lower than Finder's. A line in the docs would avoid surprises. -
Uptime widget conventions (
widgets/uptime/index.html). The frame already draws the tile title, so the widget should not draw its own "Uptime" heading and icon. Text written straight into the HTML is also against the "no text in the HTML" rule indocs/writing-widgets.md. Please usevar(--accent, #d9b36a)instead of the hard-coded teal, and addhtml.accent-fillrules so the note stays readable on an accent body. Formatting the CSS and JS like the other built-in widgets would make the tile much easier to maintain. -
Manifests. Please keep
widgets/disk/manifest.jsonandwidgets/memory/manifest.jsonin their original compact format and change only theversionline.widgets/uptime/manifest.jsondeclares min 8×3 and default 16×4 whiledocs/widgets.mdsays 8×4 and 8×4, so please align them. -
CHANGELOG. The new Uptime tile needs its own line, written for the person using Fremkit rather than in terms of the system channel. Please match the style of the existing entries (bold lead phrase). Several other open PRs also add lines under
## Unreleased, so expect a small rebase depending on merge order. -
Style.
normalizeDisksand the new tests are tightly packed; formatting them like the rest ofserver/would help.
For (b), on top of the opt-in:
-
Polling cost (
mac-thermals.ts). When the cache expires,poll()waits for macmon to sample (about 500 ms, and up to the 4 s timeout if it hangs), and that holds back the wholesystemchannel (CPU, RAM, disks). Could the reader refresh in the background and always return the cached value right away? -
gpuCelsiusisn't shown by any tile yet. Either show it or leave it out for now.
Thanks again! The disk and memory improvements are very welcome.
|
Thanks for the quick turnaround, Florian! This is much better: macmon is out, the disk tile keeps its bars with three volumes at 16×4, the Mac disk numbers add up, and the Uptime tile follows the widget conventions. Typecheck and the full suite pass on my side. A few things left before merging:
Thanks again, nearly there! |
46202e0 to
78c675a
Compare
fdussert
left a comment
There was a problem hiding this comment.
Thanks Florian — everything from the follow-up is in: two clean commits, no macmon left, the cpu docs restored, and the five-volume case now scrolls cleanly. Merging. Could you drop the macmon paragraph (and the old test count) from the PR description for the record?
|
Sorry Florian — #15 landed a minute before this one and the two now conflict (most likely the |
Normalize APFS Data volume capacity, expose free RAM and swap, and publish a guarded uptime reading on the system channel for future tiles. Co-Authored-By: Claude <noreply@anthropic.com>
Display the guarded system-channel reading with explicit loading, unavailable and stale states, and document the new tile. Co-Authored-By: Claude <noreply@anthropic.com>
78c675a to
cc60a79
Compare
What changes
The built-in system channel reports boot uptime, APFS-aware available disk space, available RAM and swap. The disk tile shows the startup disk's usable capacity without the sealed system volume's misleading 14 GB figure; the memory tile exposes available RAM and swap. A new Uptime tile shows time since the last boot. No third-party tool is needed.
The history has two commits: system channel with disk/memory tiles, then the Uptime tile. Optional macmon temperature sampling is separate in #22.
Validation
pnpm typecheckpnpm test(1,387 server tests and 385 UI tests after rebase on current main)pnpm buildThis branch was not installed on the live Edge. No real hardware temperature reading is claimed here.