From 65888af92cad506e71bf9604caa050eb7240e48d Mon Sep 17 00:00:00 2001 From: Chrison Simtian Date: Sat, 15 Aug 2026 11:18:23 +1200 Subject: [PATCH] Mirror the Build view into the file Explorer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `fallout.buildExplorer`, a second home for the build targets docked in the Explorer, collapsed by default so it costs nothing until opened. It is the *same* provider instance, not a second one — so the graph is loaded once and a single refresh() updates both views. Registering a second instance would double the file watching and let the two drift apart. The view/title and view/item/context when-clauses now match either view, which is why the run/go-to inline actions work identically in both. Closes #10 Co-Authored-By: Claude Opus 5 --- package.json | 22 ++++++++++++++++++---- src/extension.ts | 3 +++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2dc82db..cb6e630 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "main": "./out/extension.js", "activationEvents": [ "onView:fallout.build", + "onView:fallout.buildExplorer", "workspaceContains:**/.fallout/temp/build-graph.json", "workspaceContains:**/.nuke/temp/build-graph.json" ], @@ -52,12 +53,25 @@ "icon": "media/fallout.svg", "contextualTitle": "Fallout" } + ], + "explorer": [ + { + "id": "fallout.buildExplorer", + "name": "Fallout Build", + "icon": "media/fallout.svg", + "contextualTitle": "Fallout", + "visibility": "collapsed" + } ] }, "viewsWelcome": [ { "view": "fallout.build", "contents": "No Fallout build graph found in this workspace.\nRun the build once to generate `build-graph.json`, then refresh.\n[Plan build (dry run)](command:fallout.planTarget)" + }, + { + "view": "fallout.buildExplorer", + "contents": "No Fallout build graph found in this workspace.\nRun the build once to generate `build-graph.json`, then refresh.\n[Plan build (dry run)](command:fallout.planTarget)" } ], "commands": [ @@ -96,24 +110,24 @@ "view/title": [ { "command": "fallout.showGraph", - "when": "view == fallout.build", + "when": "view == fallout.build || view == fallout.buildExplorer", "group": "navigation@1" }, { "command": "fallout.refreshTargets", - "when": "view == fallout.build", + "when": "view == fallout.build || view == fallout.buildExplorer", "group": "navigation@2" } ], "view/item/context": [ { "command": "fallout.runTarget", - "when": "view == fallout.build && viewItem == falloutTarget", + "when": "(view == fallout.build || view == fallout.buildExplorer) && viewItem == falloutTarget", "group": "inline@1" }, { "command": "fallout.goToTarget", - "when": "view == fallout.build && viewItem == falloutTarget", + "when": "(view == fallout.build || view == fallout.buildExplorer) && viewItem == falloutTarget", "group": "inline@2" } ], diff --git a/src/extension.ts b/src/extension.ts index 5ae8279..93b4f51 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -141,7 +141,10 @@ export function activate(context: vscode.ExtensionContext): void { watcher.onDidDelete(() => provider.refresh()); context.subscriptions.push( + // Same provider instance backs both the Fallout-container Build view and the + // mirrored Explorer dock — one graph, two homes; refresh() updates both. vscode.window.registerTreeDataProvider('fallout.build', provider), + vscode.window.registerTreeDataProvider('fallout.buildExplorer', provider), watcher, vscode.commands.registerCommand('fallout.refreshTargets', refreshAll), vscode.commands.registerCommand('fallout.runTarget', (item?: TargetItem) => {