Skip to content

Commit 4a84bdd

Browse files
committed
feat: improve loading state
1 parent 440cf59 commit 4a84bdd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,8 @@
21012101
"viewsWelcome": [
21022102
{
21032103
"view": "deepnoteExplorer",
2104-
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)"
2104+
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)",
2105+
"when": "deepnote.explorerInitialScanComplete"
21052106
}
21062107
],
21072108
"debuggers": [

src/notebooks/deepnote/deepnoteTreeDataProvider.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
RelativePattern,
99
Uri,
1010
FileSystemWatcher,
11-
ThemeIcon
11+
ThemeIcon,
12+
commands
1213
} from 'vscode';
1314
import * as yaml from 'js-yaml';
1415

@@ -32,6 +33,7 @@ export class DeepnoteTreeDataProvider implements TreeDataProvider<DeepnoteTreeIt
3233

3334
constructor() {
3435
this.setupFileWatcher();
36+
this.updateContextKey();
3537
}
3638

3739
public dispose(): void {
@@ -43,6 +45,7 @@ export class DeepnoteTreeDataProvider implements TreeDataProvider<DeepnoteTreeIt
4345
this.cachedProjects.clear();
4446
this.isInitialScanComplete = false;
4547
this.initialScanPromise = undefined;
48+
this.updateContextKey();
4649
this._onDidChangeTreeData.fire();
4750
}
4851

@@ -93,6 +96,7 @@ export class DeepnoteTreeDataProvider implements TreeDataProvider<DeepnoteTreeIt
9396
} finally {
9497
this.isInitialScanComplete = true;
9598
this.initialScanPromise = undefined;
99+
this.updateContextKey();
96100
this._onDidChangeTreeData.fire();
97101
}
98102
}
@@ -233,4 +237,8 @@ export class DeepnoteTreeDataProvider implements TreeDataProvider<DeepnoteTreeIt
233237

234238
return undefined;
235239
}
240+
241+
private updateContextKey(): void {
242+
void commands.executeCommand('setContext', 'deepnote.explorerInitialScanComplete', this.isInitialScanComplete);
243+
}
236244
}

0 commit comments

Comments
 (0)