-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add a welcome screen to the extension. #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe PR adds three commands (deepnote.newProject, deepnote.importNotebook, deepnote.importJupyterNotebook), a welcome view for the Deepnote explorer with quick links, and removes the prior workspace-folder visibility gating for the explorer. It introduces @deepnote/convert as a dependency and integrates convertIpynbFilesToDeepnoteFile. Implementation adds project-creation, .deepnote and .ipynb import flows (including collision checks, YAML generation, UUIDs), improved error handling and localized messages, extensive unit tests for the new flows, a VSCode test mock for the convert module, and a defensive default for selectedNotebook.blocks in the serializer. Sequence Diagram(s)sequenceDiagram
actor User
participant VS as VS Code
participant Cmd as Deepnote Command Handler
participant FS as File System
participant Convert as @deepnote/convert
participant Explorer as Deepnote Explorer
rect rgb(200,220,240)
Note over User,Cmd: Create New Project
User->>VS: invoke deepnote.newProject
VS->>Cmd: execute newProject
Cmd->>Cmd: validate & sanitize name
Cmd->>FS: check collisions
Cmd->>FS: write .deepnote (YAML with UUIDs)
Cmd->>Explorer: refresh
Cmd->>VS: open created notebook
end
rect rgb(240,230,210)
Note over User,Cmd: Import Notebook (.deepnote or .ipynb)
User->>VS: invoke deepnote.importNotebook / deepnote.importJupyterNotebook
VS->>Cmd: execute import flow
alt source is .deepnote
Cmd->>FS: copy file into workspace (handle collisions)
else source is .ipynb
Cmd->>Convert: convertIpynbFilesToDeepnoteFile
Convert-->>Cmd: deepnote-formatted file
Cmd->>FS: write .deepnote (handle collisions)
end
Cmd->>Explorer: refresh
Cmd->>VS: show summary or errors
end
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (4)**/!(*.node|*.web).ts📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/notebooks/deepnote/**📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/notebooks/deepnote/deepnoteDataConverter.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🔇 Additional comments (2)
Comment |
42b76c4 to
6737ef7
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
======================================
Coverage 70% 71%
======================================
Files 518 518
Lines 38270 38721 +451
Branches 4856 4884 +28
======================================
+ Hits 27160 27577 +417
- Misses 9505 9523 +18
- Partials 1605 1621 +16
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
package.json(3 hunks)package.nls.json(1 hunks)src/notebooks/deepnote/deepnoteExplorerView.ts(3 hunks)src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts(1 hunks)src/notebooks/deepnote/deepnoteSerializer.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/!(*.node|*.web).ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place shared cross-platform logic in common
.tsfiles (not suffixed with.nodeor.web)
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/notebooks/deepnote/deepnoteSerializer.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/notebooks/deepnote/deepnoteSerializer.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place unit tests in files matching
*.unit.test.ts
**/*.unit.test.ts: Unit tests must use Mocha/Chai and have the .unit.test.ts extension
Place unit test files alongside the source files they test
Use assert.deepStrictEqual() for object comparisons in tests instead of checking individual properties
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
src/notebooks/deepnote/**
📄 CodeRabbit inference engine (CLAUDE.md)
Deepnote integration code resides under src/notebooks/deepnote/
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/notebooks/deepnote/deepnoteSerializer.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
src/notebooks/deepnote/deepnoteSerializer.ts
📄 CodeRabbit inference engine (CLAUDE.md)
deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration
Files:
src/notebooks/deepnote/deepnoteSerializer.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Project is a VS Code extension for Jupyter notebooks
📚 Learning: 2025-09-03T12:54:35.368Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/interactiveWindow.instructions.md:0-0
Timestamp: 2025-09-03T12:54:35.368Z
Learning: Applies to src/interactive-window/**/*.ts : Add unit and integration tests for new features and modifications; include performance and cross-platform test coverage
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteSerializer.ts : deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration
Applied to files:
src/notebooks/deepnote/deepnoteSerializer.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.ts
📚 Learning: 2025-09-09T13:50:51.073Z
Learnt from: Artmann
PR: deepnote/vscode-extension#11
File: package.json:320-325
Timestamp: 2025-09-09T13:50:51.073Z
Learning: The user prefers to have a dedicated "Deepnote" category in package.json commands rather than grouping Deepnote commands under the existing "Jupyter" category.
Applied to files:
package.json
🧬 Code graph analysis (1)
src/notebooks/deepnote/deepnoteExplorerView.ts (1)
src/platform/common/uuid.ts (1)
generateUuid(10-61)
🔇 Additional comments (3)
src/notebooks/deepnote/deepnoteSerializer.ts (1)
66-66: LGTM - defensive null handling.The
?? []prevents potential crashes ifblocksis undefined, which can occur during import flows.src/notebooks/deepnote/deepnoteExplorerView.ts (2)
361-364: Verify edge-case handling in convertIpynbFilesToDeepnoteFile
At lines 361–364 and 433–436 the call assumes success—confirm the imported '@deepnote/convert' function handles empty notebooks, invalid JSON, missing cells, and malformed metadata, or add validation/error wrappers.
309-309: Use path utilities instead of string manipulation.Parsing paths with
split('/')is fragile. Use VS Code'sUrimethods or Node'spath.basename()for robust path handling.Example:
const fileName = Uri.parse(deepnoteUri.path).path.split('/').pop() || 'imported.deepnote'; // Better: const fileName = deepnoteUri.path.split('/').pop() || 'imported.deepnote'; // Or even better with a helper: const getFileName = (uri: Uri) => uri.path.substring(uri.path.lastIndexOf('/') + 1) || 'imported.deepnote';Also applies to: 325-325, 417-417
⛔ Skipped due to learnings
Learnt from: CR PR: deepnote/vscode-deepnote#0 File: CLAUDE.md:0-0 Timestamp: 2025-10-09T11:21:57.494Z Learning: Applies to **/*.{ts,tsx} : Use Uri.joinPath() to construct file paths instead of manual string concatenationLearnt from: CR PR: deepnote/vscode-extension#0 File: .github/instructions/platform.instructions.md:0-0 Timestamp: 2025-09-03T13:00:18.307Z Learning: Applies to src/platform/**/{fileSystem.ts,fileSystem.node.ts,platformService.web.ts,platformService.node.ts} : Use URI-based file operations and vscode-path for cross-platform path handling in file system and platform service implementations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (3)
src/notebooks/deepnote/deepnoteExplorerView.ts (3)
200-202: Filename collision risk from basic sanitization.The regex replacement can produce identical filenames for different inputs (e.g., "My Project" and "My_Project" both become "my-project"). Consider appending a timestamp or counter when collisions occur.
Based on past review comments.
216-226: Extract block template to constant.The default block structure is hardcoded here and repeated logic exists elsewhere. Extract to a shared constant or factory function.
Based on past review comments.
271-380: Significant code duplication between import methods.
importNotebookandimportJupyterNotebookshare ~70% identical logic (workspace check, collision detection, success messages). Extract common logic to reduce maintenance burden.Based on past review comments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
src/notebooks/deepnote/deepnoteExplorerView.ts(3 hunks)src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts(2 hunks)src/test/vscode-mock.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/!(*.node|*.web).ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place shared cross-platform logic in common
.tsfiles (not suffixed with.nodeor.web)
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/test/vscode-mock.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/test/vscode-mock.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place unit tests in files matching
*.unit.test.ts
**/*.unit.test.ts: Unit tests must use Mocha/Chai and have the .unit.test.ts extension
Place unit test files alongside the source files they test
Use assert.deepStrictEqual() for object comparisons in tests instead of checking individual properties
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
src/notebooks/deepnote/**
📄 CodeRabbit inference engine (CLAUDE.md)
Deepnote integration code resides under src/notebooks/deepnote/
Files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.tssrc/notebooks/deepnote/deepnoteExplorerView.ts
🧠 Learnings (4)
📚 Learning: 2025-09-03T12:54:35.368Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/interactiveWindow.instructions.md:0-0
Timestamp: 2025-09-03T12:54:35.368Z
Learning: Applies to src/interactive-window/**/*.ts : Add unit and integration tests for new features and modifications; include performance and cross-platform test coverage
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
📚 Learning: 2025-10-14T13:43:36.364Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-14T13:43:36.364Z
Learning: Applies to packages/*/src/**/*.test.{ts,tsx} : Import { describe, expect, it } from 'vitest' in tests
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteActivationService.ts : deepnoteActivationService.ts manages VS Code activation for Deepnote
Applied to files:
src/notebooks/deepnote/deepnoteExplorerView.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (1)
src/test/vscode-mock.ts (2)
resetVSCodeMocks(60-79)mockedVSCodeNamespaces(17-17)
src/notebooks/deepnote/deepnoteExplorerView.ts (1)
src/platform/common/uuid.ts (1)
generateUuid(10-61)
🔇 Additional comments (3)
src/test/vscode-mock.ts (1)
92-98: LGTM!Mock follows existing patterns and provides appropriate no-op for test isolation.
src/notebooks/deepnote/deepnoteExplorerView.ts (1)
248-249: Good use of TextEncoder for cross-platform compatibility.Using
TextEncoderinstead ofBuffer.fromensures the code works in both Node and browser-based extensions.src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (1)
187-736: Excellent test coverage.The test suite comprehensively covers all three new commands with appropriate edge cases, error scenarios, and user interactions. Good use of Mocha/Chai/Sinon/ts-mockito as per coding guidelines.
Summary by CodeRabbit
New Features
Bug Fixes
Tests