Skip to content

Commit 136f3de

Browse files
committed
Update ZenML tutorial extension to version 0.0.9, enhance sidebar functionality, and add auto-open tutorial feature. Adjust Dockerfile and package files accordingly. Improve error handling and logging during activation.
1 parent 5ded93e commit 136f3de

13 files changed

+149
-73
lines changed
-4.99 MB
Binary file not shown.
-4.99 MB
Binary file not shown.

.github/workflows/build-extensions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build theme extension
4242
run: |
4343
echo "Building theme extension..."
44-
cd themes && npx @vscode/vsce package --out ./zenml-color-theme-0.0.4.vsix
44+
cd themes && npx @vscode/vsce package --out ./zenml-color-theme-0.0.9.vsix
4545
4646
- name: Verify extensions were builts
4747
run: |
@@ -54,11 +54,11 @@ jobs:
5454
exit 1
5555
fi
5656
57-
if [ -f "themes/zenml-color-theme-0.0.4.vsix" ]; then
57+
if [ -f "themes/zenml-color-theme-0.0.9.vsix" ]; then
5858
echo "Theme extension built successfully:"
59-
ls -la themes/zenml-color-theme-0.0.4.vsix
59+
ls -la themes/zenml-color-theme-0.0.9.vsix
6060
else
61-
echo "ERROR: zenml-color-theme-0.0.4.vsix not found"
61+
echo "ERROR: zenml-color-theme-0.0.9.vsix not found"
6262
exit 1
6363
fi
6464
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/upload-artifact@v4
7373
with:
7474
name: theme-extension
75-
path: themes/zenml-color-theme-0.0.4.vsix
75+
path: themes/zenml-color-theme-0.0.9.vsix
7676

7777
- name: Commit and push built extensions
7878
# Only commit on push to main/develop branches, not on PRs
@@ -83,7 +83,7 @@ jobs:
8383
8484
# Add the built extensions to git
8585
git add .devcontainer/extensions/zenml-tutorial-*.vsix
86-
git add themes/zenml-color-theme-0.0.4.vsix
86+
git add themes/zenml-color-theme-0.0.9.vsix
8787
8888
# Check if there are any changes to commit
8989
if git diff --staged --quiet; then

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,39 @@ The fastest way to get started - no local setup required.
101101
- **Inspect** output in the terminal and Dashboard link
102102
- **Experiment** by editing any example code
103103

104+
## ⚙️ Extension Configuration
105+
106+
### Auto-Open Tutorial
107+
108+
By default, the tutorial homepage opens automatically when you start VS Code. You can control this behavior:
109+
110+
#### 🔧 Quick Disable
111+
When the welcome message appears, click **"Don't Show Again"** to disable auto-opening.
112+
113+
#### 🔧 Settings UI
114+
1. Open VS Code Settings (`Ctrl+,` or `Cmd+,`)
115+
2. Search for "zenml"
116+
3. Toggle **"Auto Open Tutorial"** on/off
117+
118+
#### 🔧 Settings JSON
119+
Add to your VS Code settings:
120+
```json
121+
{
122+
"zenml.autoOpenTutorial": false
123+
}
124+
```
125+
126+
**Note**: You can always access the tutorial manually via the ZenML sidebar (book icon) or Command Palette (`Ctrl+Shift+P` → "ZenML: Open ZenML Tutorial Homepage").
127+
128+
### Dashboard URL
129+
130+
Configure the ZenML dashboard URL for pipeline run links:
131+
```json
132+
{
133+
"zenml.dashboardUrl": "http://localhost:8237"
134+
}
135+
```
136+
104137
## 🛟 Getting Help
105138

106139
- **📖 ZenML Docs**: [docs.zenml.io](https://docs.zenml.io)

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "git",
66
"url": "https://github.com/zenml-io/vscode-tutorial-extension"
77
},
8-
"description": "Interactive ZenML pipeline tutorials",
9-
"version": "0.0.4",
8+
"description": "Interactive ZenML pipeline tutorials with step-by-step guidance and one-click execution",
9+
"version": "0.0.9",
1010
"publisher": "zenml-io",
1111
"engines": {
1212
"vscode": "^1.90.0"
@@ -26,7 +26,8 @@
2626
"icon": "assets/zenml-icon.png",
2727
"license": "Apache-2.0",
2828
"activationEvents": [
29-
"onStartupFinished"
29+
"onStartupFinished",
30+
"onView:zenmlTutorialView"
3031
],
3132
"main": "./out/extension.js",
3233
"scripts": {
@@ -107,6 +108,11 @@
107108
"type": "string",
108109
"default": "http://localhost:8080",
109110
"description": "Base URL for the ZenML dashboard"
111+
},
112+
"zenml.autoOpenTutorial": {
113+
"type": "boolean",
114+
"default": true,
115+
"description": "Automatically open the ZenML tutorial homepage when starting VS Code"
110116
}
111117
}
112118
},

