fix: refresh command auto-activates newly discovered projects#73
Conversation
After `bd init` in an existing workspace, the refresh command discovered the new project but never activated it, leaving views empty. Mirror the auto-activation logic from `initialize()` so the first discovered project becomes active. Fixes: #64 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughA new investigation document analyzes Issue Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@sandbox/issue-64-investigation.md`:
- Around line 3-6: Update the investigation doc to remove the stale claim that
discovered projects aren’t auto-activated: change the status/summary
table/“Remaining Gap” text to reflect that auto-activation is implemented, and
cite the implementation in the BeadsProjectManager class (the
discovery/activation method) as the source of truth; remove or reword the lines
that assert auto-activation is missing so the write-up no longer contradicts the
current code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 71000f61-0bf8-41d2-9a0c-dc644d5d8ef4
📒 Files selected for processing (2)
sandbox/issue-64-investigation.mdsrc/backend/BeadsProjectManager.ts
| ## Status: Partially Fixed | ||
|
|
||
| The original bug (early-return preventing discovery) was fixed in the v0.13.0 refactor. A secondary gap remains: discovered projects aren't auto-activated. | ||
|
|
There was a problem hiding this comment.
Doc is now stale relative to the code in this PR.
Line 3 and the “Remaining Gap”/summary table still say auto-activation is missing, but src/backend/BeadsProjectManager.ts (Line 121-Line 123) now implements it. Please update this write-up to avoid future confusion.
📝 Suggested doc update
-## Status: Partially Fixed
+## Status: Fixed (for manual refresh flow)
-The original bug (early-return preventing discovery) was fixed in the v0.13.0 refactor. A secondary gap remains: discovered projects aren't auto-activated.
+The original bug (early-return preventing discovery) was fixed in the v0.13.0 refactor. This PR closes the secondary gap by auto-activating the first discovered project during refresh when no active project exists.
...
-## Remaining Gap
+## Previous Gap (now addressed in this PR)
...
-| New projects auto-activated | No | No (gap remains) |
+| New projects auto-activated | No | Yes (fixed in this PR) |Also applies to: 54-63, 106-111
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@sandbox/issue-64-investigation.md` around lines 3 - 6, Update the
investigation doc to remove the stale claim that discovered projects aren’t
auto-activated: change the status/summary table/“Remaining Gap” text to reflect
that auto-activation is implemented, and cite the implementation in the
BeadsProjectManager class (the discovery/activation method) as the source of
truth; remove or reword the lines that assert auto-activation is missing so the
write-up no longer contradicts the current code.
Summary
bd initin an existing workspace folder, the "Beads: Refresh" command discovered the new project but never activated it — views stayed emptyrefresh()now auto-activates the first discovered project when no project is active, mirroring the existinginitialize()behaviorBeadsProjectManager.refresh()Fixes #64
Test plan
.beads/directorybd initin the terminalSummary by CodeRabbit
Release Notes