feat: add GPU utilization readout to the menu bar - #4
Open
impiri wants to merge 2 commits into
Open
Conversation
The detached disk-benchmark Task in DiskSpeedTester.start() declared [weak self] on its nested closures (the progress Task and the trailing MainActor.run) while self was captured strongly by the enclosing scope. Under the Swift 6.2 toolchain this raises #ImplicitStrongCapture and blocked the build entirely. Hoist a single [weak self] onto the detached Task and drop the redundant inner capture lists so the nested closures reuse the already-weak self. This matches the pattern already used elsewhere in the same type. Behavior is preserved — the security-scoped resource is still released before the weak-self guard — and as a bonus the detached benchmark no longer strongly retains DiskSpeedTester while running.
Surface GPU utilization as an optional menu-bar row, in both the stacked (compact) and horizontal layouts, colored .purple to match the popover and the GPU detail panel. - New "Show GPU" setting (default off) in Settings → Visible Items, with a live preview in both layouts, and exposed to Shortcuts via a BlipSettingDescriptor entry. - Reads monitor.snapshot.gpu.utilization, which is already plumbed from GPUMonitor (direct download) and the helper (App Store). Mirror the popover's helper gating: in the App Store build the row stays hidden until the helper is connected, since GPU utilization is helper-only there; the direct-download build always has it. The Settings preview is gated only on the toggle, since it's a layout demo, not live data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional GPU utilization row to the menu-bar readout (stacked and
horizontal layouts), and fixes a Swift 6.2 build blocker that was preventing
the project from compiling under the current Xcode toolchain.
Changes
feat(menubar): add GPU utilization readoutlive preview in both layouts, plus a
BlipSettingDescriptorentry soShortcuts can drive it.
monitor.snapshot.gpu.utilization(already plumbed fromGPUMonitoron direct download and the helper on App Store), colored.purpleto match the popover and the GPU detail panel.stays hidden until the helper is connected, since GPU utilization is
helper-only there; the direct-download build always shows it. The Settings
preview is gated only on the toggle (it's a layout demo, not live data).
fix(disk): resolve Swift 6.2 ImplicitStrongCapture in DiskSpeedTesterThe detached disk-benchmark
Taskdeclared[weak self]on its nestedclosures while
selfwas captured strongly by the enclosing scope, raising#ImplicitStrongCaptureand breaking the build under Swift 6.2. Hoists asingle
[weak self]onto the detachedTaskand drops the redundant innercapture lists. Behavior-preserving; also stops the benchmark from strongly
retaining
DiskSpeedTesterwhile it runs.Lands first so every commit on the branch builds.
Verification
Blip(direct download): builds clean, no warnings.BlipAppStore: builds clean (signing disabled locally to type-check the#if APPSTOREpath).BlipTests: 84/84 passing.Notes
Thanks for creating this! I find it useful to see the GPU at a glance, so this PR adds it as an option. (Four items will fit in the menu bar, but it's kinda cramped; I swap disk space out for GPU.) Happy to make any adjustments necessary if you decide to add this feature.