project.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM zenmldocker/zenml-codespace:${ZENML_VERSION}
77
ARG PROJECT_DIR_NAME
88

99
# Set the working directory for the project
10-
WORKDIR /home/coder/extensions/zenml-io.zenml-tutorial-0.0.4/pipelines
10+
WORKDIR /home/coder/extensions/zenml-io.zenml-tutorial-0.0.9/pipelines
1111

1212
# Copy the specific project's requirements file
1313
COPY ./${PROJECT_DIR_NAME}/requirements.txt /tmp/requirements.txt

src/extension.ts

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ export async function activate(context: vscode.ExtensionContext) {
3131

3232
// Register sidebar provider
3333
const sidebarProvider = new ZenmlSidebarProvider(orchestrator);
34-
const treeView = vscode.window.createTreeView('zenmlTutorialView', {
35-
treeDataProvider: sidebarProvider
36-
});
37-
context.subscriptions.push(treeView);
38-
console.log("Registered sidebar provider");
34+
try {
35+
const treeView = vscode.window.createTreeView('zenmlTutorialView', {
36+
treeDataProvider: sidebarProvider,
37+
showCollapseAll: false,
38+
canSelectMany: false
39+
});
40+
context.subscriptions.push(treeView);
41+
console.log("Registered sidebar provider successfully");
42+
43+
// Force refresh to ensure the sidebar is populated
44+
sidebarProvider.refresh();
45+
} catch (error) {
46+
console.error("Failed to register sidebar provider:", error);
47+
vscode.window.showErrorMessage(`Failed to register sidebar: ${error}`);
48+
}
3949

4050
// Register command to start tutorial
4151
const startCommand = vscode.commands.registerCommand("zenml.startTutorial", () => {
@@ -51,32 +61,44 @@ export async function activate(context: vscode.ExtensionContext) {
5161
orchestrator.openSection(0); // Open welcome screen
5262
});
5363

64+
65+
5466
context.subscriptions.push(startCommand, homepageCommand);
5567
console.log("Registered commands:", ["zenml.startTutorial", "zenml.openHomepage"]);
5668

57-
// Check if this is the first time the extension is being activated
58-
const isFirstTime = !context.globalState.get<boolean>("zenml.hasBeenActivated", false);
59-
const isCodespace = process.env.CODESPACES === "true";
60-
const isTutorialEnabled = process.env.ZENML_ENABLE_TUTORIAL === "true";
61-
62-
console.log("Environment check:", {
63-
isFirstTime,
64-
isCodespace,
65-
isTutorialEnabled
66-
});
69+
// Check if auto-open tutorial is enabled
70+
const autoOpenTutorial = vscode.workspace
71+
.getConfiguration("zenml")
72+
.get<boolean>("autoOpenTutorial", true);
73+
74+
console.log("Auto-open tutorial setting:", autoOpenTutorial);
6775

68-
// Auto-start the tutorial only on first installation or in codespaces
69-
if (isFirstTime || isCodespace || isTutorialEnabled) {
70-
console.log("Auto-starting tutorial");
71-
orchestrator.start();
76+
if (autoOpenTutorial) {
77+
console.log("Auto-opening ZenML tutorial homepage");
78+
79+
// Show welcome message and open homepage
80+
vscode.window.showInformationMessage(
81+
"Welcome to ZenML! 🎉 Opening the tutorial homepage...",
82+
"Get Started",
83+
"Don't Show Again"
84+
).then((selection) => {
85+
if (selection === "Get Started") {
86+
orchestrator.start();
87+
} else if (selection === "Don't Show Again") {
88+
// Disable auto-open for future sessions
89+
vscode.workspace.getConfiguration("zenml").update("autoOpenTutorial", false, true);
90+
vscode.window.showInformationMessage(
91+
"Auto-open disabled. You can re-enable it in Settings or use the sidebar button to open the tutorial."
92+
);
93+
}
94+
});
7295

73-
// Mark as activated for future sessions
74-
if (isFirstTime) {
75-
await context.globalState.update("zenml.hasBeenActivated", true);
76-
console.log("Marked extension as activated");
77-
}
96+
// Auto-start homepage with slight delay to ensure everything is ready
97+
setTimeout(() => {
98+
orchestrator.start();
99+
}, 500);
78100
} else {
79-
console.log("Not auto-starting tutorial");
101+
console.log("Auto-open tutorial is disabled by user setting");
80102
}
81103
console.log("ZenML Tutorial extension activation completed successfully");
82104
} catch (error) {

src/tutorialOrchestrator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default class TutorialOrchestrator {
6161

6262
public start() {
6363
this._loadProgress();
64-
this._closeSidebar();
64+
// Removed _closeSidebar() to keep the primary sidebar visible
6565
this._initializeRestoreCodeButtonListeners();
6666
this._closeAllTerminals();
6767
this._initializeTutorialTerminalClosedListener();

0 commit comments

Comments
 (0)