Skip to content

Commit 7418a9f

Browse files
committed
Replace WebDAV Browser webview with native TreeView
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)
1 parent 03b2b84 commit 7418a9f

File tree

9 files changed

+534
-842
lines changed

9 files changed

+534
-842
lines changed

packages/b2c-vs-extension/.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.vscode-test/**
33
src/**
44
!src/webview.html
5-
!src/webdav.html
65
!src/storefront-next-cartridge.html
76
!src/scapi-explorer.html
87
!src/ods-management.html
Lines changed: 4 additions & 0 deletions
Loading

packages/b2c-vs-extension/package.json

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"vscode": "^1.105.1"
1919
},
2020
"activationEvents": [
21-
"*",
22-
"onStartupFinished",
21+
"onView:b2cWebdavExplorer",
2322
"onCommand:b2c-dx.openUI",
2423
"onCommand:b2c-dx.handleStorefrontNextCartridge",
2524
"onCommand:b2c-dx.promptAgent",
@@ -29,6 +28,31 @@
2928
],
3029
"main": "./dist/extension.js",
3130
"contributes": {
31+
"viewsContainers": {
32+
"activitybar": [
33+
{
34+
"id": "b2c-dx",
35+
"title": "B2C-DX WebDAV",
36+
"icon": "media/b2c-icon.svg"
37+
}
38+
]
39+
},
40+
"views": {
41+
"b2c-dx": [
42+
{
43+
"id": "b2cWebdavExplorer",
44+
"name": "Browser",
45+
"icon": "media/b2c-icon.svg",
46+
"contextualTitle": "B2C Commerce"
47+
}
48+
]
49+
},
50+
"viewsWelcome": [
51+
{
52+
"view": "b2cWebdavExplorer",
53+
"contents": "No B2C Commerce instance configured.\n\nCreate a dw.json file in your workspace or set SFCC_* environment variables.\n\n[Refresh](command:b2c-dx.webdav.refresh)"
54+
}
55+
],
3256
"commands": [
3357
{
3458
"command": "b2c-dx.openUI",
@@ -59,8 +83,80 @@
5983
"command": "b2c-dx.odsManagement",
6084
"title": "On Demand Sandbox (ods) Management",
6185
"category": "B2C DX"
86+
},
87+
{
88+
"command": "b2c-dx.webdav.refresh",
89+
"title": "Refresh",
90+
"icon": "$(refresh)",
91+
"category": "B2C DX"
92+
},
93+
{
94+
"command": "b2c-dx.webdav.newFolder",
95+
"title": "New Folder",
96+
"icon": "$(new-folder)",
97+
"category": "B2C DX"
98+
},
99+
{
100+
"command": "b2c-dx.webdav.uploadFile",
101+
"title": "Upload File",
102+
"icon": "$(cloud-upload)",
103+
"category": "B2C DX"
104+
},
105+
{
106+
"command": "b2c-dx.webdav.delete",
107+
"title": "Delete",
108+
"icon": "$(trash)",
109+
"category": "B2C DX"
110+
},
111+
{
112+
"command": "b2c-dx.webdav.download",
113+
"title": "Download",
114+
"icon": "$(cloud-download)",
115+
"category": "B2C DX"
116+
},
117+
{
118+
"command": "b2c-dx.webdav.openFile",
119+
"title": "Open File",
120+
"icon": "$(go-to-file)",
121+
"category": "B2C DX"
62122
}
63-
]
123+
],
124+
"menus": {
125+
"view/title": [
126+
{
127+
"command": "b2c-dx.webdav.refresh",
128+
"when": "view == b2cWebdavExplorer",
129+
"group": "navigation"
130+
}
131+
],
132+
"view/item/context": [
133+
{
134+
"command": "b2c-dx.webdav.newFolder",
135+
"when": "view == b2cWebdavExplorer && viewItem =~ /^(root|directory)$/",
136+
"group": "1_modification@1"
137+
},
138+
{
139+
"command": "b2c-dx.webdav.uploadFile",
140+
"when": "view == b2cWebdavExplorer && viewItem =~ /^(root|directory)$/",
141+
"group": "1_modification@2"
142+
},
143+
{
144+
"command": "b2c-dx.webdav.openFile",
145+
"when": "view == b2cWebdavExplorer && viewItem == file",
146+
"group": "1_open@1"
147+
},
148+
{
149+
"command": "b2c-dx.webdav.download",
150+
"when": "view == b2cWebdavExplorer && viewItem == file",
151+
"group": "1_open@2"
152+
},
153+
{
154+
"command": "b2c-dx.webdav.delete",
155+
"when": "view == b2cWebdavExplorer && viewItem =~ /^(directory|file)$/",
156+
"group": "2_destructive@1"
157+
}
158+
]
159+
}
64160
},
65161
"scripts": {
66162
"build": "node scripts/esbuild-bundle.mjs",

0 commit comments

Comments
 (0)