fix(sidebar): force architectureAutoAttach to true on explicit re-activation

Fixed a bug where architectureAutoAttach would stay false even after an explicit attach action due to incorrect nullish coalescing logic.
This commit is contained in:
g1nation
2026-05-14 01:50:19 +09:00
parent 8da9532ca1
commit c4abd3994c
+6 -1
View File
@@ -1082,7 +1082,12 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
const updated: ProjectProfile = {
...profile,
architectureDocPath: result.docPath,
architectureAutoAttach: profile.architectureAutoAttach ?? true,
// [BUGFIX] Previously used `?? true`, but `??` only fallbacks on null/undefined.
// After a user Detach, `architectureAutoAttach === false`, so `false ?? true`
// stays `false` and the chip stays "detached — click Attach to re-enable"
// forever no matter how many times the user clicks Attach. The activation
// path is an explicit user intent to re-enable, so force `true` here.
architectureAutoAttach: true,
architectureAutoUpdate: profile.architectureAutoUpdate ?? true,
architectureLastUpdated: now,
architectureLastScanSignature: result.scan.signature,