feat: add homebrew_add_casks managed-edit command and wire up direct tracking in the filesystem UI#393
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
homebrew_add_casks managed-edit command and wire up direct tracking in the filesystem UI
📋 PR Overview
🔬 Coverage
|
🎨 Storybook previewUpdated for ab39538 🧭 Story changesCompared to 🆕 New stories (1) |
There was a problem hiding this comment.
Pull request overview
This PR adds a fast-path for “tracking” untracked Homebrew casks by performing a direct managed edit (writing into the .nixmac/homebrew/data.json module + entering the managed review flow) instead of routing through the agent, and wires that flow into the Filesystem UI.
Changes:
- Added a new Tauri command (
homebrew_add_casks) and shared IPC type (HomebrewCaskItem) to support direct managed edits for adopting casks. - Refactored Homebrew managed-edit helpers to return the managed module data-file path and added unit tests around module creation + cask adoption.
- Updated the Filesystem UI to call the new IPC route for the “Untracked Homebrew” section, with per-item/all-item tracking UX.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/native/src/ipc/types.ts | Regenerated Specta types to include HomebrewCaskItem. |
| apps/native/src/ipc/api.ts | Added tauriAPI.homebrew.addCasks() IPC wrapper. |
| apps/native/src/components/widget/steps/snapshots/setup-step.stories.tsx.snap | Added/updated Vitest snapshot output. |
| apps/native/src/components/widget/filesystem/untracked-card.tsx | Added async tracking state/error UI and optional direct Homebrew cask tracking hook. |
| apps/native/src/components/widget/filesystem/filesystem-step.tsx | Wired Filesystem step to call homebrew_add_casks and mirror returned evolve/git/change-map state. |
| apps/native/src/components/widget/filesystem/file-list.tsx | Plumbed onTrackHomebrewCasks prop down to UntrackedCard. |
| apps/native/src/components/widget/filesystem/data.ts | Extended CandidateItem with optional version; added versions to Homebrew sample items. |
| apps/native/src-tauri/src/shared_types/managed_edits.rs | Introduced Rust shared type HomebrewCaskItem for IPC. |
| apps/native/src-tauri/src/shared_types.rs | Re-exported the new shared managed-edits types module. |
| apps/native/src-tauri/src/managed_edits/homebrew_adopt.rs | Implemented add_homebrew_casks managed-edit path + refactoring and unit tests. |
| apps/native/src-tauri/src/main.rs | Registered the new homebrew_add_casks Tauri command handler. |
| apps/native/src-tauri/src/commands/homebrew.rs | Added the homebrew_add_casks command implementation. |
| apps/native/src-tauri/examples/specta_gen_ts.rs | Registered HomebrewCaskItem for TS type generation. |
ff07df0 to
ab39538
Compare
Merge activity
|

Summary
When you choose to "track" untracked Homebrew items either individually or as a section, use direct managed edits instead of the agent, which is 1000x faster and more reliable. I should note that it also routes you through the
.nixmacdirectory path which the agent generally won't do. This seems like a possible area for a broader discussion Farhan (@fkb032) cooper (@czxtm)To enable this, I did some fairly minor refactoring of the existing Homebrew code. So extending this high-level approach to "defaults" and "startup items" will be more work as we'll need to add analogous helper code for it (where it already existed for brew).
Test Plan
Couple of new unit tests, plus manual testing.
Docs