Skip to content

Conversation

@tkislan
Copy link
Member

@tkislan tkislan commented Oct 13, 2025

image

Summary by CodeRabbit

  • New Features

    • Added Deepnote input block support (text, textarea, select, slider, checkbox, date, date range, file, button) with per-type schemas, defaults, validation, and reliable round‑trip conversion to editable JSON notebook cells.
    • Added a cell status bar showing Deepnote input block type for supported cells and registered it as an activation service.
  • Tests

    • Comprehensive unit tests for all input converters and the status bar provider covering conversions, defaults, error handling, and raw-content fallback.

@linear
Copy link

linear bot commented Oct 13, 2025

GRN-4776 Support input blocks

We'll transform them into code blocks that set the variable with the defined value.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

📝 Walkthrough

Walkthrough

Adds a Deepnote input conversion framework and nine concrete converters in src/notebooks/deepnote/converters/inputConverters.ts (BaseInputBlockConverter plus converters for text, textarea, select, slider, checkbox, date, date-range, file, and button). Adds corresponding zod schemas in deepnoteSchemas, registers converters in DeepnoteDataConverter, introduces a NotebookCellStatusBarItemProvider for Deepnote input blocks and registers it in service registries, and adds unit tests for converters and the status-bar provider. Converters validate/serialize metadata, preserve raw content on parse failures, and round-trip cell ↔ DeepnoteBlock metadata.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant VSCode as "VS Code Notebook"
  participant DataConv as "DeepnoteDataConverter"
  participant Registry as "Converters Registry"
  participant Conv as "Input*BlockConverter"
  participant Schema as "Zod Schema"

  note over DataConv,Registry: register 9 input converters on init
  DataConv->>Registry: register(InputText,...,Button)

  User->>VSCode: open Deepnote notebook
  VSCode->>DataConv: request convert blocks -> cells
  DataConv->>Registry: get converters for each block
  loop per block
    DataConv->>Conv: canConvert(block.type)?
    alt supported
      DataConv->>Conv: convertToCell(block)
      Conv->>Schema: validate/parse metadata
      alt raw content present
        Conv->>VSCode: NotebookCellData(value=raw JSON)
      else validation OK
        Conv->>VSCode: NotebookCellData(value=stringified metadata or defaults)
      else validation failed
        Conv->>VSCode: NotebookCellData(value=stringified defaults)
      end
    else not supported
      DataConv-->>DataConv: continue
    end
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant VSCode as "VS Code Notebook"
  participant Conv as "Input*BlockConverter"
  participant Schema as "Zod Schema"
  participant Block as "DeepnoteBlock"

  User->>VSCode: edit JSON cell value
  VSCode->>Conv: applyChangesToBlock(block, cell)
  Conv->>Schema: parseJsonWithFallback(cell.value)
  alt parse & schema OK
    Conv->>Block: remove DEEPNOTE_VSCODE_RAW_CONTENT_KEY if present
    Conv->>Block: merge parsed config into block.metadata
    Conv-->>VSCode: updated block metadata
  else parse/validation fails
    Conv->>Block: set metadata[DEEPNOTE_VSCODE_RAW_CONTENT_KEY] = cell.value
    Conv-->>VSCode: raw content stored on block
  end
Loading

Possibly related PRs

Suggested reviewers

  • Artmann
  • saltenasl
  • jamesbhobbs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: Support Deepnote input blocks" accurately and directly describes the primary change in this pull request. The changeset introduces a complete framework for handling nine types of Deepnote input blocks (text, textarea, select, slider, checkbox, date, date-range, file, and button) through new converters, schemas, and UI components. The title is concise, specific, and clear enough that a teammate scanning history would immediately understand the main objective without being misleading or vague.

📜 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 6691448 and 81ae526.

📒 Files selected for processing (2)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (2 hunks)
  • src/notebooks/serviceRegistry.node.ts (2 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/deepnoteDataConverter.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/deepnoteDataConverter.ts
  • src/notebooks/serviceRegistry.node.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
src/notebooks/deepnote/deepnoteDataConverter.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteDataConverter.ts performs Deepnote data transformations

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
**/*.node.ts

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

Use *.node.ts for Desktop-specific implementations that require full file system access and Python environments

Files:

  • src/notebooks/serviceRegistry.node.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations
Learnt from: tkislan
PR: deepnote/vscode-deepnote#41
File: src/notebooks/deepnote/deepnoteDataConverter.ts:296-314
Timestamp: 2025-10-16T13:09:32.543Z
Learning: For big-number blocks in src/notebooks/deepnote/deepnoteDataConverter.ts, invalid JSON validation and error handling is performed in the renderer (src/webviews/webview-side/chart-big-number-renderer) rather than in the converter layer. The converter can safely coerce text/plain to CHART_BIG_NUMBER_MIME_TYPE for big-number blocks without pre-validation.
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
📚 Learning: 2025-09-03T12:59:14.489Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/notebooks.instructions.md:0-0
Timestamp: 2025-09-03T12:59:14.489Z
Learning: Applies to src/notebooks/export/**/*.ts : Update FileConverter to handle the new export format

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
📚 Learning: 2025-10-16T13:09:32.543Z
Learnt from: tkislan
PR: deepnote/vscode-deepnote#41
File: src/notebooks/deepnote/deepnoteDataConverter.ts:296-314
Timestamp: 2025-10-16T13:09:32.543Z
Learning: For big-number blocks in src/notebooks/deepnote/deepnoteDataConverter.ts, invalid JSON validation and error handling is performed in the renderer (src/webviews/webview-side/chart-big-number-renderer) rather than in the converter layer. The converter can safely coerce text/plain to CHART_BIG_NUMBER_MIME_TYPE for big-number blocks without pre-validation.

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteActivationService.ts : deepnoteActivationService.ts manages VS Code activation for Deepnote

Applied to files:

  • src/notebooks/serviceRegistry.node.ts
🧬 Code graph analysis (1)
src/notebooks/deepnote/deepnoteDataConverter.ts (1)
src/notebooks/deepnote/converters/inputConverters.ts (9)
  • InputTextBlockConverter (77-89)
  • InputTextareaBlockConverter (91-103)
  • InputSelectBlockConverter (105-117)
  • InputSliderBlockConverter (119-131)
  • InputCheckboxBlockConverter (133-145)
  • InputDateBlockConverter (147-159)
  • InputDateRangeBlockConverter (161-173)
  • InputFileBlockConverter (175-187)
  • ButtonBlockConverter (189-201)
⏰ 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). (4)
  • GitHub Check: Build & Test
  • GitHub Check: Lint & Format
  • GitHub Check: Build & Package Extension
  • GitHub Check: copilot-setup-steps
🔇 Additional comments (4)
src/notebooks/deepnote/deepnoteDataConverter.ts (2)

18-28: LGTM!

Clean import grouping for all nine input converters. Multi-line formatting aids readability.


42-50: LGTM!

Converter registrations follow established pattern and maintain logical grouping. Input converters appropriately clustered together.

src/notebooks/serviceRegistry.node.ts (2)

69-69: Optional: Consider alphabetical import ordering.

The import could be placed after line 47 (near DeepnoteActivationService) or after line 71 (near DeepnoteCellCopyHandler) for alphabetical consistency, though the current placement is functionally correct.

⛔ Skipped due to learnings
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/ipywidgets.instructions.md:0-0
Timestamp: 2025-09-03T12:55:29.175Z
Learning: Applies to src/notebooks/controllers/ipywidgets/serviceRegistry.{node,web}.ts : Register DI services in platform-specific registries (serviceRegistry.node.ts vs serviceRegistry.web.ts)
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteActivationService.ts : deepnoteActivationService.ts manages VS Code activation for Deepnote
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/standalone.instructions.md:0-0
Timestamp: 2025-09-03T13:01:10.017Z
Learning: Applies to src/standalone/serviceRegistry.{node,web}.ts : Register new services for both platforms in serviceRegistry.node.ts and serviceRegistry.web.ts as appropriate
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/kernel-jupyter.instructions.md:0-0
Timestamp: 2025-09-03T12:56:39.535Z
Learning: Applies to src/kernels/jupyter/serviceRegistry.{node,web}.ts : Use dependency injection via the service registry for component creation and registration
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/serviceRegistry.{node,web}.ts : Register dependencies via DI with platform-appropriate services for Node and Web builds

172-175: No issues found. Registration is correct and consistent.

