feat(architecture): add multi-subproject awareness and automatic context resync
- Implemented subproject root resolution based on active editor hint - Added debounced event listener for active editor changes to trigger chip status updates - Updated sidebar provider to re-resolve active subproject root on every chip build - This ensures correct architecture context is injected when working in a monorepo or multi-root-style parent folder
This commit is contained in:
@@ -608,6 +608,20 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
if (!provider) return;
|
||||
await provider._openArchitectureDoc();
|
||||
}),
|
||||
// Re-resolve the active subproject when the user switches between files
|
||||
// in different subfolders. Debounced so rapid editor flicks don't churn
|
||||
// the chip / watcher. The actual resync is idempotent — if the active
|
||||
// subproject didn't change, nothing visible happens.
|
||||
(() => {
|
||||
let timer: NodeJS.Timeout | undefined;
|
||||
return vscode.window.onDidChangeActiveTextEditor(() => {
|
||||
if (!provider) return;
|
||||
if (timer) clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
provider!._sendArchitectureStatus().catch(() => { /* swallow — chip is best-effort */ });
|
||||
}, 400);
|
||||
});
|
||||
})(),
|
||||
// ── 1인 기업 (Company) Mode commands ──────────────────────────────────
|
||||
// Thin shells over sidebar-provider methods so the runtime owns all
|
||||
// state mutation (chip status, watcher lifecycle, agent persistence).
|
||||
|
||||
Reference in New Issue
Block a user