Skip to content

Conversation

@tkislan
Copy link
Member

@tkislan tkislan commented Oct 20, 2025

GRN-4767 GRN-4768 GRN-4772

Summary by CodeRabbit

  • New Features

    • Create, rename, delete, duplicate notebooks; add notebooks to projects; rename and delete projects (new commands)
  • UI

    • "New Notebook" added to toolbar; toolbar command flow reorganized and remapped into a chained command surface
    • Explorer/context menus: quick actions for notebook and project management
    • Projects and notebooks now list alphabetically (case-insensitive)
  • Improvements

    • Faster, granular refreshes with per-item caching and targeted refreshProject/refreshNotebook
    • UTF‑8/YAML project reading and optional logger support
  • Localization

    • Added localized titles for all new commands
  • Tests

    • Expanded unit tests covering new flows, parsing, sorting, caching, and logger integration

Artmann and others added 30 commits October 8, 2025 16:07
…tomaskislan/grn-4762-support-big-number-blocks
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…tomaskislan/grn-4762-support-big-number-blocks
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
src/notebooks/deepnote/deepnoteExplorerView.ts (1)

227-238: Deep-clone notebooks when duplicating.

{ ...targetNotebook } and { ...block } only make shallow copies. The new notebook ends up sharing outputs, metadata, and any other nested structures with the original, so mutating the duplicate (e.g. running a cell that rewrites outputs) also mutates the source notebook and can even lead to YAML anchors when dumping. Clone the notebook (and its blocks) deeply before reassigning IDs.

-            const newNotebook: DeepnoteNotebook = {
-                ...targetNotebook,
-                id: generateUuid(),
-                name: newName,
-                blocks: targetNotebook.blocks.map((block: DeepnoteBlock) => ({
-                    ...block,
-                    id: generateUuid(),
-                    blockGroup: generateUuid(),
-                    executionCount: undefined,
-                    ...(block.metadata != null ? { metadata: { ...block.metadata } } : {})
-                }))
-            };
+            const newNotebook = globalThis.structuredClone
+                ? (globalThis.structuredClone(targetNotebook) as DeepnoteNotebook)
+                : (JSON.parse(JSON.stringify(targetNotebook)) as DeepnoteNotebook);
+            newNotebook.id = generateUuid();
+            newNotebook.name = newName;
+            newNotebook.blocks = newNotebook.blocks.map((block: DeepnoteBlock) => {
+                block.id = generateUuid();
+                block.blockGroup = generateUuid();
+                block.executionCount = undefined;
+                return block;
+            });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 10b52a7 and 79ad334.

📒 Files selected for processing (5)
  • package.json (3 hunks)
  • src/commands.ts (2 hunks)
  • src/notebooks/deepnote/deepnoteExplorerView.ts (4 hunks)
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (2 hunks)
  • src/platform/common/constants.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 .ts files (not suffixed with .node or .web)

Files:

  • src/commands.ts
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
  • src/platform/common/constants.ts
  • src/notebooks/deepnote/deepnoteExplorerView.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Use l10n.t() for user-facing strings
Use typed error classes from src/platform/errors/ when throwing or handling errors
Use the ILogger service instead of console.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 with CancellationToken

**/*.{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/commands.ts
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
  • src/platform/common/constants.ts
  • src/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 then property 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.ts
  • src/notebooks/deepnote/deepnoteExplorerView.ts
src/platform/**/*.ts

📄 CodeRabbit inference engine (.github/instructions/platform.instructions.md)

src/platform/**/*.ts: Use Inversify decorators for DI: annotate classes with @Injectable() and inject dependencies with @Inject(Token)
Use the centralized logger (import { logger } from '../platform/logging') instead of console.log for application logging

Files:

  • src/platform/common/constants.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (2)
src/test/vscode-mock.ts (1)
  • mockedVSCodeNamespaces (17-17)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (24-102)
src/notebooks/deepnote/deepnoteExplorerView.ts (3)
src/notebooks/deepnote/deepnoteProjectUtils.ts (1)
  • readDeepnoteProjectFile (5-10)
