Skip to content

feat: add homebrew_add_casks managed-edit command and wire up direct tracking in the filesystem UI#393

Open
Scott McMaster (scottmcmaster) wants to merge 2 commits into
developfrom
06-11-scott-homebrew-track-directly
Open

feat: add homebrew_add_casks managed-edit command and wire up direct tracking in the filesystem UI#393
Scott McMaster (scottmcmaster) wants to merge 2 commits into
developfrom
06-11-scott-homebrew-track-directly

Conversation

@scottmcmaster

@scottmcmaster Scott McMaster (scottmcmaster) commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

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 .nixmac directory 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.

  • No test plan needed

Docs

  • Docs updated (companion PR in darkmatter/nixmac-web: #___)
  • No docs update needed

Scott McMaster (scottmcmaster) commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • automerge - adds this PR to the back of the merge queue
  • urgent - for urgent changes, fast-track this PR to the front of 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.

@scottmcmaster Scott McMaster (scottmcmaster) changed the title scott-homebrew-track-directly feat: add homebrew_add_casks managed-edit command and wire up direct tracking in the filesystem UI Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

New Rust modules were added without tests. Consider adding a #[cfg(test)] mod tests { ... } block or a file under apps/native/src-tauri/tests/:

  • apps/native/src-tauri/src/shared_types/managed_edits.rs

📋 PR Overview

Lines changed 369 (+322 / -47)
Files 2 added, 11 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
No Test Plan Needed no
New UI components no
New Storybook stories no
New Rust modules yes (1)
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 25.4% 25.6% 24.4% 18.1%

Generated by 🚫 dangerJS against ab39538

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🎨 Storybook preview

Open Storybook preview

Updated for ab39538


🧭 Story changes

Compared to develop (snapshot diff at story level):

🆕 New stories (1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/native/src-tauri/src/shared_types/managed_edits.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@graphite-app

graphite-app Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 12, 11:52 PM UTC: czxtm added this pull request to the Graphite merge queue.
  • Jun 12, 11:54 PM UTC: CI is running for this pull request on a draft pull request (#407) due to your merge queue CI optimization settings.
  • Jun 12, 11:58 PM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI (build)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants