Repository navigation
fix: open the app from Spotlight while the service runs, and count disk cleanup as reclaimable - #82
Merged
Merged
Conversation
…sk cleanup as reclaimable Opening Driga from Spotlight, Finder or `open -a` showed no window. The service runs from inside Driga.app with the app's bundle identity so it can post notifications, and it registered with Launch Services as a visible foreground app. Launch Services then activated the windowless service instead of starting the app. The service now sets the prohibited (background-only) activation policy on the main thread, so it never counts as the running app; notifications keep working. The header's Reclaimable tile always read 0. It summed the memory of leftover process trees, the same number Leftover shows, while Chat reported disk a cleanup would free. Reclaimable now sums the size of cleanup candidates that are ready to remove. Sizes were only measured on demand, so the app measures ready candidates in the background, two at a time with the existing 30 s cap, refreshing about every 10 minutes. The tile shows unknown, not 0, until every ready candidate is measured. Claude-Session: https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4
4 of 5 tasks
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.
What changed
Two fixes from using
v2026.10.22-alpha. Opening Driga from Spotlight, Finder oropen -anow starts the app instead of focusing the windowless service. The header's Reclaimable tile now shows the disk a cleanup would free, measured in the background, instead of always 0.Why
drigadruns from inside Driga.app with its bundle identity, for notifications.lsappinfolisted it astype="Foreground", and System Events as visible, so Launch Services activated it instead of launching the app. ItssetActivationPolicy:call ran off the main thread and asked for Accessory. It now asks for Prohibited (background-only) on the main thread. Routing notifications through the GUI was rejected: the service must notify while the app is closed.size_bytesofreadycleanup candidates. Sizes were only measured on demand (--sizes), so the app measures ready candidates off the request path: two walks at a time, the existing 30 s cap, refreshed about every 10 minutes. It shows unknown until measured.Risk and rollout
readycandidates with bounded concurrency and the existing per-walk cap. Report-only and refused candidates are never walked.reclaimwidget until the header is reset.Contract changes
reclaimwidget is nowcleanupsum:size_byteswherestatus = ready, instead ofsummarysum:reclaim_bytes.summary.reclaim_bytesitself is unchanged.Verified
drigadwith a temporary data dir:lsappinforeportstype="BackgroundOnly", and System Events reports background onlytrue, visiblefalse. Notification status reports native, not yet asked.driga dev serve, Reclaimable was unknown at 10 s and 183,810,516 bytes at 20 s. That matchesdriga cleanup list --kind scratch --sizesfor the 12 ready candidates exactly.go test ./...passes exceptTestPermissionHookBuiltBinary(fails onmainon this Mac) and oneTestExternalPeersListenerSelftimeout. That test is in a package this PR doesn't touch, and it passed on two reruns.GOOS=linux go build ./...andGOOS=windows go vet ./...pass.bun run design-check1,212 browser tests.https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4