Skip to content

Commit cddc017

Browse files
authored
feat: Add a welcome screen to the extension. (#74)
1 parent 0ac510e commit cddc017

File tree

9 files changed

+1385
-7
lines changed

9 files changed

+1385
-7
lines changed

build/esbuild/build.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const commonExternals = [
4848
'vscode',
4949
'commonjs',
5050
'node:crypto',
51+
'node:fs/promises',
52+
'node:path',
5153
'vscode-jsonrpc', // Used by a few modules, might as well pull this out, instead of duplicating it in separate bundles.
5254
// Ignore telemetry specific packages that are not required.
5355
'applicationinsights-native-metrics',

package-lock.json

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

package.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,24 @@
9191
"category": "Deepnote",
9292
"icon": "$(plug)"
9393
},
94+
{
95+
"command": "deepnote.newProject",
96+
"title": "New project",
97+
"category": "Deepnote",
98+
"icon": "$(new-file)"
99+
},
100+
{
101+
"command": "deepnote.importNotebook",
102+
"title": "Import notebook",
103+
"category": "Deepnote",
104+
"icon": "$(folder-opened)"
105+
},
106+
{
107+
"command": "deepnote.importJupyterNotebook",
108+
"title": "Import Jupyter notebook",
109+
"category": "Deepnote",
110+
"icon": "$(notebook)"
111+
},
94112
{
95113
"command": "dataScience.ClearCache",
96114
"title": "%jupyter.command.dataScience.clearCache.title%",
@@ -1853,14 +1871,19 @@
18531871
{
18541872
"id": "deepnoteExplorer",
18551873
"name": "%deepnote.views.explorer.name%",
1856-
"when": "workspaceFolderCount != 0",
18571874
"iconPath": {
18581875
"light": "./resources/light/deepnote-icon.svg",
18591876
"dark": "./resources/dark/deepnote-icon.svg"
18601877
}
18611878
}
18621879
]
18631880
},
1881+
"viewsWelcome": [
1882+
{
1883+
"view": "deepnoteExplorer",
1884+
"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)"
1885+
}
1886+
],
18641887
"debuggers": [
18651888
{
18661889
"type": "Python Kernel Debug Adapter",
@@ -2122,6 +2145,7 @@
21222145
"dependencies": {
21232146
"@c4312/evt": "^0.1.1",
21242147
"@deepnote/blocks": "^1.2.0",
2148+
"@deepnote/convert": "^1.1.0",
21252149
"@enonic/fnv-plus": "^1.3.0",
21262150
"@jupyter-widgets/base": "^6.0.8",
21272151
"@jupyter-widgets/controls": "^5.0.9",

package.nls.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@
250250
"deepnote.commands.openFile.title": "Open File",
251251
"deepnote.commands.revealInExplorer.title": "Reveal in Explorer",
252252
"deepnote.commands.manageIntegrations.title": "Manage Integrations",
253+
"deepnote.commands.newProject.title": "New Project",
254+
"deepnote.commands.importNotebook.title": "Import Notebook",
255+
"deepnote.commands.importJupyterNotebook.title": "Import Jupyter Notebook",
253256
"deepnote.views.explorer.name": "Explorer",
257+
"deepnote.views.explorer.welcome": "No Deepnote notebooks found in this workspace.",
254258
"deepnote.command.selectNotebook.title": "Select Notebook"
255259
}

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ export class DeepnoteDataConverter {
8989
// Outputs are managed by VS Code natively, not stored in the pocket
9090
// Preserve outputs when they exist (including newly produced outputs)
9191
// Only set if not already set to avoid overwriting converter-managed outputs
92-
// Only set if the cell actually has outputs (non-empty array) or if the block originally had outputs
9392
const hadOutputs = cell.metadata?.__hadOutputs;
94-
if (cell.outputs && !block.outputs && (cell.outputs.length > 0 || hadOutputs)) {
95-
block.outputs = this.transformOutputsForDeepnote(cell.outputs);
93+
if (!block.outputs) {
94+
// Set outputs if:
95+
// 1. The cell has non-empty outputs, OR
96+
// 2. The block originally had outputs (even if empty)
97+
if ((cell.outputs && cell.outputs.length > 0) || hadOutputs) {
98+
block.outputs = cell.outputs ? this.transformOutputsForDeepnote(cell.outputs) : [];
99+
}
96100
}
97101

98102
// Clean up internal tracking flags from metadata

0 commit comments

Comments
 (0)