The provider correctly implements IExtensionSyncActivationService, is registered in both serviceRegistry.node.ts (line 174) and serviceRegistry.web.ts (line 113), and doesn't conflict with SqlCellStatusBarProvider (they handle different block types).


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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a476bfd and 01569a0.

📒 Files selected for processing (4)
  • src/notebooks/deepnote/converters/inputConverters.ts (1 hunks)
  • src/notebooks/deepnote/converters/inputConverters.unit.test.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (3 hunks)
  • src/notebooks/deepnote/deepnoteSchemas.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/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
  • src/notebooks/deepnote/converters/inputConverters.unit.test.ts
  • src/notebooks/deepnote/deepnoteSchemas.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/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
  • src/notebooks/deepnote/converters/inputConverters.unit.test.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
  • src/notebooks/deepnote/converters/inputConverters.unit.test.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
src/notebooks/deepnote/deepnoteDataConverter.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteDataConverter.ts performs Deepnote data transformations

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.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/converters/inputConverters.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/converters/inputConverters.unit.test.ts
🧠 Learnings (3)
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
  • src/notebooks/deepnote/converters/inputConverters.unit.test.ts
📚 Learning: 2025-09-03T12:59:14.489Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/notebooks.instructions.md:0-0
Timestamp: 2025-09-03T12:59:14.489Z
Learning: Applies to src/notebooks/export/**/*.ts : Update FileConverter to handle the new export format

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteTypes.ts : deepnoteTypes.ts contains Deepnote-related type definitions

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.ts
🧬 Code graph analysis (3)
src/notebooks/deepnote/deepnoteDataConverter.ts (1)
src/notebooks/deepnote/converters/inputConverters.ts (9)
  • InputTextBlockConverter (77-89)
  • InputTextareaBlockConverter (91-103)
  • InputSelectBlockConverter (105-117)
  • InputSliderBlockConverter (119-131)
  • InputCheckboxBlockConverter (133-145)
  • InputDateBlockConverter (147-159)
  • InputDateRangeBlockConverter (161-173)
  • InputFileBlockConverter (175-187)
  • ButtonBlockConverter (189-201)
src/notebooks/deepnote/converters/inputConverters.ts (5)
src/notebooks/deepnote/converters/blockConverter.ts (1)
  • BlockConverter (5-10)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookCellData (2523-2549)
src/notebooks/deepnote/dataConversionUtils.ts (1)
  • parseJsonWithFallback (5-11)
src/notebooks/deepnote/converters/constants.ts (1)
  • DEEPNOTE_VSCODE_RAW_CONTENT_KEY (1-1)
src/notebooks/deepnote/deepnoteSchemas.ts (9)
  • DeepnoteTextInputMetadataSchema (48-65)
  • DeepnoteTextareaInputMetadataSchema (67-80)
  • DeepnoteSelectInputMetadataSchema (82-123)
  • DeepnoteSliderInputMetadataSchema (125-154)
  • DeepnoteCheckboxInputMetadataSchema (156-173)
  • DeepnoteDateInputMetadataSchema (175-196)
  • DeepnoteDateRangeInputMetadataSchema (198-215)
  • DeepnoteFileInputMetadataSchema (217-234)
  • DeepnoteButtonMetadataSchema (236-253)
src/notebooks/deepnote/converters/inputConverters.unit.test.ts (3)
src/notebooks/deepnote/converters/inputConverters.ts (9)
  • InputTextBlockConverter (77-89)
  • InputTextareaBlockConverter (91-103)
  • InputSelectBlockConverter (105-117)
  • InputSliderBlockConverter (119-131)
  • InputCheckboxBlockConverter (133-145)
  • InputDateBlockConverter (147-159)
  • InputDateRangeBlockConverter (161-173)
  • InputFileBlockConverter (175-187)
  • ButtonBlockConverter (189-201)
src/notebooks/deepnote/converters/constants.ts (1)
  • DEEPNOTE_VSCODE_RAW_CONTENT_KEY (1-1)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookCellData (2523-2549)
🔇 Additional comments (3)
src/notebooks/deepnote/deepnoteDataConverter.ts (2)

12-22: LGTM: input converters import

Imports look correct and scoped to deepnote converters.


36-44: LGTM: register input converters

Registration order and coverage look good.

src/notebooks/deepnote/converters/inputConverters.unit.test.ts (1)

