Skip to content

Cas/reset evolve state on dirchange ENG-441#46

Open
Cas Linden (CasLinden) wants to merge 4 commits intomainfrom
cas/reset-evolve-state-on-dirchange
Open

Cas/reset evolve state on dirchange ENG-441#46
Cas Linden (CasLinden) wants to merge 4 commits intomainfrom
cas/reset-evolve-state-on-dirchange

Conversation

@CasLinden
Copy link
Copy Markdown
Contributor

@CasLinden Cas Linden (CasLinden) commented Apr 23, 2026

Summary

  • Recompute step and evolve state from actual git status of the new config dir
  • Return SetDirResult { dir, evolveState?, hosts? } from config_set_dir / config_pick_dir — frontend applies evolve state and host list immediately without extra round trips
  • Restart watcher + seed git status to fix git repo error propagation and missed flake detections
  • Browse picker now opens at parent of dir, not inside it
  • Host list unaffected when same dir is picked
  • BootstrapConfig detects whether flake.nix exists and whether the repo has any commits — offers "Make initial commit" instead of failing when a flake is present but uncommitted
  • bootstrap_default_config handles existing flake.nix — commits it in place rather than returning "directory is not empty"
  • After committing an existing single-host flake, that host is auto-selected
  • Bootstrap errors displayed inline below the button (not via global error banner, which the watcher can clobber)
  • Global error banner suppressed entirely on the setup step
  • Directory picker submits on Enter and only blurs if validation succeeds

Test Plan

  • Remove config dir → setup step; pick a dir with a valid flake → host selector shows (not bootstrap)
  • Change config dir in settings → watcher switches immediately, evolve state resets
  • Same dir re-selected → no state change
  • Browse opens at parent of currently selected dir
  • Cancelling Browse leaves state unchanged
  • Pick a dir with flake.nix and no git commits → "Make initial commit" button shown (not "Create Default Configuration")
  • Click "Make initial commit" → commit created, host auto-selected if flake has exactly one darwinConfiguration
  • Pick an empty dir → "Create Default Configuration" with hostname input shown
  • Pick a non-empty dir without flake.nix → bootstrap shows "Create Default Configuration" (not commit variant)
  • Bootstrap fails (e.g. non-empty dir without flake) → error shown inline below button, clears when a new dir is selected
  • Type a path in the directory input and press Enter → validates and blurs on success, stays focused on error

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).

📋 PR Overview

Lines changed 368 (+241 / -127)
Files 0 added, 12 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

Generated by 🚫 dangerJS against 7e6ffe7

Comment thread apps/native/src-tauri/src/commands.rs
@CasLinden Cas Linden (CasLinden) force-pushed the cas/reset-evolve-state-on-dirchange branch from 1643080 to d425c19 Compare April 24, 2026 05:46
@CasLinden Cas Linden (CasLinden) force-pushed the cas/reset-evolve-state-on-dirchange branch from d425c19 to 7e6ffe7 Compare April 24, 2026 05:48
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.

2 participants