Skip to content

Conversation

@jankuca
Copy link
Member

@jankuca jankuca commented Oct 20, 2025

Screenshot 2025-10-20 at 16 32 48 Screenshot 2025-10-20 at 16 25 07 Screenshot 2025-10-20 at 16 25 12 Screenshot 2025-10-20 at 16 33 46

Summary by CodeRabbit

  • New Features
    • SQL cells now show multiple status items: current integration and SQL variable name, with fallbacks for "No integration connected" and unknown integrations; supports DuckDB/DataFrame and friendly labels (PostgreSQL, BigQuery). Inline actions let you switch or configure integrations and rename the SQL variable via a quick-pick or prompt.
  • Tests
    • Expanded unit tests covering status bar displays, integration switching, variable renaming flows, command handlers, event propagation, and related UI scenarios.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

📝 Walkthrough

Walkthrough

The status bar provider now returns multiple NotebookCellStatusBarItem entries per SQL cell: an integration-status item and a persistent variable-name item. It adds LocalQuickPickItem, registers commands deepnote.updateSqlVariableName and deepnote.switchSqlIntegration, and implements variable-name storage in deepnote_variable_name cell metadata with an input/validation flow that applies a WorkspaceEdit. Integration selection supports configured integrations plus an internal DuckDB/DataFrame special case and updates sql_integration_id in metadata. Status bar refreshes on notebook document and integration-config changes. Unit tests cover the new flows and edge cases.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Status Bar / Commands
    participant Provider as sqlCellStatusBarProvider
    participant CellMeta as Cell Metadata
    participant IntegrStore as Integration Store / QuickPick
    participant WS as WorkspaceEdit

    UI->>Provider: provideCellStatusBarItems(cell)
    Provider->>CellMeta: read sql_integration_id, deepnote_variable_name
    Provider->>IntegrStore: fetch integrations (if project)
    alt integration == DATAFRAME_SQL_INTEGRATION_ID
        Provider->>Provider: build DuckDB/DataFrame item
    else integration known
        Provider->>Provider: build integration item (switch)
    else none/unknown
        Provider->>Provider: build "No integration connected" item
    end
    Provider->>Provider: build variable-name item
    Provider-->>UI: return [integrationItem, variableItem]

    UI->>Provider: executeCommand(deepnote.updateSqlVariableName, cell)
    Provider->>UI: showInputBox(currentName)
    alt valid input
        Provider->>WS: apply metadata.deepnote_variable_name = newName
        WS->>CellMeta: metadata updated
        Provider-->>UI: fire onDidChangeCellStatusBarItems(cell)
    else cancel/invalid
        Provider-->>UI: no change
    end

    UI->>Provider: executeCommand(deepnote.switchSqlIntegration, cell)
    Provider->>IntegrStore: present QuickPick (configured + DuckDB + Configure option)
    UI->>Provider: select option
    alt choose integration
        Provider->>WS: apply metadata.sql_integration_id = selectedId
        WS->>CellMeta: metadata updated
        Provider-->>UI: fire onDidChangeCellStatusBarItems(cell)
    else choose Configure current integration
        Provider->>IntegrStore: open integration management UI
    else cancel
        Provider-->>UI: no change
    end
Loading

Possibly related PRs

  • deepnote/deepnote-internal#18455 — related DuckDB/DataFrame SQL special-casing using DATAFRAME_SQL_INTEGRATION_ID; touches similar UI handling for SQL cells.

Suggested reviewers

  • jamesbhobbs
  • Artmann
  • andyjakubowski
  • saltenasl

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: SQL block variable input and integration switching" directly maps to the two primary user-facing features introduced in this PR: the ability to set custom variable names for SQL cells (via updateVariableName) and to switch between integrations (via switchIntegration). The title is specific, concise, and clearly communicates the main additions without unnecessary detail like implementation specifics or file names. A teammate reviewing history would immediately understand this adds new SQL cell interaction capabilities.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6a3f56 and 984f071.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/!(*.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/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (8)
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-21T15:14:08.102Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:118-128
Timestamp: 2025-10-21T15:14:08.102Z
Learning: In the vscode-deepnote project, `NotebookCellStatusBarAlignment` cannot be imported from 'vscode'. Always use numeric values with inline comments (e.g., `alignment: 1, // NotebookCellStatusBarAlignment.Left`) instead of attempting to import and use the enum constant.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-22T11:56:07.943Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-10-22T11:56:07.943Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod over TypeScript enum (prefer type/const objects/zod.enum)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/test/mocks/vsc/extHostedTypes.ts (2)
  • WorkspaceEdit (649-833)
  • NotebookEdit (2444-2507)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
🔇 Additional comments (10)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (10)

27-32: LGTM!

Type-safe extension of QuickPickItem improves code clarity.


48-110: LGTM!

Command handlers properly fall back to active editor when cell not provided. Disposables are correctly registered.


112-126: LGTM!

Provider correctly filters by language and respects cancellation.


128-139: LGTM!

Type-safe metadata access with proper guards.


141-170: LGTM!

Multiple status bar items with explicit priorities ensure stable ordering. Object literals conform to VS Code API.

Based on learnings.


172-212: LGTM!

DuckDB special case handled correctly. Gracefully returns undefined when projectId missing.


214-228: LGTM!

Variable name properly localized with placeholder syntax.


230-240: LGTM!

Type-safe with sensible default.


242-283: LGTM!

Input validation, trimming, and error handling are comprehensive. Edit success verified before UI update.


285-405: LGTM!

Integration switching flow is comprehensive: unknown integration handling, early returns for no-op, edit validation, and proper error feedback. Type guard prevents unsafe access.


Comment @coderabbitai help to get the list of available commands and usage tips.

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: 6

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/sqlCellStatusBarProvider.ts (2)

128-166: Use class constructor + enum alignment for integration item.

Same issue here; build via constructor and drop magic number.

-        if (integrationId === DATAFRAME_SQL_INTEGRATION_ID) {
-            return {
-                text: `$(database) ${l10n.t('DataFrame SQL (DuckDB)')}`,
-                alignment: 1, // NotebookCellStatusBarAlignment.Left
-                tooltip: l10n.t('Internal DuckDB integration for querying DataFrames\nClick to switch'),
-                command: {
-                    title: l10n.t('Switch Integration'),
-                    command: 'deepnote.switchSqlIntegration',
-                    arguments: [cell]
-                }
-            };
-        }
+        if (integrationId === DATAFRAME_SQL_INTEGRATION_ID) {
+            const sb = new NotebookCellStatusBarItem(
+                `$(database) ${l10n.t('DataFrame SQL (DuckDB)')}`,
+                NotebookCellStatusBarAlignment.Left
+            );
+            sb.tooltip = l10n.t('Internal DuckDB integration for querying DataFrames\nClick to switch');
+            sb.command = { title: l10n.t('Switch Integration'), command: 'deepnote.switchSqlIntegration', arguments: [cell] };
+            return sb;
+        }
@@
-        return {
-            text: `$(database) ${displayName}`,
-            alignment: 1, // NotebookCellStatusBarAlignment.Left
-            tooltip: l10n.t('SQL Integration: {0}\nClick to switch or configure', displayName),
-            command: {
-                title: l10n.t('Switch Integration'),
-                command: 'deepnote.switchSqlIntegration',
-                arguments: [cell]
-            }
-        };
+        const sb = new NotebookCellStatusBarItem(
+            `$(database) ${displayName}`,
+            NotebookCellStatusBarAlignment.Left
+        );
+        sb.tooltip = l10n.t('SQL Integration: {0}\nClick to switch or configure', displayName);
+        sb.command = { title: l10n.t('Switch Integration'), command: 'deepnote.switchSqlIntegration', arguments: [cell] };
+        return sb;

69-83: Propagate CancellationToken into async helpers.

createStatusBarItems performs awaits; pass token downstream and bail early if cancelled to avoid wasted work.

-    public provideCellStatusBarItems(
+    public provideCellStatusBarItems(
         cell: NotebookCell,
         token: CancellationToken
     ): ProviderResult<NotebookCellStatusBarItem | NotebookCellStatusBarItem[]> {
@@
-        return this.createStatusBarItems(cell);
+        return this.createStatusBarItems(cell, token);
     }
@@
-    private async createStatusBarItems(cell: NotebookCell): Promise<NotebookCellStatusBarItem[]> {
+    private async createStatusBarItems(cell: NotebookCell, token?: CancellationToken): Promise<NotebookCellStatusBarItem[]> {
         const items: NotebookCellStatusBarItem[] = [];
@@
-        if (integrationId) {
+        if (token?.isCancellationRequested) return items;
+        if (integrationId) {
             const integrationItem = await this.createIntegrationStatusBarItem(cell, integrationId);
             if (integrationItem) {
                 items.push(integrationItem);
             }
         } else {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b499f3 and 65804ed.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (3 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 .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.unit.test.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
🔇 Additional comments (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (1)

24-25: Dismiss review comment—current import and usage are correct.

The file already imports from the canonical source (src/platform/notebooks/deepnote/integrationTypes). The enum defined there supports the IntegrationType.Postgres and IntegrationType.BigQuery member access used at lines 324–326. The alternative type in src/webviews/webview-side/integrations/types.ts is a string union ('postgres' | 'bigquery') and lacks enum members—switching to it would cause a compile error.

Likely an incorrect or invalid review comment.

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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65804ed and 8590632.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/!(*.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/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (7)
📚 Learning: 2025-10-20T15:03:43.182Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.182Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:08:08.244Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.244Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.268Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🔇 Additional comments (3)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)

1-67: Command registration looks good.

Imports are organized correctly and commands are properly wired to their handlers.


128-166: Integration item creation handles DuckDB and missing projectId correctly.


168-181: Variable item now properly localized.

The prefix is now internationalized using l10n.t with placeholder. Good improvement.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 20, 2025
Base automatically changed from jk/feat/sql-block-credentials to main October 21, 2025 13:25
@jankuca jankuca dismissed coderabbitai[bot]’s stale review October 21, 2025 13:25

The base branch was changed.

@jankuca jankuca force-pushed the jk/feat/sql-block-variable-input branch from 3b06e78 to 10b6569 Compare October 21, 2025 13:46
@deepnote deepnote deleted a comment from linear bot Oct 21, 2025
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 92.24806% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 71%. Comparing base (f142367) to head (83f6a8f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/notebooks/deepnote/sqlCellStatusBarProvider.ts 74% 17 Missing and 11 partials ⚠️
...oks/deepnote/sqlCellStatusBarProvider.unit.test.ts 99% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main     #86    +/-   ##
======================================
  Coverage     71%     71%            
======================================
  Files        527     527            
  Lines      39500   39864   +364     
  Branches    4935    4961    +26     
======================================
+ Hits       28312   28650   +338     
- Misses      9547    9562    +15     
- Partials    1641    1652    +11     
Files with missing lines Coverage Δ
...oks/deepnote/sqlCellStatusBarProvider.unit.test.ts 99% <99%> (-1%) ⬇️
src/notebooks/deepnote/sqlCellStatusBarProvider.ts 77% <74%> (-4%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jankuca jankuca force-pushed the jk/feat/sql-block-variable-input branch 2 times, most recently from 7f45c61 to ddfc066 Compare October 21, 2025 14:04
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: 5

Caution

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

⚠️ Outside diff range comments (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (1)

143-165: Also assert command/alignment for unknown-config case.

Keeps UI guarantees consistent across scenarios.

         assert.isDefined(result);
         assert.isArray(result);
         const items = result as any[];
         assert.strictEqual(items.length, 2);
         assert.strictEqual(items[0].text, '$(database) Unknown integration (configure)');
         assert.strictEqual(items[1].text, 'Variable: df');
+        // Command and alignment stay consistent
+        assert.strictEqual(items[0].alignment, 1);
+        assert.isDefined(items[0].command);
+        assert.strictEqual(items[0].command.command, 'deepnote.switchSqlIntegration');

NotebookCellStatusBarAlignment enum isn’t available in tests; numeric 1 is intended. Based on learnings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b28a4a6 and 3be7bd1.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (3 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 .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.unit.test.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (9)
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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} : Follow existing test patterns (see packages/blocks/src/blocks/*.test.ts); write clear names, group with describe(), cover edge cases, errors, special characters, and verify exact output for code-generation functions

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Applies to **/*.{ts,tsx} : Use `l10n.t()` for user-facing strings

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (4)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/test/mocks/vsc/extHostedTypes.ts (2)
  • WorkspaceEdit (649-833)
  • NotebookEdit (2444-2507)
src/test/datascience/ipywidgets/samples/beakerx/extension.js (1)
  • workspace (21144-21144)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
🔇 Additional comments (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (1)

330-339: Type label mapping looks good.

String enum values keep the default branch safe; localized labels for known types are clear.

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

♻️ Duplicate comments (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (1)

184-187: Add alignment assert for consistency.

After asserting text, also assert alignment === 1 for the single variable item (enum not available).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3be7bd1 and ddfc066.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (5 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 .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.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

**/*.{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/sqlCellStatusBarProvider.unit.test.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/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.unit.test.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
🧠 Learnings (3)
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.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} : Follow existing test patterns (see packages/blocks/src/blocks/*.test.ts); write clear names, group with describe(), cover edge cases, errors, special characters, and verify exact output for code-generation functions

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Applies to **/*.{ts,tsx} : Use `l10n.t()` for user-facing strings

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
🪛 GitHub Actions: CI
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts

[error] 357-357: ESLint: Unexpected empty method 'dispose'. (no-empty-function)

🪛 GitHub Check: Lint & Format
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts

[failure] 473-473:
Unexpected empty method 'dispose'


[failure] 357-357:
Unexpected empty method 'dispose'

🔇 Additional comments (7)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (7)

55-68: Good coverage for “no integration” path.

Assertions cover both items, commands, and alignment=1 (enum unavailable in tests). Looks solid. Based on learnings


82-99: DuckDB/DataFrame case verified well.

Text, tooltip, alignment, and command wiring are exercised; variable item also validated.


131-145: Integration-resolved path looks correct.

Checks include text, alignment, command id, and arguments [cell].


163-169: Unknown integration fallback OK.

Two items returned with expected texts.


220-223: Custom variable name scenario covered.

Confirms metadata-driven label.


297-313: Event propagation test is precise.

Validates onDidChangeCellStatusBarItems fires on integration changes.


352-359: Change empty dispose function to return undefined—but clarify with a comment instead.

The proposed fix works around ESLint's no-empty-function rule, but returning undefined is semantically odd for a mock dispose function. Better approaches:

  1. Add an ESLint disable comment:

    return { dispose: () => { /* eslint-disable-next-line no-empty-function */ } };
  2. Or add an explanatory comment:

    return { dispose: () => { /* intentionally empty mock */ } };
  3. Or keep the undefined return with a reason:

    return { dispose: () => undefined }; // mock dispose, no cleanup needed

The undefined return technically fixes the lint error but obscures intent. If you proceed with this change, add a comment explaining why.

@jankuca jankuca force-pushed the jk/feat/sql-block-variable-input branch from ddfc066 to 4566419 Compare October 21, 2025 14:44
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: 7

♻️ Duplicate comments (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (2)

341-351: Fix ESLint warning: avoid empty dispose.

Return a no-op without an empty function body.

-                return {
-                    dispose: () => {
-                        return;
-                    }
-                };
+                return { dispose: () => undefined };

463-471: Fix ESLint warning: avoid empty dispose.

Same as above for switch command stub.

-                    return {
-                        dispose: () => {
-                            return;
-                        }
-                    };
+                    return { dispose: () => undefined };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddfc066 and 4566419.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (5 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 .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.unit.test.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (9)
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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} : Follow existing test patterns (see packages/blocks/src/blocks/*.test.ts); write clear names, group with describe(), cover edge cases, errors, special characters, and verify exact output for code-generation functions

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Applies to **/*.{ts,tsx} : Use `l10n.t()` for user-facing strings

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (5)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
src/platform/notebooks/deepnote/types.ts (2)
  • IIntegrationStorage (6-6)
  • IIntegrationStorage (7-42)
src/test/vscode-mock.ts (1)
  • resetVSCodeMocks (60-79)
src/test/mocks/vsc/index.ts (1)
  • EventEmitter (65-89)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
⏰ 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). (2)
  • GitHub Check: Build & Test
  • GitHub Check: Build & Package Extension
🔇 Additional comments (3)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)

51-75: Defensive command guards: nice.

Optional cell param with early error is correct and prevents palette crashes.


106-135: Status bar assembly looks solid.

Correct SQL-only gating, “no integration” case handled, and variable item always added with priority for order.


179-193: Variable item: trimmed validation pipeline aligns with UX.

Text, alignment, priority, tooltip, and command are consistent. Good.

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: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4566419 and 844ee6d.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (5 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 .ts files (not suffixed with .node or .web)

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.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

**/*.{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/sqlCellStatusBarProvider.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.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/sqlCellStatusBarProvider.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/sqlCellStatusBarProvider.unit.test.ts
🧠 Learnings (10)
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 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/sqlCellStatusBarProvider.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} : Follow existing test patterns (see packages/blocks/src/blocks/*.test.ts); write clear names, group with describe(), cover edge cases, errors, special characters, and verify exact output for code-generation functions

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Applies to **/*.{ts,tsx} : Use `l10n.t()` for user-facing strings

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/test/mocks/vsc/extHostedTypes.ts (2)
  • WorkspaceEdit (649-833)
  • NotebookEdit (2444-2507)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/platform/notebooks/deepnote/types.ts (2)
  • IIntegrationStorage (6-6)
  • IIntegrationStorage (7-42)
⏰ 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). (3)
  • GitHub Check: Build & Package Extension
  • GitHub Check: Build & Test
  • GitHub Check: Lint & Format
🔇 Additional comments (2)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (2)

51-71: Good: commands are guarded for palette invocation.

Early-return with a localized error when no cell is passed is correct.


24-24: IntegrationType is properly exported; no compilation issue.

The symbol is correctly exported from src/platform/notebooks/deepnote/integrationTypes.ts as an enum at line 10. The import at sqlCellStatusBarProvider.ts:24 will compile successfully.

Note: A duplicate IntegrationType definition exists in src/webviews/webview-side/integrations/types.ts as a union type, creating two separate type definitions in the codebase. Consider consolidating to a single source of truth if both are actively used.

Likely an incorrect or invalid review comment.

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/sqlCellStatusBarProvider.ts (2)

51-56: Also refresh on notebook cell metadata changes (external edits).

To keep the status bar in sync when metadata changes outside these commands, listen to notebook document changes for Deepnote notebooks.

 this.disposables.push(
     this.integrationStorage.onDidChangeIntegrations(() => {
         this._onDidChangeCellStatusBarItems.fire();
     })
 );
+
+// Refresh when any Deepnote notebook changes (e.g., metadata updated externally)
+this.disposables.push(
+    workspace.onDidChangeNotebookDocument((e) => {
+        if (e.document.notebookType === 'deepnote') {
+            this._onDidChangeCellStatusBarItems.fire();
+        }
+    })
+);

100-111: Optional: constants for metadata keys to reduce typo risk.

Small hygiene to avoid key drift.

+// Metadata keys
+const SQL_INTEGRATION_ID_KEY = 'sql_integration_id' as const;
+const DEEPNOTE_VARIABLE_NAME_KEY = 'deepnote_variable_name' as const;
@@
-            const integrationId = (metadata as Record<string, unknown>).sql_integration_id;
+            const integrationId = (metadata as Record<string, unknown>)[SQL_INTEGRATION_ID_KEY];
@@
-            const variableName = (metadata as Record<string, unknown>).deepnote_variable_name;
+            const variableName = (metadata as Record<string, unknown>)[DEEPNOTE_VARIABLE_NAME_KEY];
@@
-            deepnote_variable_name: newVariableName
+            [DEEPNOTE_VARIABLE_NAME_KEY]: newVariableName
@@
-            sql_integration_id: selectedId
+            [SQL_INTEGRATION_ID_KEY]: selectedId

Also applies to: 202-213, 244-245, 350-355

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 844ee6d and 8296452.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/!(*.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/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (8)
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-21T15:14:08.083Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:118-128
Timestamp: 2025-10-21T15:14:08.083Z
Learning: In the vscode-deepnote project, `NotebookCellStatusBarAlignment` cannot be imported from 'vscode'. Always use numeric values with inline comments (e.g., `alignment: 1, // NotebookCellStatusBarAlignment.Left`) instead of attempting to import and use the enum constant.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/test/mocks/vsc/extHostedTypes.ts (2)
  • WorkspaceEdit (649-833)
  • NotebookEdit (2444-2507)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
⏰ 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). (2)
  • GitHub Check: Build & Package Extension
  • GitHub Check: Build & Test
🔇 Additional comments (12)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (12)

7-16: Imports grouping looks good.

External vs local imports are separated; added VS Code symbols are used. LGTM.


26-31: Typed QuickPick items: nice and safe.

LocalQuickPickItem eliminates casts later. LGTM.


58-78: Defensive command handlers: good guards.

Graceful handling when invoked from the palette without a cell. LGTM.


113-142: Multi-item composition with priorities: solid.

Deterministic order via priority; numeric alignment with inline comment is correct for this repo. LGTM. Based on learnings.


124-135: “No integration connected” item: correct API usage.

Object literal conforms to NotebookCellStatusBarItem; numeric alignment with comment is appropriate here. LGTM. Based on learnings.


148-161: DuckDB/DataFrame special case: LGTM.

Clear tooltip and command wiring; priority set.


172-183: Integration item with fallback label: LGTM.

Good l10n use; correct command.


186-200: Variable item: localized and prioritized.

Validation entry point wired correctly. LGTM.


202-213: Variable name read with sensible default.

Default 'df' is fine; access guarded. LGTM.


214-254: Update flow: trimmed input and edit result check.

Good UX and robustness; error surfaced on failure; event fired on success. LGTM.


256-365: Integration switching flow is robust.

Unknown-current handling, separator correctness, early no-op, and edit-result check all look good. LGTM. Based on learnings.


23-25: Import uses canonical IntegrationType—verified.

The file correctly imports from src/platform/notebooks/deepnote/integrationTypes.ts, which is the canonical enum. A duplicate type exists in src/webviews/webview-side/integrations/types.ts, but it's isolated to webviews and doesn't contaminate this import.

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 (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (1)

178-181: Guard integration config fetch; degrade gracefully on errors.

Avoids unhandled rejection breaking the provider.

-const config = await this.integrationStorage.getProjectIntegrationConfig(projectId, integrationId);
-const displayName = config?.name || l10n.t('Unknown integration (configure)');
+let displayName = l10n.t('Unknown integration (configure)');
+try {
+    const config = await this.integrationStorage.getProjectIntegrationConfig(projectId, integrationId);
+    displayName = config?.name || displayName;
+} catch {
+    // keep fallback
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8296452 and d6a3f56.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/!(*.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/sqlCellStatusBarProvider.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/notebooks/deepnote/sqlCellStatusBarProvider.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧠 Learnings (8)
📚 Learning: 2025-10-20T15:03:43.208Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:98-126
Timestamp: 2025-10-20T15:03:43.208Z
Learning: In VS Code's notebook API, NotebookCellStatusBarItem is an interface, not a class with a constructor. Status bar items should be created as plain object literals that conform to the NotebookCellStatusBarItem interface. Do not suggest using `new NotebookCellStatusBarItem(...)` in TypeScript files working with VS Code notebooks.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-21T15:14:08.083Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:118-128
Timestamp: 2025-10-21T15:14:08.083Z
Learning: In the vscode-deepnote project, `NotebookCellStatusBarAlignment` cannot be imported from 'vscode'. Always use numeric values with inline comments (e.g., `alignment: 1, // NotebookCellStatusBarAlignment.Left`) instead of attempting to import and use the enum constant.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:08:08.268Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts:51-64
Timestamp: 2025-10-20T15:08:08.268Z
Learning: In the vscode-deepnote test files (*.unit.test.ts), `NotebookCellStatusBarAlignment` cannot be imported from 'vscode' and is not available in the test environment. Use the numeric value (1 for Left alignment) directly in assertions instead.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-20T15:07:05.323Z
Learnt from: jankuca
PR: deepnote/vscode-deepnote#86
File: src/notebooks/deepnote/sqlCellStatusBarProvider.ts:277-280
Timestamp: 2025-10-20T15:07:05.323Z
Learning: In VS Code QuickPickItem API, when creating a separator using QuickPickItemKind.Separator, the label property is required (even if empty). Do not suggest removing the label property from separator items.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-10-07T15:31:30.150Z
Learnt from: hc2p
PR: deepnote/deepnote-internal#18615
File: apps/webapp-client/src/api/integration-api.ts:204-204
Timestamp: 2025-10-07T15:31:30.150Z
Learning: In apps/webapp-client/src/api/integration-api.ts, when reviewing bug fixes authored by the PR creator (e.g., changing integration.state to integration.type), use informational tone rather than marking as critical issues, since the fix is already implemented.

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:33:33.332Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-09-30T12:33:33.332Z
Learning: Applies to **/*.{ts,tsx} : Do not use TypeScript enum; prefer string literal unions or const objects (or zod enums when runtime needed)

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-09-30T12:34:31.202Z
Learnt from: CR
PR: deepnote/deepnote-internal#0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-09-30T12:34:31.202Z
Learning: Applies to **/*.{ts,tsx} : Use string literal unions or zod schemas instead of TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
📚 Learning: 2025-08-18T23:41:22.727Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CONVENTIONS.md:0-0
Timestamp: 2025-08-18T23:41:22.727Z
Learning: Applies to **/*.{ts,tsx} : Prefer string literal unions or zod schemas over TypeScript enum

Applied to files:

  • src/notebooks/deepnote/sqlCellStatusBarProvider.ts
🧬 Code graph analysis (1)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (3)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
  • DATAFRAME_SQL_INTEGRATION_ID (5-5)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookEdit (2444-2507)
src/webviews/webview-side/integrations/types.ts (1)
  • IntegrationType (1-1)
⏰ 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). (3)
  • GitHub Check: Build & Package Extension
  • GitHub Check: Build & Test
  • GitHub Check: Lint & Format
🔇 Additional comments (4)
src/notebooks/deepnote/sqlCellStatusBarProvider.ts (4)

123-152: Status bar composition looks solid.

Correct item splitting, priorities, and numeric alignment with inline comment.

Based on learnings


196-210: Variable item: LGTM.

Good localization, priority, and command wiring.


158-171: DuckDB special-case item: LGTM.

Clear label, tooltip, and command.


377-386: No issues found. Import and usage are correct.

The method imports IntegrationType from the correct source (src/platform/notebooks/deepnote/integrationTypes.ts—the enum, not the webview union). The switch statement covers all enum members exhaustively with a safe default fallback. No drift risk; the platform layer is internally consistent.

@jankuca jankuca marked this pull request as ready for review October 22, 2025 14:27
@jankuca
Copy link
Member Author

jankuca commented Oct 23, 2025

@saltenasl FYI I re-tested the df sql (duckdb) and it seems to work ok for me 🤷🏻

duckdb.mov

@jankuca jankuca enabled auto-merge (squash) October 23, 2025 08:56
@jankuca
Copy link
Member Author

jankuca commented Oct 23, 2025

Merging this. If it still does not work for you, we will iterate and fix it in another way.

@jankuca jankuca merged commit 8597009 into main Oct 23, 2025
11 checks passed
@jankuca jankuca deleted the jk/feat/sql-block-variable-input branch October 23, 2025 08:59
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.

3 participants