Skip to content

add enabled field on projects to disable without losing config#23

Merged
MaceWindu merged 1 commit into
masterfrom
feat/project-enabled-field
May 17, 2026
Merged

add enabled field on projects to disable without losing config#23
MaceWindu merged 1 commit into
masterfrom
feat/project-enabled-field

Conversation

@MaceWindu
Copy link
Copy Markdown
Owner

Summary

  • Adds optional "enabled": boolean on projects[] entries (default true, mirroring tools.<name>.enabled). When false, reconcile tears down the materialized infrastructure (bare mirror or per-project bin dir + every session + any host fstab entries) but the profile entry survives so tabColor / defaultBranch / hostShadows etc. are preserved. Re-enable and reconcile to recreate.
  • project dashboard gains t <n> toggle. Invoke-Reconcile honors -Force so scripted reconciles can apply without the interactive prompt.
  • Invoke-ProjectsApply properly tears down per-session host worktrees in the disable case (where the profile entry is still around with hostCheckout), so Windows-side worktrees aren''t orphaned.

Test plan

  • .\test-claudearium.ps1 -ParseCheck (67 files clean)
  • .\test-claudearium.ps1 -Auto -Only pure -CI (350/350, +9 new)
  • Distro lane via CI — covers the add→disable→reconcile→re-enable→reconcile round-trip
  • Manual: project dashboard t <n> flips the Enabled column and prompts to run reconcile

🤖 Generated with Claude Code

Optional `"enabled": boolean` on `projects[]` entries (default true,
mirroring `tools.<name>.enabled`). When false, reconcile tears down the
materialized infrastructure — bare mirror for distroProject, per-project
bin dir for hostProject, every session of the project, plus any host
fstab entries those sessions contributed — but the profile entry stays
intact so `tabColor`, `defaultBranch`, `hostShadows`, etc. survive.
Re-enable later and the next reconcile recreates everything.

- modules/Profile.psm1: Test-ProjectEnabled helper (mirrors
  Test-ToolEntryEnabled), enabled-aware Get-ProjectsDiff that splits
  desired into enabled/disabled before computing add/remove, validation
  that `enabled` is a boolean.
- modules/Projects.psm1: Set-ProjectEnabledInProfile helper for the
  dashboard toggle action; preserves %ENV% tokens via Read-Profile -Raw.
- claudearium.ps1: project dashboard gains a `t <n>` toggle action.
  Invoke-ProjectsApply's `remove` branch now runs per-session
  Remove-HostSession when the disabled entry is still in the profile
  (so Windows-side worktrees aren't orphaned) and refreshes fstab via
  Invoke-MergedMountsApply when any host teardown happened.
- claudearium.ps1: Invoke-Reconcile honors -Force to bypass the apply
  prompt, making scripted reconcile runs (CI / tests / power users)
  practical. The rendered diff still prints first.
- Tests: 4 new pure diff cases, 2 validation cases, 1 Test-ProjectEnabled
  unit test, plus a distro round-trip that adds → disables → reconciles
  → asserts mirror gone + profile entry survives → re-enables →
  reconciles → asserts mirror back.
- Docs: usage.md (dashboard `t`, disable semantics), cookbook.md (recipe),
  design-decisions.md §23 (why disable preserves config, why it removes
  sessions, why reconcile still prompts).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 17, 2026 21:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MaceWindu MaceWindu merged commit 70451b1 into master May 17, 2026
8 of 9 checks passed
@MaceWindu MaceWindu deleted the feat/project-enabled-field branch May 17, 2026 21:44
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