Fix GitHub import subdirectory handling#443
Conversation
Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
📋 PR Overview
🔬 Coverage
|
🎨 Storybook previewUpdated for 77c515a ❌ Failed snapshots (1)These stories' HTML snapshots changed. Update snapshots ↗ to regenerate baselines and open a PR: Widget/DarwinWidget › Onboarding With DirectoryAccept changes
What does this do?The screenshots above show UI changes detected by the Storybook Checking the box tells the Comparison baseline: the committed |
|
/bot review this code |
|
/oc review this code |
1 similar comment
|
/oc review this code |
|
/bot review code |
|
/dm review code |
|
/oc review code |
|
/dm review this PR |
Code review — PR #443Reviewing 🔴 Must fix before merge1. The placeholder example was changed from the project repo to a personal one: - A public GitHub repo, e.g. <span className="font-mono">github.com/darkmatter/nixmac</span>.
+ A public GitHub repo, e.g. <span className="font-mono">czxtm/darwin</span>.
2. The PR adds - Add <span>?ref= and/or ?dir=</span> to clone a specific branch or use a subdirectory.
+ Add <span>#branch</span> to clone a specific branch.This contradicts the feature being shipped. The develop branch already has the correct 3.
🟡 Worth addressing4. The function was moved from 5. The fix "Fix git status diff dropping +/-/space line origin markers" (#439) landed in 6. The helper function and its tests were removed; managed-state setup is now duplicated between CLI and GUI paths without test coverage. The duplication itself is low risk (8 lines each), but the lack of tests means future unintentional divergence won't be caught. Consider at minimum a comment noting they must stay in sync. ✅ What's good
|

Summary
owner/repo?dir=hosts/workparseddirbut still finalized the active config directory to the repository root.RepoRef.subdirwas populated byparse_repo_ref, butconfig_import_githubmoved the spec into the clone task and always calledfinalize_imported_dir(&target)afterward.flake.nixin that subdir, and finalize app state to that resolved path.detect_username()unwrappedwhoami::username()before falling back toUSER/unknown.unused = deny.Test Plan
cargo +stable test --manifest-path "apps/native/src-tauri/Cargo.toml" bootstrap::import::testscargo +stable test --manifest-path "apps/native/src-tauri/Cargo.toml" commands::config::testscargo +stable test --manifest-path "apps/native/src-tauri/Cargo.toml" bootstrap::default_config::testscargo +stable test --manifest-path "apps/native/src-tauri/Cargo.toml"(501 passed; 2 ignored)Docs