Skip to content

Commit b1c1bcb

Browse files
authored
Merge branch 'main' into dinohamzic/grn-5031-loading-state-on-startup
2 parents 5ab72fa + b8c52a6 commit b1c1bcb

39 files changed

+2389
-137
lines changed

package.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
"category": "Deepnote",
100100
"icon": "$(plug)"
101101
},
102+
{
103+
"command": "deepnote.openInDeepnote",
104+
"title": "Open in Deepnote",
105+
"category": "Deepnote",
106+
"icon": "$(globe)"
107+
},
102108
{
103109
"command": "deepnote.newProject",
104110
"title": "New project",
@@ -129,6 +135,12 @@
129135
"category": "Deepnote",
130136
"icon": "$(graph)"
131137
},
138+
{
139+
"command": "deepnote.addChartBlock",
140+
"title": "%deepnote.commands.addChartBlock.title%",
141+
"category": "Deepnote",
142+
"icon": "$(graph-line)"
143+
},
132144
{
133145
"command": "deepnote.addInputTextBlock",
134146
"title": "%deepnote.commands.addInputTextBlock.title%",
@@ -728,9 +740,30 @@
728740
{
729741
"id": "editor.interactiveWindow.context",
730742
"label": "%jupyter.command.editor.interactiveWindow.context.label%"
743+
},
744+
{
745+
"id": "deepnote.explorer.context",
746+
"label": "Deepnote"
731747
}
732748
],
733749
"menus": {
750+
"view/title": [
751+
{
752+
"command": "deepnote.newProject",
753+
"when": "view == deepnoteExplorer",
754+
"group": "navigation@1"
755+
},
756+
{
757+
"command": "deepnote.importNotebook",
758+
"when": "view == deepnoteExplorer",
759+
"group": "navigation@2"
760+
},
761+
{
762+
"command": "deepnote.refreshExplorer",
763+
"when": "view == deepnoteExplorer",
764+
"group": "navigation@3"
765+
}
766+
],
734767
"editor/context": [
735768
{
736769
"submenu": "editor.interactiveWindow.context",
@@ -740,6 +773,11 @@
740773
"when": "editorFocus && editorLangId == python && jupyter.hascodecells && !notebookEditorFocused && isWorkspaceTrusted",
741774
"command": "jupyter.exportfileasnotebook",
742775
"group": "Jupyter3@2"
776+
},
777+
{
778+
"when": "resourceExtname == .deepnote",
779+
"command": "deepnote.openInDeepnote",
780+
"group": "navigation"
743781
}
744782
],
745783
"editor.interactiveWindow.context": [
@@ -779,6 +817,14 @@
779817
"when": "editorFocus && editorLangId == python && !notebookEditorFocused && isWorkspaceTrusted"
780818
}
781819
],
820+
"deepnote.explorer.context": [
821+
{
822+
"command": "deepnote.newProject"
823+
},
824+
{
825+
"command": "deepnote.importNotebook"
826+
}
827+
],
782828
"editor/title": [
783829
{
784830
"command": "jupyter.restartkernel",
@@ -821,6 +867,51 @@
821867
"group": "navigation@1",
822868
"when": "notebookType == 'deepnote'"
823869
},
870+
{
871+
"command": "deepnote.addChartBlock",
872+
"group": "navigation@2",
873+
"when": "notebookType == 'deepnote'"
874+
},
875+
{
876+
"command": "deepnote.addBigNumberChartBlock",
877+
"group": "navigation@3",
878+
"when": "notebookType == 'deepnote'"
879+
},
880+
{
881+
"command": "deepnote.addInputTextBlock",
882+
"group": "navigation@4",
883+
"when": "notebookType == 'deepnote'"
884+
},
885+
{
886+
"command": "deepnote.addInputTextareaBlock",
887+
"group": "navigation@5",
888+
"when": "notebookType == 'deepnote'"
889+
},
890+
{
891+
"command": "deepnote.addInputSelectBlock",
892+
"group": "navigation@6",
893+
"when": "notebookType == 'deepnote'"
894+
},
895+
{
896+
"command": "deepnote.addInputSliderBlock",
897+
"group": "navigation@7",
898+
"when": "notebookType == 'deepnote'"
899+
},
900+
{
901+
"command": "deepnote.addInputCheckboxBlock",
902+
"group": "navigation@8",
903+
"when": "notebookType == 'deepnote'"
904+
},
905+
{
906+
"command": "deepnote.addInputDateBlock",
907+
"group": "navigation@9",
908+
"when": "notebookType == 'deepnote'"
909+
},
910+
{
911+
"command": "deepnote.addInputDateRangeBlock",
912+
"group": "navigation@10",
913+
"when": "notebookType == 'deepnote'"
914+
},
824915
{
825916
"command": "jupyter.restartkernel",
826917
"group": "navigation/execute@5",
@@ -951,6 +1042,11 @@
9511042
}
9521043
],
9531044
"explorer/context": [
1045+
{
1046+
"submenu": "deepnote.explorer.context",
1047+
"when": "isWorkspaceTrusted",
1048+
"group": "navigation@10"
1049+
},
9541050
{
9551051
"when": "resourceLangId == python && !notebookEditorFocused && isWorkspaceTrusted",
9561052
"command": "jupyter.runFileInteractive",
@@ -1352,6 +1448,18 @@
13521448
"type": "object",
13531449
"title": "Deepnote",
13541450
"properties": {
1451+
"deepnote.domain": {
1452+
"type": "string",
1453+
"default": "deepnote.com",
1454+
"description": "Deepnote domain (e.g., 'deepnote.com' or 'ra-18838.deepnote-staging.com')",
1455+
"scope": "application"
1456+
},
1457+
"deepnote.disableSSLVerification": {
1458+
"type": "boolean",
1459+
"default": false,
1460+
"description": "Disable SSL certificate verification (for development only)",
1461+
"scope": "application"
1462+
},
13551463
"jupyter.experiments.enabled": {
13561464
"type": "boolean",
13571465
"default": true,

package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"deepnote.commands.importNotebook.title": "Import Notebook",
256256
"deepnote.commands.importJupyterNotebook.title": "Import Jupyter Notebook",
257257
"deepnote.commands.addSqlBlock.title": "Add SQL Block",
258-
"deepnote.commands.addBigNumberChartBlock.title": "Add Big Number Chart Block",
258+
"deepnote.commands.addBigNumberChartBlock.title": "Add Big Number Block",
259+
"deepnote.commands.addChartBlock.title": "Add Chart Block",
259260
"deepnote.commands.addInputTextBlock.title": "Add Input Text Block",
260261
"deepnote.commands.addInputTextareaBlock.title": "Add Input Textarea Block",
261262
"deepnote.commands.addInputSelectBlock.title": "Add Input Select Block",

src/commands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export interface ICommandNameArgumentTypeMapping {
188188
[DSCommands.ContinueEditSessionInCodespace]: [];
189189
[DSCommands.AddSqlBlock]: [];
190190
[DSCommands.AddBigNumberChartBlock]: [];
191+
[DSCommands.AddChartBlock]: [];
191192
[DSCommands.AddInputTextBlock]: [];
192193
[DSCommands.AddInputTextareaBlock]: [];
193194
[DSCommands.AddInputSelectBlock]: [];
@@ -197,4 +198,5 @@ export interface ICommandNameArgumentTypeMapping {
197198
[DSCommands.AddInputDateRangeBlock]: [];
198199
[DSCommands.AddInputFileBlock]: [];
199200
[DSCommands.AddButtonBlock]: [];
201+
[DSCommands.OpenInDeepnote]: [];
200202
}

src/messageTypes.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export type LocalizedMessages = {
182182
// Integration type labels
183183
integrationsPostgresTypeLabel: string;
184184
integrationsBigQueryTypeLabel: string;
185+
integrationsSnowflakeTypeLabel: string;
185186
// PostgreSQL form strings
186187
integrationsPostgresNameLabel: string;
187188
integrationsPostgresNamePlaceholder: string;
@@ -204,9 +205,36 @@ export type LocalizedMessages = {
204205
integrationsBigQueryCredentialsLabel: string;
205206
integrationsBigQueryCredentialsPlaceholder: string;
206207
integrationsBigQueryCredentialsRequired: string;
208+
// Snowflake form strings
209+
integrationsSnowflakeNameLabel: string;
210+
integrationsSnowflakeNamePlaceholder: string;
211+
integrationsSnowflakeAccountLabel: string;
212+
integrationsSnowflakeAccountPlaceholder: string;
213+
integrationsSnowflakeAuthMethodLabel: string;
214+
integrationsSnowflakeAuthMethodSubLabel: string;
215+
integrationsSnowflakeAuthMethodUsernamePassword: string;
216+
integrationsSnowflakeAuthMethodKeyPair: string;
217+
integrationsSnowflakeUnsupportedAuthMethod: string;
218+
integrationsSnowflakeUsernameLabel: string;
219+
integrationsSnowflakePasswordLabel: string;
220+
integrationsSnowflakePasswordPlaceholder: string;
221+
integrationsSnowflakeServiceAccountUsernameLabel: string;
222+
integrationsSnowflakeServiceAccountUsernameHelp: string;
223+
integrationsSnowflakePrivateKeyLabel: string;
224+
integrationsSnowflakePrivateKeyHelp: string;
225+
integrationsSnowflakePrivateKeyPlaceholder: string;
226+
integrationsSnowflakePrivateKeyPassphraseLabel: string;
227+
integrationsSnowflakePrivateKeyPassphraseHelp: string;
228+
integrationsSnowflakeDatabaseLabel: string;
229+
integrationsSnowflakeDatabasePlaceholder: string;
230+
integrationsSnowflakeRoleLabel: string;
231+
integrationsSnowflakeRolePlaceholder: string;
232+
integrationsSnowflakeWarehouseLabel: string;
233+
integrationsSnowflakeWarehousePlaceholder: string;
207234
// Common form strings
208235
integrationsRequiredField: string;
209236
integrationsOptionalField: string;
237+
integrationsUnnamedIntegration: string;
210238
};
211239
// Map all messages to specific payloads
212240
export class IInteractiveWindowMapping {

src/notebooks/deepnote/blocks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ project:
4545
type: 'code'
4646
content: "df = pd.DataFrame({'a': [1, 2, 3]})\ndf"
4747
sortingKey: '001'
48-
blockGroup: 'default-group'
48+
blockGroup: 'uuid-v4'
4949
executionCount: 1
5050
metadata:
5151
table_state_spec: '{"pageSize": 25, "pageIndex": 0}'
@@ -150,7 +150,7 @@ Example of a cell after pocket conversion:
150150
__deepnotePocket: {
151151
type: 'code',
152152
sortingKey: '001',
153-
blockGroup: 'default-group',
153+
blockGroup: 'uuid-v4',
154154
executionCount: 1
155155
}
156156
},
@@ -472,7 +472,7 @@ blocks:
472472
type: 'big-number'
473473
content: ''
474474
sortingKey: '001'
475-
blockGroup: 'default-group'
475+
blockGroup: 'uuid-v4'
476476
metadata:
477477
deepnote_big_number_title: 'Customers'
478478
deepnote_big_number_value: 'customers'
@@ -517,7 +517,7 @@ When opened in VS Code, the block becomes a cell with JSON content showing the c
517517
__deepnotePocket: {
518518
type: 'big-number',
519519
sortingKey: '001',
520-
blockGroup: 'default-group'
520+
blockGroup: 'uuid-v4'
521521
}
522522
}
523523
}

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
ButtonBlockConverter
2828
} from './converters/inputConverters';
2929
import { CHART_BIG_NUMBER_MIME_TYPE } from '../../platform/deepnote/deepnoteConstants';
30+
import { generateUuid } from '../../platform/common/uuid';
3031

3132
/**
3233
* Utility class for converting between Deepnote block structures and VS Code notebook cells.
@@ -168,7 +169,7 @@ export class DeepnoteDataConverter {
168169

169170
private createFallbackBlock(cell: NotebookCellData, index: number): DeepnoteBlock {
170171
return {
171-
blockGroup: 'default-group',
172+
blockGroup: generateUuid(),
172173
id: generateBlockId(),
173174
sortingKey: generateSortingKey(index),
174175
type: cell.kind === NotebookCellKind.Code ? 'code' : 'markdown',

src/notebooks/deepnote/deepnoteExplorerView.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { IDeepnoteNotebookManager } from '../types';
88
import { DeepnoteTreeDataProvider } from './deepnoteTreeDataProvider';
99
import { type DeepnoteTreeItem, DeepnoteTreeItemType, type DeepnoteTreeItemContext } from './deepnoteTreeItem';
1010
import { generateUuid } from '../../platform/common/uuid';
11+
import { DeepnoteBlock, DeepnoteFile } from '@deepnote/blocks';
1112

1213
/**
1314
* Manages the Deepnote explorer tree view and related commands
@@ -213,10 +214,10 @@ export class DeepnoteExplorerView {
213214
const projectId = generateUuid();
214215
const notebookId = generateUuid();
215216

216-
const firstBlock = {
217+
const firstBlock: DeepnoteBlock = {
217218
blockGroup: generateUuid(),
218219
content: '',
219-
executionCount: null,
220+
executionCount: 0,
220221
id: generateUuid(),
221222
metadata: {},
222223
outputs: [],
@@ -225,9 +226,10 @@ export class DeepnoteExplorerView {
225226
version: 1
226227
};
227228

228-
const projectData = {
229-
version: 1.0,
229+
const projectData: DeepnoteFile = {
230+
version: '1.0.0',
230231
metadata: {
232+
createdAt: new Date().toISOString(),
231233
modifiedAt: new Date().toISOString()
232234
},
233235
project: {

src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ suite('DeepnoteExplorerView - Empty State Commands', () => {
265265
const yamlContent = Buffer.from(capturedContent!).toString('utf8');
266266
const projectData = yaml.load(yamlContent) as any;
267267

268-
expect(projectData.version).to.equal(1.0);
268+
expect(projectData.version).to.equal('1.0.0');
269+
expect(projectData.metadata.createdAt).to.exist;
270+
expect(projectData.metadata.modifiedAt).to.exist;
269271
expect(projectData.project.id).to.equal(projectId);
270272
expect(projectData.project.name).to.equal(projectName);
271273
expect(projectData.project.notebooks).to.have.lengthOf(1);

0 commit comments

Comments
 (0)