1-1151: Solid coverage overall

Tests cover convertToCell/applyChangesToBlock, defaults, arrays, booleans, and raw content fallback for invalid JSON.

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/converters/inputConverters.ts (1)

52-69: Remove console.*, rename vars; keep pretty-print

Drop console.error/debug/log and avoid logging metadata. Rename to generic vars for clarity. Behavior unchanged.

As per coding guidelines.

-    convertToCell(block: DeepnoteBlock): NotebookCellData {
-        const deepnoteJupyterRawContentResult = z.string().safeParse(block.metadata?.[DEEPNOTE_VSCODE_RAW_CONTENT_KEY]);
-        const deepnoteMetadataResult = this.schema().safeParse(block.metadata);
-
-        if (deepnoteMetadataResult.error != null) {
-            console.error('Error parsing deepnote input metadata:', deepnoteMetadataResult.error);
-            console.debug('Metadata:', JSON.stringify(block.metadata));
-        }
-
-        const configStr = deepnoteJupyterRawContentResult.success
-            ? deepnoteJupyterRawContentResult.data
-            : deepnoteMetadataResult.success
-            ? JSON.stringify(deepnoteMetadataResult.data, null, 2)
-            : JSON.stringify(this.defaultConfig(), null, 2);
-
-        const cell = new NotebookCellData(NotebookCellKind.Code, configStr, 'json');
-        console.log(cell);
-        return cell;
-    }
+    convertToCell(block: DeepnoteBlock): NotebookCellData {
+        const rawContentResult = z.string().safeParse(block.metadata?.[DEEPNOTE_VSCODE_RAW_CONTENT_KEY]);
+        const metadataResult = this.schema().safeParse(block.metadata);
+
+        const configStr = rawContentResult.success
+            ? rawContentResult.data
+            : metadataResult.success
+            ? JSON.stringify(metadataResult.data, null, 2)
+            : JSON.stringify(this.defaultConfig(), null, 2);
+
+        const cell = new NotebookCellData(NotebookCellKind.Code, configStr, 'json');
+        return cell;
+    }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01569a0 and 402f077.

📒 Files selected for processing (3)
  • src/notebooks/deepnote/converters/inputConverters.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (2 hunks)
  • src/notebooks/deepnote/deepnoteSchemas.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/deepnoteDataConverter.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/converters/inputConverters.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/deepnoteDataConverter.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
src/notebooks/deepnote/deepnoteDataConverter.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteDataConverter.ts performs Deepnote data transformations

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
🧠 Learnings (2)
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
📚 Learning: 2025-09-03T12:59:14.489Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/notebooks.instructions.md:0-0
Timestamp: 2025-09-03T12:59:14.489Z
Learning: Applies to src/notebooks/export/**/*.ts : Update FileConverter to handle the new export format

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/inputConverters.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/deepnoteDataConverter.ts (1)
src/notebooks/deepnote/converters/inputConverters.ts (9)
  • InputTextBlockConverter (77-89)
  • InputTextareaBlockConverter (91-103)
  • InputSelectBlockConverter (105-117)
  • InputSliderBlockConverter (119-131)
  • InputCheckboxBlockConverter (133-145)
  • InputDateBlockConverter (147-159)
  • InputDateRangeBlockConverter (161-173)
  • InputFileBlockConverter (175-187)
  • ButtonBlockConverter (189-201)
src/notebooks/deepnote/converters/inputConverters.ts (4)
src/notebooks/deepnote/converters/blockConverter.ts (1)
  • BlockConverter (5-10)
src/notebooks/deepnote/dataConversionUtils.ts (1)
  • parseJsonWithFallback (5-11)
src/notebooks/deepnote/converters/constants.ts (1)
  • DEEPNOTE_VSCODE_RAW_CONTENT_KEY (1-1)
src/notebooks/deepnote/deepnoteSchemas.ts (9)
  • DeepnoteTextInputMetadataSchema (48-65)
  • DeepnoteTextareaInputMetadataSchema (67-80)
  • DeepnoteSelectInputMetadataSchema (82-123)
  • DeepnoteSliderInputMetadataSchema (125-154)
  • DeepnoteCheckboxInputMetadataSchema (156-173)
  • DeepnoteDateInputMetadataSchema (175-196)
  • DeepnoteDateRangeInputMetadataSchema (198-215)
  • DeepnoteFileInputMetadataSchema (217-234)
  • DeepnoteButtonMetadataSchema (236-253)