src/notebooks/deepnote/deepnoteTreeItem.ts (2)
  • DeepnoteTreeItem (24-102)
  • DeepnoteTreeItemContext (15-19)
src/platform/common/uuid.ts (1)
  • generateUuid (10-61)
🔇 Additional comments (7)
src/platform/common/constants.ts (1)

240-249: Command IDs added — looks consistent.
Names align with package.json and src/commands.ts.

package.json (1)

908-961: Notebook toolbar remap — OK.
Ordering and new addInputDateRangeBlock entry look coherent.

src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (4)

740-904: createAndAddNotebookToProject tests — solid.
Covers happy path, cancel, and name suggestion.


906-1087: renameNotebook tests — solid.
Validates rename, early returns, metadata update, and messaging.


1090-1248: deleteNotebook tests — solid.
Confirms confirmation gate, YAML update, and messaging.


1250-1456: duplicateNotebook tests — solid.
Ensures IDs regenerated and executionCount cleared on copy.

src/commands.ts (1)

189-211: Handlers not found; cannot confirm if [] is appropriate without seeing implementation.

Commands are declared in package.json but no handler registrations exist in the codebase. If these will be tree context menu commands, they likely need context arguments (like { treeItem: TreeItem } or similar). Update type mappings if handlers receive arguments, otherwise confirm handlers ignore args.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 30, 2025
@tkislan tkislan requested a review from saltenasl October 31, 2025 08:59
Copy link
Member

@saltenasl saltenasl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all works well, except everytime i make a change the Deepnote explorer gets refreshed (and even resorted)

Screen.Recording.2025-10-31.at.16.49.35.mov

* feat(open-in-deepnote): button in toolbar

* chore: fix tests
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 31, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (2)

138-138: Replace console.error with ILogger service.

Per coding guidelines, use the injected ILogger service instead of console.error for error logging.

Based on coding guidelines.


196-196: Replace console.error with ILogger service.

Per coding guidelines, use the injected ILogger service instead of console.error.

Based on coding guidelines.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4d09262 and 78fae38.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts (3 hunks)
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/!(*.node|*.web).ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Place shared cross-platform logic in common .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Use l10n.t() for user-facing strings
Use typed error classes from src/platform/errors/ when throwing or handling errors
Use the ILogger service instead of console.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 with CancellationToken

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
**/*.unit.test.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Place unit tests in files matching *.unit.test.ts

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.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 then property to avoid hanging tests

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (3)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
src/platform/deepnote/deepnoteTypes.ts (2)
  • DeepnoteProject (12-12)
  • DeepnoteNotebook (18-18)
src/notebooks/deepnote/deepnoteProjectUtils.ts (1)
  • readDeepnoteProjectFile (5-10)
src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts (2)
src/platform/deepnote/deepnoteTypes.ts (1)
  • DeepnoteProject (12-12)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
🔇 Additional comments (5)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (4)

18-18: Good refactoring to centralize YAML parsing.

Extracting file reading into a dedicated utility improves maintainability and reduces duplication.


143-148: LGTM: Correct alphabetical sorting implementation.

Properly handles case-insensitive comparison with localeCompare and includes defensive checks for non-string labels.


157-164: LGTM: Proper notebook sorting with immutability.

Creates a copy before sorting (avoiding mutation) and applies consistent case-insensitive alphabetical ordering.


189-189: LGTM: Clean refactoring to use utility.

Delegates YAML parsing to the centralized utility function.

src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts (1)

388-500: LGTM: Comprehensive notebook sorting tests.

Both tests properly exercise the provider's getChildren method and verify alphabetical ordering, including case-insensitive behavior.

@Artmann
Copy link
Member

Artmann commented Nov 1, 2025

all works well, except everytime i make a change the Deepnote explorer gets refreshed (and even resorted)

Screen.Recording.2025-10-31.at.16.49.35.mov

I've pushed a few fixes for this.

  1. Order projects and notebooks alphabetically.
  2. Don't recreate the entire tree when we do crud operations.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (2)

227-227: Use ILogger instead of console.error.

Coding guidelines require ILogger service for error logging.

As per coding guidelines.


284-286: Use ILogger instead of console.error.

Line 285 violates coding guidelines requiring ILogger service.

As per coding guidelines.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf1722 and 595d867.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts (7 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/!(*.node|*.web).ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Place shared cross-platform logic in common .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Use l10n.t() for user-facing strings
Use typed error classes from src/platform/errors/ when throwing or handling errors
Use the ILogger service instead of console.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 with CancellationToken

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
🧬 Code graph analysis (1)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (3)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
src/platform/deepnote/deepnoteTypes.ts (2)
  • DeepnoteProject (12-12)
  • DeepnoteNotebook (18-18)
src/notebooks/deepnote/deepnoteProjectUtils.ts (1)
  • readDeepnoteProjectFile (5-10)
🔇 Additional comments (2)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (2)

18-18: LGTM: Extraction to shared utility.

Delegating YAML parsing to readDeepnoteProjectFile improves maintainability.


232-237: Alphabetical sorting addresses reviewer feedback.

Case-insensitive, locale-aware sorting aligns with PR objectives to fix resort behavior.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 595d867 and bf17ea9.

📒 Files selected for processing (5)
  • src/notebooks/deepnote/deepnoteActivationService.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteExplorerView.ts (5 hunks)
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (4 hunks)
  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts (6 hunks)
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/!(*.node|*.web).ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Place shared cross-platform logic in common .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/deepnoteActivationService.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
  • src/notebooks/deepnote/deepnoteExplorerView.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Use l10n.t() for user-facing strings
Use typed error classes from src/platform/errors/ when throwing or handling errors
Use the ILogger service instead of console.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 with CancellationToken

Files:

  • src/notebooks/deepnote/deepnoteActivationService.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
  • src/notebooks/deepnote/deepnoteExplorerView.ts
  • src/notebooks/deepnote/deepnoteTreeDataProvider.ts
**/*.unit.test.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Place unit tests in files matching *.unit.test.ts

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
  • 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 then property to avoid hanging tests

