Skip to content

Comments

VS Code extension: native TreeView, content libraries, plugin support, CI#186

Open
clavery wants to merge 18 commits intomainfrom
feature/vsc-ext-native-improvements
Open

VS Code extension: native TreeView, content libraries, plugin support, CI#186
clavery wants to merge 18 commits intomainfrom
feature/vsc-ext-native-improvements

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Feb 22, 2026

Summary

Unified PR combining feature branches into a single PR targeting main. Supersedes #174, #179, #182, and #185.

Native WebDAV TreeView (from #174)

  • Replace WebDAV Browser webview with a native VS Code TreeView
  • Add FileSystemProvider for reading/writing remote files directly in the editor
  • Add New File command and workspace folder mounting for WebDAV directories

Content Library Explorer (from #179)

  • Add content library explorer tree view to browse libraries, pages, content assets, and components
  • Support export (with/without assets) and import of site archives
  • Add filter/search and multi-library management

Plugin Support & Centralized Config (from #185)

  • Add B2C CLI plugin system to SDK (@salesforce/b2c-tooling-sdk/plugins)
  • Centralize config resolution in VS Code extension via B2CExtensionConfig provider
  • Initialize plugins at activation so plugin config sources and middleware are available before first resolveConfig() call
  • Unify content tree config with B2CExtensionConfig — eliminates duplicate config resolution, adds plugin support and dw.json file-watching to the content tree

VS Code Extension CI & Publish (from #182)

  • Separate CI workflow (ci-vs-extension.yml) for extension tests using xvfb-run, path-filtered to packages/b2c-vs-extension/**
  • Test compilation via tsconfig.test.json and pretest script
  • Fix self-referencing step condition bug in ci.yml; add typecheck + lint for extension
  • VSIX publish workflow with version detection, git tagging, and .vsix upload to GitHub releases

Test plan

  • Verify WebDAV tree view loads and browses remote files
  • Verify FileSystemProvider opens remote files in editor
  • Verify content library explorer shows libraries/pages/components
  • Verify export and import operations work
  • Verify plugin initialization runs at extension activation
  • Verify content tree uses centralized config (single config resolution, reacts to dw.json changes)
  • pnpm run typecheck:agent passes
  • pnpm run lint:agent passes
  • pnpm --filter @salesforce/b2c-tooling-sdk run test:agent passes
  • pnpm --filter b2c-vs-extension run build succeeds
  • CI workflow runs extension tests via xvfb-run

Replace the 561-line HTML webview (webdav.html) with a VS Code native
TreeDataProvider sidebar. This gives the extension its first Activity Bar
presence and provides collapsible tree browsing, context menus, keyboard
navigation, theming, and accessibility for free.

- Add Activity Bar container "B2C-DX WebDAV" with sidebar tree view
- Lazy-load directory contents via PROPFIND with caching
- Context menu commands: New Folder, Upload, Delete, Download, Open File
- Open files via temp storage with native VS Code editors (syntax
  highlighting, image viewer, etc.)
- Welcome view when no B2C instance is configured
- Replace "*" activation event with targeted onView activation
- Remove webdav.html and all inline webview message handling (~240 lines)
- Add WebDavFileSystemProvider with caching, stat/readDirectory/readFile/
  writeFile/createDirectory/delete operations against WebDAV
- Root path handling returns synthetic directory listing of the 9 well-known
  B2C Commerce roots (avoids PROPFIND on "/")
- Tree provider delegates to FS provider instead of calling WebDAV directly;
  root nodes use standard folder icons via resourceUri
- New File command: prompts for filename, creates empty file, opens in editor
- Mount/Unmount Workspace commands: add/remove b2c-webdav:/ as a VS Code
  workspace folder for native Explorer integration
- Context key b2c-dx.webdav.mounted tracks mount state for menu visibility
- Download command available in native Explorer context menu for b2c-webdav files
Change "Open as Workspace Folder" to operate on the right-clicked
node (root or directory) rather than mounting b2c-webdav:/ globally.
The workspace folder is named "WebDAV: <path>" for clarity.

Move mount command from view title bar to context menu. Remove
unmountWorkspace command and mounted context key tracking — VS Code's
native "Remove Folder from Workspace" handles unmounting.
- Native tree view for browsing B2C Commerce content libraries (pages,
  content assets, components, static assets) in the sidebar
- FileSystemProvider (b2c-content: scheme) for viewing/editing content XML
  with round-trip import via site archive jobs
- Export commands: Export, Export without Assets, Export Assets Only
- Import site archive from command palette or explorer context menu (B2C-DX submenu)
- Filter/search within library tree with toggle in title bar
- Click static assets to preview images via WebDAV filesystem
- Show job log in editor on import failure
- Sort content-link children by position element instead of XML document order
- Create separate CI workflow for extension tests using xvfb-run
  (path-filtered to packages/b2c-vs-extension/**)
- Add tsconfig.test.json and pretest script to compile test files
- Fix self-referencing step condition bug in ci.yml
- Add typecheck to main CI for the extension (catches SDK breakage)
- Add VSIX build, git tagging, and release upload to publish workflow
Replace 7 independent resolveConfigWithPlugins() call sites with a
single B2CExtensionConfig singleton that caches resolved config and
exposes getInstance()/getConfig()/getConfigError()/reset().

- Add dw.json file watcher (RelativePattern + onDidSaveTextDocument)
  that auto-resets config and fires onDidReset event
- WebDAV tree subscribes to onDidReset for automatic refresh on
  config changes
- Silently handle FileNotFound in tree re-expansion after server switch
- Delete WebDavConfigProvider (fully replaced by B2CExtensionConfig)
Replace the 561-line HTML webview (webdav.html) with a VS Code native
TreeDataProvider sidebar. This gives the extension its first Activity Bar
presence and provides collapsible tree browsing, context menus, keyboard
navigation, theming, and accessibility for free.

- Add Activity Bar container "B2C-DX WebDAV" with sidebar tree view
- Lazy-load directory contents via PROPFIND with caching
- Context menu commands: New Folder, Upload, Delete, Download, Open File
- Open files via temp storage with native VS Code editors (syntax
  highlighting, image viewer, etc.)
- Welcome view when no B2C instance is configured
- Replace "*" activation event with targeted onView activation
- Remove webdav.html and all inline webview message handling (~240 lines)
- Add WebDavFileSystemProvider with caching, stat/readDirectory/readFile/
  writeFile/createDirectory/delete operations against WebDAV
- Root path handling returns synthetic directory listing of the 9 well-known
  B2C Commerce roots (avoids PROPFIND on "/")
- Tree provider delegates to FS provider instead of calling WebDAV directly;
  root nodes use standard folder icons via resourceUri
- New File command: prompts for filename, creates empty file, opens in editor
- Mount/Unmount Workspace commands: add/remove b2c-webdav:/ as a VS Code
  workspace folder for native Explorer integration
- Context key b2c-dx.webdav.mounted tracks mount state for menu visibility
- Download command available in native Explorer context menu for b2c-webdav files
Change "Open as Workspace Folder" to operate on the right-clicked
node (root or directory) rather than mounting b2c-webdav:/ globally.
The workspace folder is named "WebDAV: <path>" for clarity.

Move mount command from view title bar to context menu. Remove
unmountWorkspace command and mounted context key tracking — VS Code's
native "Remove Folder from Workspace" handles unmounting.
…to feature/vsc-ext-native-improvements

# Conflicts:
#	packages/b2c-vs-extension/package.json
#	packages/b2c-vs-extension/src/extension.ts
…nto feature/vsc-ext-native-improvements

# Conflicts:
#	packages/b2c-vs-extension/src/extension.ts
@clavery clavery changed the title VS Code extension: native TreeView, content libraries, plugin support VS Code extension: native TreeView, content libraries, plugin support, CI Feb 22, 2026
…, plugin opts

- Refresh content tree on config reset (matching webdav-tree pattern)
- Honour create/overwrite flags in WebDAV writeFile per VS Code contract
- Strip single existing top-level root in ensureArchiveStructure to avoid
  double-nesting when re-wrapping site archives
- Add accountManagerHost to PluginHookOptions and resolveOptions
- Use Uri.from instead of Uri.parse for correct special-char handling
- Guard applyMiddleware against duplicate registration
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