🔇 Additional comments (1)
src/notebooks/deepnote/deepnoteDataConverter.ts (1)

12-22: Wiring of input converters looks good

Imports and registrations are correct and ordered consistently with existing converters.

Also applies to: 36-45

…-number-blocks' into tomaskislan/grn-4776-support-input-blocks

Signed-off-by: Tomas Kislan <tomas@kislan.sk>
…m:deepnote/vscode-deepnote into tomaskislan/grn-4776-support-input-blocks
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 22, 2025
Base automatically changed from tomaskislan/grn-4762-support-big-number-blocks to main October 23, 2025 10:49
@jamesbhobbs jamesbhobbs dismissed coderabbitai[bot]’s stale review October 23, 2025 10:49

The base branch was changed.

@tkislan tkislan marked this pull request as ready for review October 23, 2025 11:31
…support-input-blocks

Signed-off-by: Tomas Kislan <tomas@kislan.sk>
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 98.64253% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72%. Comparing base (30e3d16) to head (4c5e886).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...epnoteInputBlockCellStatusBarProvider.unit.test.ts 93% 7 Missing ⚠️
...c/notebooks/deepnote/converters/inputConverters.ts 98% 1 Missing ⚠️
...eepnote/deepnoteInputBlockCellStatusBarProvider.ts 94% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main     #42    +/-   ##
======================================
  Coverage     71%     72%            
======================================
  Files        532     536     +4     
  Lines      40018   40681   +663     
  Branches    4973    4982     +9     
======================================
+ Hits       28788   29442   +654     
- Misses      9569    9578     +9     
  Partials    1661    1661            
Files with missing lines Coverage Δ
...s/deepnote/converters/inputConverters.unit.test.ts 100% <100%> (ø)
src/notebooks/deepnote/deepnoteDataConverter.ts 59% <100%> (+2%) ⬆️
src/notebooks/deepnote/deepnoteSchemas.ts 100% <100%> (ø)
...c/notebooks/deepnote/converters/inputConverters.ts 98% <98%> (ø)
...eepnote/deepnoteInputBlockCellStatusBarProvider.ts 94% <94%> (ø)
...epnoteInputBlockCellStatusBarProvider.unit.test.ts 93% <93%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tkislan tkislan requested a review from jankuca October 23, 2025 11:50
@jankuca
Copy link
Member

jankuca commented Oct 23, 2025

Is the plan to then convert these JSON editors into actual input elements like a text box, select box, etc?

@tkislan
Copy link
Member Author

tkislan commented Oct 23, 2025

Is the plan to then convert these JSON editors into actual input elements like a text box, select box, etc?

Notebook cells are rendered within the VSCode codebase .. I couldn't find a way how to change this into something else
one solution might be to use the status bar for all the fields, and leave the cells content empty .. but didn't try that yet

@jankuca
Copy link
Member

jankuca commented Oct 23, 2025

You might be right. I researched this briefly and it indeed seems to be limited to these editors. The status bar solution sounds good but we can iterate on that.

@jankuca
Copy link
Member

jankuca commented Oct 24, 2025

We need a codeowner approval (cc @saltenasl) for merging this.

@saltenasl
Copy link
Member

@jankuca @tkislan i'm on other urgent work atm, but hopefully will be available in an hour

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.

Screenshot 2025-10-24 at 14 28 42 while the code prints out the correct value, vscode shows an error on the variable

@tkislan tkislan enabled auto-merge (squash) October 24, 2025 11:41
@tkislan
Copy link
Member Author

tkislan commented Oct 24, 2025

@saltenasl did not look into that yet .. and we also have a separate task for code completion related to init notebooks as well
also, sometimes this does work for me, and maybe it's the problem with how the environment and language server is connected .. but for that, there already is a PR, to manage enviroments, so that might change this again

@saltenasl saltenasl disabled auto-merge October 24, 2025 11:48
@saltenasl saltenasl merged commit 5c3d0f1 into main Oct 24, 2025
13 checks passed
@saltenasl saltenasl deleted the tomaskislan/grn-4776-support-input-blocks branch October 24, 2025 11:48
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.

6 participants