From d10c320a35fa3d6e1c299f39c95b22465efec3d5 Mon Sep 17 00:00:00 2001 From: Rodolphe Date: Fri, 11 Sep 2026 17:00:08 -0400 Subject: [PATCH] fix(demo): end the startup terminal on the report, hide the chat sidebar Tested end to end in a fresh npm Codespace: - `postAttachCommand` ran `drift analyze` in a real terminal, so after the report it asked whether to file a GitHub issue or cut a branch. The startup terminal sat on that question with a needs-attention flag, one keypress from opening an issue on this repository. Stdin is now /dev/null, which the CLI treats as non-interactive: the report is where the command ends. - Codespaces opened the chat secondary sidebar by default, taking a third of the window and wrapping the terminal report mid-word. `workbench.secondarySideBar.defaultVisibility: hidden` keeps it closed. Also corrects the `--dir` comment: the subdirectory bug it described was fixed in @usedrift/cli 0.1.2. Co-Authored-By: Claude Opus 5 --- .devcontainer/arduino/devcontainer.json | 3 ++- .devcontainer/cargo/devcontainer.json | 3 ++- .devcontainer/cocoapods/devcontainer.json | 3 ++- .devcontainer/conan/devcontainer.json | 3 ++- .devcontainer/go/devcontainer.json | 3 ++- .devcontainer/hex/devcontainer.json | 3 ++- .devcontainer/maven/devcontainer.json | 3 ++- .devcontainer/npm/devcontainer.json | 3 ++- .devcontainer/nuget/devcontainer.json | 3 ++- .devcontainer/opam/devcontainer.json | 3 ++- .devcontainer/packagist/devcontainer.json | 3 ++- .devcontainer/pub/devcontainer.json | 3 ++- .devcontainer/pypi/devcontainer.json | 3 ++- .devcontainer/rubygems/devcontainer.json | 3 ++- .devcontainer/swift/devcontainer.json | 3 ++- .devcontainer/vcpkg/devcontainer.json | 3 ++- scripts/lib/devcontainer-spec.mjs | 25 +++++++++++++++-------- 17 files changed, 48 insertions(+), 25 deletions(-) diff --git a/.devcontainer/arduino/devcontainer.json b/.devcontainer/arduino/devcontainer.json index ebc68da..4ea4fe6 100644 --- a/.devcontainer/arduino/devcontainer.json +++ b/.devcontainer/arduino/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "pipx install platformio && node scripts/prepare-demo.mjs arduino && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/cargo/devcontainer.json b/.devcontainer/cargo/devcontainer.json index 0300d34..d013f3d 100644 --- a/.devcontainer/cargo/devcontainer.json +++ b/.devcontainer/cargo/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": ".devcontainer/cargo/setup.sh && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/cocoapods/devcontainer.json b/.devcontainer/cocoapods/devcontainer.json index 9cabd20..46f3500 100644 --- a/.devcontainer/cocoapods/devcontainer.json +++ b/.devcontainer/cocoapods/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "gem install cocoapods --no-document && node scripts/prepare-demo.mjs cocoapods && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/conan/devcontainer.json b/.devcontainer/conan/devcontainer.json index 978c056..1190772 100644 --- a/.devcontainer/conan/devcontainer.json +++ b/.devcontainer/conan/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "pipx install conan && node scripts/prepare-demo.mjs conan && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/go/devcontainer.json b/.devcontainer/go/devcontainer.json index 77ed1d2..c3f0ad8 100644 --- a/.devcontainer/go/devcontainer.json +++ b/.devcontainer/go/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs go && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/hex/devcontainer.json b/.devcontainer/hex/devcontainer.json index 69ce504..56b8d02 100644 --- a/.devcontainer/hex/devcontainer.json +++ b/.devcontainer/hex/devcontainer.json @@ -16,13 +16,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs hex && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/maven/devcontainer.json b/.devcontainer/maven/devcontainer.json index a317643..fb36e0f 100644 --- a/.devcontainer/maven/devcontainer.json +++ b/.devcontainer/maven/devcontainer.json @@ -19,13 +19,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs maven && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/npm/devcontainer.json b/.devcontainer/npm/devcontainer.json index 1035846..27c83ee 100644 --- a/.devcontainer/npm/devcontainer.json +++ b/.devcontainer/npm/devcontainer.json @@ -10,13 +10,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs npm && npm --prefix demos/npm install --no-audit --no-fund && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/nuget/devcontainer.json b/.devcontainer/nuget/devcontainer.json index bfb59e1..b70bd9f 100644 --- a/.devcontainer/nuget/devcontainer.json +++ b/.devcontainer/nuget/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs nuget && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/opam/devcontainer.json b/.devcontainer/opam/devcontainer.json index a220e2c..ccbe3b5 100644 --- a/.devcontainer/opam/devcontainer.json +++ b/.devcontainer/opam/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs opam && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/packagist/devcontainer.json b/.devcontainer/packagist/devcontainer.json index 7534964..275c81c 100644 --- a/.devcontainer/packagist/devcontainer.json +++ b/.devcontainer/packagist/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs packagist && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/pub/devcontainer.json b/.devcontainer/pub/devcontainer.json index 0c6639b..c07e87d 100644 --- a/.devcontainer/pub/devcontainer.json +++ b/.devcontainer/pub/devcontainer.json @@ -16,13 +16,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs pub && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/pypi/devcontainer.json b/.devcontainer/pypi/devcontainer.json index a16103f..8fc7e5f 100644 --- a/.devcontainer/pypi/devcontainer.json +++ b/.devcontainer/pypi/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs pypi && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/rubygems/devcontainer.json b/.devcontainer/rubygems/devcontainer.json index c762af8..8bc1289 100644 --- a/.devcontainer/rubygems/devcontainer.json +++ b/.devcontainer/rubygems/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs rubygems && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/swift/devcontainer.json b/.devcontainer/swift/devcontainer.json index 1fd972e..d12b52b 100644 --- a/.devcontainer/swift/devcontainer.json +++ b/.devcontainer/swift/devcontainer.json @@ -16,13 +16,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs swift && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/.devcontainer/vcpkg/devcontainer.json b/.devcontainer/vcpkg/devcontainer.json index 1f60756..514b7a0 100644 --- a/.devcontainer/vcpkg/devcontainer.json +++ b/.devcontainer/vcpkg/devcontainer.json @@ -15,13 +15,14 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs vcpkg && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "drift analyze", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ "drift.usedrift" ], "settings": { + "workbench.secondarySideBar.defaultVisibility": "hidden", "drift.session.mode": "ask", "drift.analysis.runOnStartup": true, "drift.ui.openOnStartup": true, diff --git a/scripts/lib/devcontainer-spec.mjs b/scripts/lib/devcontainer-spec.mjs index 6c5597c..5512f81 100644 --- a/scripts/lib/devcontainer-spec.mjs +++ b/scripts/lib/devcontainer-spec.mjs @@ -121,19 +121,26 @@ export function buildDevcontainer(demo, allDemos) { // terminal in the editor: the CLI half of the demo, showing itself without // being asked. // - // Deliberately *not* `--dir ${demo.dir}`. Pointing the CLI at a - // subdirectory of the git root makes it report every dependency as removed - // rather than upgraded — `git status --porcelain` prints paths relative to - // the repository root, and Drift replays them as pathspecs from the - // analysis directory, so `demos/npm/package.json` is looked for at - // `demos/npm/demos/npm/package.json`. Run from the root instead, where - // only this demo's manifest is dirty, so exactly one change is detected - // anyway. - postAttachCommand: 'drift analyze', + // Run from the repository root rather than with `--dir ${demo.dir}`: only + // this demo's manifest is dirty, so the root detects exactly the one change + // anyway, and it is the command a visitor would type themselves. (Before + // @usedrift/cli 0.1.2, `--dir` below the git root also reported every + // dependency as removed; that is fixed, but nothing here needs the flag.) + // + // Stdin is /dev/null so the report is where the command ends. In a + // terminal, `drift analyze` follows a breaking change with an offer to file + // a GitHub issue or cut a branch for it, and here that parked the startup + // terminal on a question, flagged it as needing attention, and left the + // visitor one keypress from opening an issue on this repository. + postAttachCommand: 'drift analyze < /dev/null', customizations: { vscode: { extensions: ['drift.usedrift'], settings: { + // Codespaces opens the chat sidebar by default, which takes a third + // of the window from the Drift panel and wraps the terminal report + // mid-word. The demo is those two; the chat is a click away. + 'workbench.secondarySideBar.defaultVisibility': 'hidden', // Analysis-oriented: Drift explains, it does not edit. No agent, API // key or GitHub auth involved. 'drift.session.mode': 'ask',