Files:

  • src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts
  • src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts
🧬 Code graph analysis (4)
src/notebooks/deepnote/deepnoteTreeDataProvider.unit.test.ts (2)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (1)
  • compareTreeItemsByLabel (24-28)
src/notebooks/deepnote/deepnoteExplorerView.unit.test.ts (3)
src/test/vscode-mock.ts (1)
  • mockedVSCodeNamespaces (17-17)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
src/notebooks/deepnote/deepnoteSerializer.ts (2)
  • DeepnoteFile (10-10)
  • DeepnoteNotebook (10-10)
src/notebooks/deepnote/deepnoteExplorerView.ts (4)
src/notebooks/types.ts (2)
  • IDeepnoteNotebookManager (37-37)
  • IDeepnoteNotebookManager (38-58)
src/notebooks/deepnote/deepnoteProjectUtils.ts (1)
  • readDeepnoteProjectFile (5-10)
src/notebooks/deepnote/deepnoteTreeItem.ts (2)
  • DeepnoteTreeItem (25-107)
  • DeepnoteTreeItemContext (16-20)
src/platform/common/uuid.ts (1)
  • generateUuid (10-61)
src/notebooks/deepnote/deepnoteTreeDataProvider.ts (4)
src/notebooks/deepnote/deepnoteTreeItem.ts (1)
  • DeepnoteTreeItem (25-107)
src/platform/logging/index.ts (1)
  • logger (35-48)
src/platform/deepnote/deepnoteTypes.ts (2)
  • DeepnoteProject (12-12)
  • DeepnoteNotebook (18-18)
src/notebooks/deepnote/deepnoteProjectUtils.ts (1)
  • readDeepnoteProjectFile (5-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build & Test

Copy link
Member

@saltenasl saltenasl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works great now, thanks both @tkislan and @Artmann !

@saltenasl saltenasl merged commit 2cf42fd into main Nov 1, 2025
14 checks passed
@saltenasl saltenasl deleted the tomaskislan/deepnote-notebook-management branch November 1, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants