Skip to content

VS Code extension: native sandbox/log features, user-facing settings#208

Merged
clavery merged 2 commits intomainfrom
feature/vscode-spikes-2
Mar 3, 2026
Merged

VS Code extension: native sandbox/log features, user-facing settings#208
clavery merged 2 commits intomainfrom
feature/vscode-spikes-2

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Feb 25, 2026

Summary

Continues the VS Code extension's migration from webview panels to native VS Code patterns, and adds the first user-facing contributes.configuration settings.

Native TreeView conversions & new features

  • Sandbox Explorer — replaces ods-management.html webview with a native TreeView showing realm → sandbox hierarchy. Includes lifecycle commands (create, delete, start, stop, restart, view details, open BM) with state-aware icons and automatic polling during transitions.
  • Log Tailing — new feature streaming instance logs to a VS Code output channel via b2c-dx.logs.startTail / stopTail commands.
  • Instance Management — new status bar item showing the active B2C instance (name or hostname). Click to switch between instances configured in dw.json. b2c-dx.instance.inspect opens the resolved config as a read-only JSON document (with secrets redacted). Auto-updates when dw.json changes.
  • Removed webviewsods-management.html, storefront-next-cartridge.html deleted; functionality replaced by native commands/views.

User-facing settings (contributes.configuration)

All under the b2c-dx namespace (Settings UI → Extensions → B2C DX):

Setting Type Default Description
b2c-dx.features.sandboxExplorer boolean true Enable Sandbox Explorer sidebar
b2c-dx.features.webdavBrowser boolean true Enable WebDAV Browser
b2c-dx.features.contentLibraries boolean true Enable Content Libraries browser
b2c-dx.features.logTailing boolean true Enable log tailing commands
b2c-dx.logLevel enum info SDK log verbosity (tracesilent); replaces hardcoded trace
b2c-dx.sandbox.pollingInterval number 10 Seconds between sandbox state polls

Feature toggles conditionally skip register*() calls at activation. Log level reacts to onDidChangeConfiguration for live updates.

SDK changes

  • Added realm field to DwJsonConfig, NormalizedConfig, and config mapping/merge so sandbox operations can read a default realm from dw.json.

Test plan

  • pnpm --filter b2c-vs-extension run typecheck:agent passes
  • pnpm --filter b2c-vs-extension run lint:agent passes
  • Settings UI: search "b2c-dx" → all 6 settings appear with correct types/defaults/descriptions
  • Toggle b2c-dx.features.sandboxExplorer to false, reload → Sandbox Explorer view not registered
  • Change b2c-dx.logLevel to warn → output channel stops showing trace/debug/info
  • Instance status bar: shows active instance name, click → quick pick to switch instances
  • b2c-dx.instance.inspect → opens redacted config JSON in editor
  • Sandbox Explorer: add realm, expand → sandboxes listed with state icons
  • Sandbox lifecycle: start/stop/restart trigger polling with configured interval
  • Log tailing: start tail → logs stream to "B2C Logs" output channel; stop tail → streaming stops

Replace ODS sandbox management and storefront-next-cartridge webviews
with native TreeView + commands pattern. Add log tailing feature. Add
contributes.configuration settings for feature toggles, log level, and
sandbox polling interval. Add realm config support to SDK.

- Sandbox Explorer: native TreeView with realm/sandbox hierarchy,
  lifecycle commands (create, delete, start, stop, restart), polling
- Log Tailing: start/stop commands streaming to output channel
- Settings (b2c-dx.*): feature enable/disable, logLevel (replaces
  hardcoded trace), sandbox.pollingInterval
- SDK: realm field in dw.json / NormalizedConfig
- Removed: ods-management.html, storefront-next-cartridge.html
@clavery clavery requested a review from wei-liu-sf as a code owner February 25, 2026 03:34
Tree-view commands that require a node argument (sandbox lifecycle,
webdav file ops, content export/remove) silently no-op when invoked
from F1. Add commandPalette when:false entries to hide them.
@clavery
Copy link
Collaborator Author

clavery commented Mar 3, 2026

bypassing; will demo WIP

@clavery clavery merged commit 824d83c into main Mar 3, 2026
5 checks passed
@clavery clavery deleted the feature/vscode-spikes-2 branch March 3, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant