fix(ui): skip invalid MacOSPref entries (empty domain/key) in snapshot editor#48
Merged
fullstackjam merged 2 commits intomainfrom Apr 22, 2026
Merged
Conversation
…editor A corrupted or old-format snapshot file can contain a MacOSPref entry with an empty Key (e.g. Domain="cirruslabs/cli", Key=""), which would render as "cirruslabs/cli." in the macOS Prefs tab instead of in Taps. Filter out any MacOSPref entry where Domain or Key is empty in NewSnapshotEditor, since every valid macOS preference requires both. The tap itself is already correctly shown in the Taps tab.
|
👋 Thanks for opening this pull request! Before merging:
@fullstackjam will review this soon. Thanks for contributing! 🚀 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
MacOSPrefentry with an emptyKey(e.g.Domain="cirruslabs/cli",Key=""), which caused that entry to appear in the macOS Prefs tab as"cirruslabs/cli."— visually indistinguishable from just"cirruslabs/cli"because the trailing dot is tiny and the"= ()"description renders in faint gray.Domainand a non-emptyKey. Entries missing either are now skipped when building the macOS Prefs tab inNewSnapshotEditor.cirruslabs/cli) is already correctly shown in the Taps tab fromsnap.Packages.Taps; only the phantomMacOSPrefentry is dropped.What changed
internal/ui/snapshot_editor.go: Changed pref-items loop from pre-allocated slice to append-with-guard, skipping anyMacOSPrefwhereDomain == ""orKey == "".internal/ui/snapshot_editor_test.go: AddedTestNewSnapshotEditorSkipsInvalidMacOSPrefsto cover tap-misclassified-as-pref entries, empty-domain entries, and valid new prefs.Test plan
make test-unitpassesopenboot snapshot captureand confirm no items appear in the macOS Prefs tab that look like Homebrew tapsmacos_prefsentry with emptykeyand confirm it is silently dropped from the macOS Prefs tab