Skip to content

Conversation

@tkislan
Copy link
Member

@tkislan tkislan commented Oct 13, 2025

image

Summary by CodeRabbit

  • New Features

    • Added support for rendering big-number chart blocks in Deepnote notebooks, featuring formatted numeric values with optional comparison metrics and change indicators.
  • Tests

    • Added comprehensive unit test coverage for big-number block conversion and renderer functionality.

@linear
Copy link

linear bot commented Oct 13, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

📝 Walkthrough

Walkthrough

This PR introduces a new Deepnote chart big-number renderer for VSCode notebooks. It adds a ChartBigNumberBlockConverter to handle bidirectional conversion between Deepnote big-number blocks and VSCode cells, defines Zod schemas for validation, creates React webview components for rendering, and adds corresponding build configuration and package.json registry entry. The PR also refactors type imports across the codebase, moving DeepnoteBlock type resolution from local modules to a centralized platform location, and integrates big-number output handling into cell execution for MIME type remapping.

Sequence Diagram(s)

sequenceDiagram
    participant Deepnote Block
    participant ChartBigNumberBlockConverter
    participant ZodSchema
    participant VSCode Cell
    
    rect rgb(200, 220, 240)
    note over Deepnote Block,VSCode Cell: convertToCell (Deepnote → VSCode)
    Deepnote Block->>ChartBigNumberBlockConverter: pass block with metadata
    ChartBigNumberBlockConverter->>ZodSchema: validate metadata
    ZodSchema-->>ChartBigNumberBlockConverter: validation result
    ChartBigNumberBlockConverter->>ChartBigNumberBlockConverter: serialize to JSON config
    ChartBigNumberBlockConverter-->>VSCode Cell: return JSON NotebookCellData
    end
    
    rect rgb(220, 240, 200)
    note over Deepnote Block,VSCode Cell: applyChangesToBlock (VSCode → Deepnote)
    VSCode Cell->>ChartBigNumberBlockConverter: pass cell with JSON value
    ChartBigNumberBlockConverter->>ChartBigNumberBlockConverter: parse JSON value
    ChartBigNumberBlockConverter->>ZodSchema: validate parsed data
    alt valid
        ZodSchema-->>ChartBigNumberBlockConverter: ✓ passes validation
        ChartBigNumberBlockConverter->>Deepnote Block: merge into metadata
    else invalid
        ZodSchema-->>ChartBigNumberBlockConverter: ✗ fails validation
        ChartBigNumberBlockConverter->>Deepnote Block: store as raw content
    end
    end
Loading
sequenceDiagram
    participant Webview
    participant ChartBigNumberOutputRendererContainer
    participant ZodSchema
    participant ChartBigNumberOutputRenderer
    participant Browser
    
    rect rgb(200, 220, 240)
    note over Webview,Browser: Rendering Output in Webview
    Webview->>ChartBigNumberOutputRendererContainer: pass outputText & outputMetadata
    ChartBigNumberOutputRendererContainer->>ChartBigNumberOutputRendererContainer: parse JSON from text
    ChartBigNumberOutputRendererContainer->>ZodSchema: validate output & metadata
    alt valid
        ZodSchema-->>ChartBigNumberOutputRendererContainer: ✓ validation passes
        ChartBigNumberOutputRendererContainer->>ChartBigNumberOutputRenderer: render with parsed data
        ChartBigNumberOutputRenderer->>ChartBigNumberOutputRenderer: format values using formatValue()
        ChartBigNumberOutputRenderer->>Browser: display big-number with comparison
    else invalid
        ZodSchema-->>ChartBigNumberOutputRendererContainer: ✗ validation fails
        ChartBigNumberOutputRendererContainer->>Browser: error boundary fallback
    end
    end
Loading

Possibly related PRs

Suggested reviewers

  • Artmann
  • saltenasl
  • andyjakubowski

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 PR title "feat: Implement deepnote big number chart support and renderer" accurately and directly describes the primary change in the changeset. The title specifies both the feature being added (big number chart support) and the main implementation component (renderer), which aligns with the substantial changes across multiple files including the new ChartBigNumberBlockConverter, React components, schemas, and supporting infrastructure. The title is concise, specific enough for easy identification in commit history, and free of vague terminology.
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 60442ec and 236cccd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.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/deepnote/deepnoteKernelAutoSelector.node.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/deepnoteKernelAutoSelector.node.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts
🧠 Learnings (3)
📓 Common learnings
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.
Learnt from: tkislan
PR: deepnote/vscode-deepnote#41
File: src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx:73-78
Timestamp: 2025-10-16T13:14:27.505Z
Learning: In the vscode-deepnote repository, code in `src/webviews/webview-side/chart-big-number-renderer/` is a direct copy from the main Deepnote app and should be kept in sync with it, even if issues are identified. This code should eventually be abstracted into the deepnote/deepnote package.
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management

Applied to files:

  • src/notebooks/deepnote/deepnoteKernelAutoSelector.node.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/deepnoteKernelAutoSelector.node.ts
⏰ 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: copilot-setup-steps
🔇 Additional comments (1)
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts (1)

44-44: Circular dependency introduced by this refactoring.

The import path correctly resolves, but the PR creates a circular dependency:

  • src/platform/deepnote/pocket.ts imports from src/notebooks/deepnote/dataConversionUtils
  • All files in src/notebooks/deepnote/ (including this one) now import from src/platform/deepnote/deepnoteTypes

Decouple src/platform/deepnote/pocket.ts from the notebooks layer to break the cycle.

⛔ Skipped due to learnings
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteTypes.ts : deepnoteTypes.ts contains Deepnote-related type definitions
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: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookSelector.ts : deepnoteNotebookSelector.ts implements UI selection logic for Deepnote notebooks
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f9c6af and 87f4a09.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • build/esbuild/build.ts (1 hunks)
  • package.json (2 hunks)
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1 hunks)
  • src/notebooks/deepnote/dataConversionUtils.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteConstants.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (5 hunks)
  • src/notebooks/deepnote/deepnoteSchemas.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteSerializer.ts (2 hunks)
  • src/webviews/deepnote-utils/format-value.ts (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/index.ts (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/styles.css (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/!(*.node|*.web).ts

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

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

Files:

  • build/esbuild/build.ts
  • src/webviews/deepnote-utils/format-value.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/deepnoteConstants.ts
  • src/notebooks/deepnote/dataConversionUtils.ts
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/deepnoteSerializer.ts
  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.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:

  • build/esbuild/build.ts
  • src/webviews/deepnote-utils/format-value.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/deepnoteConstants.ts
  • src/notebooks/deepnote/dataConversionUtils.ts
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
  • src/notebooks/deepnote/deepnoteSerializer.ts
  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/deepnoteConstants.ts
  • src/notebooks/deepnote/dataConversionUtils.ts
  • src/notebooks/deepnote/deepnoteSerializer.ts
  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
src/notebooks/deepnote/deepnoteSerializer.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration

Files:

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

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteDataConverter.ts performs Deepnote data transformations

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
🧠 Learnings (6)
📚 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
  • src/notebooks/deepnote/deepnoteSerializer.ts
  • 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/deepnoteSerializer.ts : deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration

Applied to files:

  • src/notebooks/deepnote/deepnoteSerializer.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.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/chartBigNumberBlockConverter.ts
🧬 Code graph analysis (5)
build/esbuild/build.ts (5)
gulpfile.js (1)
  • path (14-14)
build/preLaunchWebTest.js (1)
  • path (4-4)
build/launchWebUtils.js (1)
  • path (4-4)
build/ci/postInstall.js (1)
  • path (8-8)
build/webpack/common.js (1)
  • path (6-6)
src/webviews/webview-side/chart-big-number-renderer/index.ts (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteBigNumberMetadataSchema (11-44)
  • DeepnoteChartBigNumberOutputSchema (3-9)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1)
  • ChartBigNumberOutputRenderer (5-145)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteChartBigNumberOutput (46-46)
  • DeepnoteBigNumberMetadata (47-47)
src/webviews/deepnote-utils/format-value.ts (1)
  • formatValue (1-36)
src/notebooks/deepnote/deepnoteDataConverter.ts (3)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1)
  • ChartBigNumberBlockConverter (11-64)
src/notebooks/deepnote/deepnoteTypes.ts (2)
  • DeepnoteBlock (6-6)
  • DeepnoteOutput (23-51)
src/notebooks/deepnote/deepnoteConstants.ts (1)
  • CHART_BIG_NUMBER_MIME_TYPE (1-1)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (5)
src/notebooks/deepnote/converters/blockConverter.ts (1)
  • BlockConverter (5-10)
src/notebooks/deepnote/deepnoteSerializer.ts (1)
  • DeepnoteBlock (9-9)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookCellData (2523-2549)
src/notebooks/deepnote/deepnoteSchemas.ts (1)
  • DeepnoteBigNumberMetadataSchema (11-44)
src/notebooks/deepnote/dataConversionUtils.ts (1)
  • parseJsonWithFallback (5-11)
🔇 Additional comments (14)
package.json (2)

1822-1829: LGTM: Renderer configuration is correct.

The notebookRenderer entry properly registers the big-number chart renderer with the correct MIME type and entrypoint.


2182-2183: Confirm zod@^4.1.12 availability
npm’s main registry still shows 4.1.11 as the latest stable; if 4.1.12 isn’t published in your registry, change to ^4.1.11.

build/esbuild/build.ts (1)

295-306: LGTM: Build configuration follows established pattern.

The chart-big-number-renderer build step correctly mirrors the dataframe-renderer configuration above it.

src/notebooks/deepnote/dataConversionUtils.ts (1)

5-11: LGTM: Simple, correct JSON parsing utility.

The function appropriately handles parsing failures with a fallback mechanism.

src/notebooks/deepnote/deepnoteSerializer.ts (1)

1-9: LGTM: Export surface updated to include DeepnoteBlock and DeepnoteFile.

The changes expose necessary types while removing DeepnoteProject from public exports.

src/webviews/webview-side/chart-big-number-renderer/styles.css (1)

1-54: LGTM: CSS properly uses VS Code theme variables.

The styles correctly reference VS Code's theming system and provide appropriate layout for big-number charts.

src/notebooks/deepnote/deepnoteConstants.ts (1)

1-1: LGTM: MIME type constant follows conventions.

The constant correctly defines the custom MIME type for Deepnote big-number charts.

src/notebooks/deepnote/deepnoteDataConverter.ts (3)

10-11: LGTM: Converter registration follows established pattern.

The ChartBigNumberBlockConverter is properly imported and registered in the constructor.

Also applies to: 24-24


60-60: LGTM: Method signature updated to support block-type-aware output transformation.

Passing blockType enables MIME type selection based on block type, which is necessary for big-number rendering.

Also applies to: 208-211


277-293: Guard against duplicate big-number outputs
For blockType === 'big-number}, both the data['text/plain'] fallback (overriding to CHART_BIG_NUMBER_MIME_TYPE) and the explicit data[CHART_BIG_NUMBER_MIME_TYPE] branch will fire if both keys are present, producing duplicate items. Restrict the fallback to non-big-number blocks or guard the CHART_BIG_NUMBER_MIME_TYPE branch by blockType, or confirm that Jupyter never emits both.

src/notebooks/deepnote/deepnoteSchemas.ts (1)

11-44: LGTM!

Metadata schema correctly normalizes all optional fields to null, provides appropriate enum constraints for comparison type, and handles all expected configuration options.

src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (3)

35-37: LGTM!

Case-insensitive block type matching is appropriate.


61-63: LGTM!

Correctly returns supported types.


13-13: Unconditional clearing of block.content is intentional. chartBigNumberBlockConverter uses structured properties for parsed JSON and only assigns block.content from cell.value on parse failure.

@Artmann
Copy link
Member

Artmann commented Oct 13, 2025

The comparison type supports a few different options, such as percentage-change, which doesn't seem to work here.
image

@Artmann
Copy link
Member

Artmann commented Oct 13, 2025

Even if the comparison option is turned off, it's displayed as a -.
image

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

♻️ Duplicate comments (5)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (2)

45-46: Use ILogger instead of console methods.

Per coding guidelines, use the ILogger service for logging.

As per coding guidelines.

Also applies to: 56-56


10-10: Pre-stringify the default config constant.

The constant addresses the past review but isn't fully optimized. Pre-stringify it with formatting to avoid repeated JSON.stringify calls at line 53.

Apply this diff:

-const DEFAULT_BIG_NUMBER_CONFIG = DeepnoteBigNumberMetadataSchema.parse({});
+const DEFAULT_BIG_NUMBER_CONFIG = JSON.stringify(DeepnoteBigNumberMetadataSchema.parse({}), null, 2);

Then update line 53:

-            : JSON.stringify(DEFAULT_BIG_NUMBER_CONFIG);
+            : DEFAULT_BIG_NUMBER_CONFIG;
src/webviews/webview-side/chart-big-number-renderer/index.ts (1)

31-37: Use ILogger or forward to host; avoid console.*.

Replace console.error with ILogger or post a message to the extension host.

As per coding guidelines.

src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (2)

12-13: Remove dead hasErrors code or implement real error state.

Currently always false; branches are unreachable.


54-60: Simplify numeric parsing.

Always use parseFloat; supports ints, decimals, scientific notation.

-        const isFloat = output.value.includes('.') || output.comparisonValue.includes('.');
-
-        const parsedValue = isFloat ? parseFloat(output.value) : parseInt(output.value, 10);
-        const parsedComparisonValue = isFloat
-            ? parseFloat(output.comparisonValue)
-            : parseInt(output.comparisonValue, 10);
+        const parsedValue = parseFloat(output.value);
+        const parsedComparisonValue = parseFloat(output.comparisonValue);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87f4a09 and 62297c2.

📒 Files selected for processing (4)
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteSerializer.ts (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/index.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/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
  • src/notebooks/deepnote/deepnoteSerializer.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/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
  • src/notebooks/deepnote/deepnoteSerializer.ts
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
  • src/notebooks/deepnote/deepnoteSerializer.ts
src/notebooks/deepnote/deepnoteSerializer.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration

Files:

  • src/notebooks/deepnote/deepnoteSerializer.ts
🧠 Learnings (6)
📚 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 the `ILogger` service instead of `console.log`

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.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/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/deepnoteSerializer.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations

Applied to files:

  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteSerializer.ts : deepnoteSerializer.ts is the main serializer orchestrating Deepnote integration

Applied to files:

  • src/notebooks/deepnote/deepnoteSerializer.ts
📚 Learning: 2025-10-09T11:21:57.494Z
Learnt from: CR
PR: deepnote/vscode-deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-09T11:21:57.494Z
Learning: Applies to src/notebooks/deepnote/deepnoteNotebookManager.ts : deepnoteNotebookManager.ts handles Deepnote notebook state management

Applied to files:

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

Applied to files:

  • src/notebooks/deepnote/deepnoteSerializer.ts
🧬 Code graph analysis (3)
src/webviews/webview-side/chart-big-number-renderer/index.ts (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteBigNumberMetadataSchema (11-44)
  • DeepnoteChartBigNumberOutputSchema (3-9)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1)
  • ChartBigNumberOutputRenderer (5-147)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (5)
src/notebooks/deepnote/deepnoteSchemas.ts (1)
  • DeepnoteBigNumberMetadataSchema (11-44)
src/notebooks/deepnote/converters/blockConverter.ts (1)
  • BlockConverter (5-10)
src/notebooks/deepnote/deepnoteSerializer.ts (1)
  • DeepnoteBlock (9-9)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookCellData (2523-2549)
src/notebooks/deepnote/dataConversionUtils.ts (1)
  • parseJsonWithFallback (5-11)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteChartBigNumberOutput (46-46)
  • DeepnoteBigNumberMetadata (47-47)
src/webviews/deepnote-utils/format-value.ts (1)
  • formatValue (1-36)
🔇 Additional comments (3)
src/notebooks/deepnote/deepnoteSerializer.ts (3)

1-3: LGTM: Import organization follows guidelines.

Imports are properly separated and ordered.


7-7: LGTM: Type-only import.

Using type keyword is good practice for imports used only at compile time.


9-9: Safe to remove DeepnoteProject export
No imports of DeepnoteProject from deepnoteSerializer; DeepnoteBlock and DeepnoteFile are present in deepnoteTypes.

@Artmann Artmann force-pushed the chris/display-data-frames branch from 930dcde to 1ba9ab4 Compare October 13, 2025 12:52
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 (13)
src/notebooks/deepnote/deepnoteSchemas.ts (1)

5-11: ** Inconsistent null handling already flagged.**

Past review noted: DeepnoteChartBigNumberOutputSchema uses .nullish() without .transform(), while DeepnoteBigNumberMetadataSchema transforms undefined to null. Consumers must handle both undefined and null for output fields.

src/webviews/webview-side/chart-big-number-renderer/index.ts (5)

19-20: ** Fragile JSON parsing already flagged.**

Past review noted: regex-based quote stripping breaks on edge cases. Should handle both plain JSON and JSON-stringified JSON robustly.


38-38: ** Use ILogger instead of console.**

Past review noted: coding guidelines require ILogger service instead of console.error.


27-36: ** Memory leak and duplicate mounts already flagged.**

Past review noted: need to clear element, track mounted roots, and unmount React components properly to prevent memory leaks and duplicate mounts.


47-49: ** Cleanup not implemented.**

Past review noted: disposeOutputItem should unmount React components to prevent memory leaks.


42-42: ** Localize error message.**

Past review noted: "Error rendering chart big number" must use l10n.t() per coding guidelines.

src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (7)

13-13: ** Dead code: hasErrors hardcoded.**

Past review noted: hasErrors is always false, making error branches unreachable.


15-21: ** Missing localization.**

Past review noted: user-facing strings ('Not defined', 'Title') must use l10n.t().


23-39: ** Missing localization.**

Past review noted: user-facing strings ('N/A', 'Value', 'NaN') must use l10n.t().


54-59: ** Unnecessary parseInt/parseFloat branching.**

Past review noted: parseFloat handles both integers and decimals correctly. The includes('.') check is unnecessary complexity.


73-78: ** Missing absolute-change support.**

Past review noted: schema allows 'absolute-change', but implementation only handles 'absolute-value' and default difference.


89-93: ** Fix percent formatting.**

Past review noted: pre-multiplying by 100 before calling formatValue('percent') causes double-scaling. formatValue already handles the conversion.


121-123: ** Hide comparison UI when format is 'off'.**

Past review noted: showComparison should also check metadata.deepnote_big_number_comparison_format !== 'off' to prevent displaying "-" when comparison is turned off (per PR comment).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62297c2 and 7878345.

📒 Files selected for processing (5)
  • src/notebooks/deepnote/deepnoteConstants.ts (1 hunks)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (5 hunks)
  • src/notebooks/deepnote/deepnoteSchemas.ts (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/index.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/deepnoteConstants.ts
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • 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/deepnoteConstants.ts
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
src/notebooks/deepnote/**

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/deepnoteConstants.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • 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
🧠 Learnings (9)
📚 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 the `ILogger` service instead of `console.log`

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/index.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/webviews/webview-side/chart-big-number-renderer/index.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/webviews/webview-side/chart-big-number-renderer/index.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
📚 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,js,jsx} : Prefer null over undefined for intentional absence of values

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.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,js,jsx} : Prefer null over undefined for intentional absence of value

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.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,js,jsx} : Prefer null over undefined as deliberate empty value

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.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/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
🧬 Code graph analysis (4)
src/webviews/webview-side/chart-big-number-renderer/index.ts (2)
src/notebooks/deepnote/deepnoteSchemas.ts (3)
  • getDeepnoteBlockMetadataSchema (48-52)
  • DeepnoteBigNumberMetadataSchema (13-46)
  • DeepnoteChartBigNumberOutputSchema (5-11)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1)
  • ChartBigNumberOutputRenderer (5-153)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
gulpfile.js (1)
  • schema (38-65)
src/notebooks/deepnote/deepnoteConstants.ts (1)
  • OUTPUT_BLOCK_METADATA_KEY (1-1)
src/notebooks/deepnote/deepnoteDataConverter.ts (4)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1)
  • ChartBigNumberBlockConverter (12-63)
src/notebooks/deepnote/deepnoteConstants.ts (2)
  • OUTPUT_BLOCK_METADATA_KEY (1-1)
  • CHART_BIG_NUMBER_MIME_TYPE (3-3)
src/notebooks/deepnote/deepnoteTypes.ts (2)
  • DeepnoteBlock (6-6)
  • DeepnoteOutput (23-51)
src/test/mocks/vsc/extHostedTypes.ts (2)
  • NotebookCellOutput (71-103)
  • NotebookCellOutputItem (16-69)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteChartBigNumberOutput (54-54)
  • DeepnoteBigNumberMetadata (55-55)
src/webviews/deepnote-utils/format-value.ts (1)
  • formatValue (1-36)
🔇 Additional comments (13)
src/notebooks/deepnote/deepnoteSchemas.ts (2)

48-52: LGTM!

Helper correctly wraps schema under OUTPUT_BLOCK_METADATA_KEY.


54-55: LGTM!

Type inference follows standard Zod pattern.

src/notebooks/deepnote/deepnoteConstants.ts (1)

1-3: LGTM!

Constants correctly define metadata key and MIME type.

src/notebooks/deepnote/deepnoteDataConverter.ts (6)

4-4: LGTM!

Type import correctly added.


10-11: LGTM!

New imports for chart big number support.


24-24: LGTM!

Converter correctly registered.


60-60: LGTM!

Call site correctly updated with new parameters.


306-316: LGTM!

Metadata correctly assembled with blockMetadata, executionCount, and output metadata.


216-220: All transformOutputsForVsCode call sites have been updated. No remaining references to the old signature.

src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (4)

65-71: LGTM!

Division by zero correctly handled (lines 66-68).


85-87: LGTM!

Null check correctly uses == null to allow zero values.


98-104: LGTM!

Direction calculation correctly uses == null check.


125-152: LGTM!

Component structure and rendering logic correct (aside from flagged issues).

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

♻️ Duplicate comments (2)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (2)

46-47: Use ILogger instead of console methods.

Per coding guidelines and previous review feedback, use the ILogger service for logging instead of console methods.

As per coding guidelines.

Inject ILogger into the class constructor and replace:

-console.error('Error parsing deepnote big number metadata:', deepnoteBigNumberMetadataResult.error);
-console.debug('Metadata:', JSON.stringify(block.metadata));
+this.logger.error('Error parsing deepnote big number metadata:', deepnoteBigNumberMetadataResult.error);
+this.logger.debug('Metadata:', JSON.stringify(block.metadata));

10-10: Pre-stringify the default config.

The constant is stringified on every call to convertToCell (line 54). Stringify it once at declaration to avoid repeated serialization.

Apply this diff:

-const DEFAULT_BIG_NUMBER_CONFIG = DeepnoteBigNumberMetadataSchema.parse({});
+const DEFAULT_BIG_NUMBER_CONFIG = JSON.stringify(DeepnoteBigNumberMetadataSchema.parse({}), null, 2);

Then at line 54:

         const configStr = deepnoteJupyterRawContentResult.success
             ? deepnoteJupyterRawContentResult.data
             : deepnoteBigNumberMetadataResult.success
             ? JSON.stringify(deepnoteBigNumberMetadataResult.data, null, 2)
-            : JSON.stringify(DEFAULT_BIG_NUMBER_CONFIG, null, 2);
+            : DEFAULT_BIG_NUMBER_CONFIG;
📜 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 40ede24.

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

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

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

Files:

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

📄 CodeRabbit inference engine (CLAUDE.md)

Deepnote integration code resides under src/notebooks/deepnote/

Files:

  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.unit.test.ts
  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
🧠 Learnings (4)
📚 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/converters/chartBigNumberBlockConverter.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/converters/chartBigNumberBlockConverter.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 the `ILogger` service instead of `console.log`

Applied to files:

  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.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 **/*.{ts,tsx} : Add a blank line after groups of const declarations and before return statements for readability

Applied to files:

  • src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.unit.test.ts (3)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1)
  • ChartBigNumberBlockConverter (12-64)
src/notebooks/deepnote/converters/constants.ts (1)
  • DEEPNOTE_VSCODE_RAW_CONTENT_KEY (1-1)
src/test/mocks/vsc/extHostedTypes.ts (1)
  • NotebookCellData (2523-2549)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (4)
src/notebooks/deepnote/deepnoteSchemas.ts (1)
  • DeepnoteBigNumberMetadataSchema (13-46)
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)
🔇 Additional comments (3)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (3)

13-35: LGTM!

The method correctly handles both valid and invalid config, storing raw content as fallback and cleaning up when valid config is applied.


37-39: LGTM!

Case-insensitive type matching is appropriate.


61-63: LGTM!

Correctly returns the supported block type.

OlegWock
OlegWock previously approved these changes Oct 17, 2025
Copy link
Member

@OlegWock OlegWock left a comment

Choose a reason for hiding this comment

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

Couple of comments, but I don't think they should be blocking

Comment on lines +1187 to +1190
if (outputToBeUpdated.cell.metadata['__deepnotePocket']?.['type'] === 'big-number') {
data[CHART_BIG_NUMBER_MIME_TYPE] = data['text/plain'];
delete data['text/plain'];
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add comment why we need this

}
}
*/
// TODO - add DeepnotePocket zod schema validation
Copy link
Member

Choose a reason for hiding this comment

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

Please create ticket and put its number here (or address directly in this PR if that's appropiate)

Copy link
Member

Choose a reason for hiding this comment

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

Same for todo couple lines below

if (data['text/plain']) {
items.push(NotebookCellOutputItem.text(data['text/plain'] as string));
let mimeType = 'text/plain';
if (blockType === 'big-number' && !(CHART_BIG_NUMBER_MIME_TYPE in data)) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add comment what is happening here? Also comment above is not outdated

output: DeepnoteChartBigNumberOutput;
metadata: DeepnoteBigNumberMetadata;
}) {
// TODO: either remove or handle here .. currently handled in the parent
Copy link
Member

Choose a reason for hiding this comment

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

Is this still relevant? Please address or add Linear ticket id here

Comment on lines 24 to 30
ReactDOM.render(
React.createElement(ChartBigNumberOutputRenderer, {
output: chartBigNumberOutput,
metadata: blockMetadata
}),
element
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: in charts PR I added error boundary, you could use it here without much extra work (maybe with some minimal adjustments)

@tkislan tkislan dismissed stale reviews from OlegWock and coderabbitai[bot] via 95fd687 October 17, 2025 15:52
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

Caution

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

⚠️ Outside diff range comments (1)
src/kernels/execution/helpers.ts (1)

361-379: Stop emitting duplicate big-number items

When a big-number block carries both text/plain and application/vnd.deepnote.chart.big-number+json, this loop now pushes two NotebookCellOutputItems with the same MIME type. VS Code renders both, so users see duplicate big-number widgets. Skip the fallback when the custom payload already exists.

-                        if (data['text/plain']) {
-                            let mimeType = 'text/plain';
-                            // deepnote-toolkit returns the text/plain mime type for big number outputs
-                            // and for the custom renderer to be used, we need to return the application/vnd.deepnote.chart.big-number+json mime type
-                            if (blockType === 'big-number' && !(CHART_BIG_NUMBER_MIME_TYPE in data)) {
-                                mimeType = CHART_BIG_NUMBER_MIME_TYPE;
-                            }
-                            items.push(NotebookCellOutputItem.text(data['text/plain'] as string, mimeType));
+                        if (data['text/plain']) {
+                            if (blockType === 'big-number' && CHART_BIG_NUMBER_MIME_TYPE in data) {
+                                continue;
+                            }
+                            const mimeType =
+                                blockType === 'big-number'
+                                    ? CHART_BIG_NUMBER_MIME_TYPE
+                                    : 'text/plain';
+                            items.push(NotebookCellOutputItem.text(data['text/plain'] as string, mimeType));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee3612 and 95fd687.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • .eslintrc.js (1 hunks)
  • package.json (3 hunks)
  • src/kernels/execution/cellExecutionMessageHandler.ts (3 hunks)
  • src/kernels/execution/helpers.ts (3 hunks)
  • src/notebooks/deepnote/deepnoteDataConverter.ts (6 hunks)
  • src/notebooks/deepnote/deepnoteSchemas.ts (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRendererContainer.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/ErrorBoundary.tsx (1 hunks)
  • src/webviews/webview-side/chart-big-number-renderer/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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/webviews/webview-side/chart-big-number-renderer/ErrorBoundary.tsx
  • src/notebooks/deepnote/deepnoteDataConverter.ts
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRendererContainer.tsx
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
  • src/kernels/execution/helpers.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/kernels/execution/cellExecutionMessageHandler.ts
**/!(*.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/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/kernels/execution/helpers.ts
  • src/notebooks/deepnote/deepnoteSchemas.ts
  • src/kernels/execution/cellExecutionMessageHandler.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/deepnoteDataConverter.ts

📄 CodeRabbit inference engine (CLAUDE.md)

deepnoteDataConverter.ts performs Deepnote data transformations

Files:

  • src/notebooks/deepnote/deepnoteDataConverter.ts
src/kernels/execution/**/*.ts

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

Notebook-level execution must enqueue cells via CellExecutionQueue and manage per-cell lifecycles through CellExecution

Files:

  • src/kernels/execution/helpers.ts
  • src/kernels/execution/cellExecutionMessageHandler.ts
src/kernels/**/*.ts

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

src/kernels/**/*.ts: Use event-driven updates (EventEmitter) for state changes
Monitor and dispose pending promises to prevent leaks during teardown
Use WeakRef/weak references for notebook/object backreferences to avoid memory leaks
Respect CancellationToken in all async operations

Files:

  • src/kernels/execution/helpers.ts
  • src/kernels/execution/cellExecutionMessageHandler.ts
🧠 Learnings (13)
📓 Common learnings
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-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
  • src/webviews/webview-side/chart-big-number-renderer/index.ts
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRendererContainer.tsx
  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
  • package.json
  • src/kernels/execution/cellExecutionMessageHandler.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/deepnoteDataConverter.ts : deepnoteDataConverter.ts performs Deepnote data transformations

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/deepnoteTypes.ts : deepnoteTypes.ts contains Deepnote-related type definitions

Applied to files:

  • src/notebooks/deepnote/deepnoteDataConverter.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 the `ILogger` service instead of `console.log`

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/index.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/webviews/webview-side/chart-big-number-renderer/index.ts
📚 Learning: 2025-10-16T13:14:27.505Z
Learnt from: tkislan
PR: deepnote/vscode-deepnote#41
File: src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx:73-78
Timestamp: 2025-10-16T13:14:27.505Z
Learning: In the vscode-deepnote repository, code in `src/webviews/webview-side/chart-big-number-renderer/` is a direct copy from the main Deepnote app and should be kept in sync with it, even if issues are identified. This code should eventually be abstracted into the deepnote/deepnote package.

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
📚 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/** : Deepnote integration code resides under src/notebooks/deepnote/

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
📚 Learning: 2025-10-16T09:28:01.616Z
Learnt from: OlegWock
PR: deepnote/vscode-deepnote#66
File: src/webviews/webview-side/vega-renderer/number-formats.ts:11-16
Timestamp: 2025-10-16T09:28:01.616Z
Learning: In the vscode-deepnote repository, code in `src/webviews/webview-side/vega-renderer/` is a direct copy from the main Deepnote app and should be kept in sync with it, even if issues are identified.

Applied to files:

  • src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx
📚 Learning: 2025-09-03T12:58:18.091Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/kernel.instructions.md:0-0
Timestamp: 2025-09-03T12:58:18.091Z
Learning: Applies to src/kernels/execution/CellExecutionMessageHandler.ts : CellExecutionMessageHandler must process kernel messages (iopub, execute_reply) and update VS Code cell outputs

Applied to files:

  • src/kernels/execution/helpers.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,js,jsx} : Prefer null over undefined for intentional absence of values

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.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,js,jsx} : Prefer null over undefined for intentional absence of value

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.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,js,jsx} : Prefer null over undefined as deliberate empty value

Applied to files:

  • src/notebooks/deepnote/deepnoteSchemas.ts
🧬 Code graph analysis (6)
src/notebooks/deepnote/deepnoteDataConverter.ts (2)
src/notebooks/deepnote/converters/chartBigNumberBlockConverter.ts (1)
  • ChartBigNumberBlockConverter (12-64)
src/platform/deepnote/deepnoteConstants.ts (1)
  • CHART_BIG_NUMBER_MIME_TYPE (1-1)
src/webviews/webview-side/chart-big-number-renderer/index.ts (2)
src/webviews/webview-side/chart-big-number-renderer/ErrorBoundary.tsx (1)
  • ErrorFallback (4-37)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRendererContainer.tsx (1)
  • ChartBigNumberOutputRendererContainer (9-23)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRendererContainer.tsx (1)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteBigNumberMetadataSchema (11-44)
  • DeepnoteChartBigNumberOutputSchema (3-9)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (2)
src/notebooks/deepnote/deepnoteSchemas.ts (2)
  • DeepnoteChartBigNumberOutput (46-46)
  • DeepnoteBigNumberMetadata (47-47)
src/webviews/deepnote-utils/format-value.ts (1)
  • formatValue (1-36)
src/kernels/execution/helpers.ts (2)
src/platform/deepnote/pocket.ts (1)
  • Pocket (13-18)
src/platform/deepnote/deepnoteConstants.ts (1)
  • CHART_BIG_NUMBER_MIME_TYPE (1-1)
src/kernels/execution/cellExecutionMessageHandler.ts (1)
src/platform/deepnote/deepnoteConstants.ts (1)
  • CHART_BIG_NUMBER_MIME_TYPE (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). (1)
  • GitHub Check: Build & Test
🔇 Additional comments (1)
src/webviews/webview-side/chart-big-number-renderer/ChartBigNumberOutputRenderer.tsx (1)

1-134: Upstream synchronization acknowledged.

This renderer is copied from the main Deepnote app. Per previous discussion, keeping it in sync with upstream is the priority until abstracted into @deepnote/deepnote package.

Based on learnings.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 17, 2025
@tkislan tkislan requested a review from OlegWock October 17, 2025 16:17
OlegWock
OlegWock previously approved these changes Oct 17, 2025
@tkislan tkislan enabled auto-merge (squash) October 17, 2025 16:22
@tkislan tkislan dismissed stale reviews from OlegWock and coderabbitai[bot] via 60442ec October 21, 2025 07:45
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 21, 2025
jankuca
jankuca previously approved these changes Oct 21, 2025
Copy link
Member

@jankuca jankuca left a comment

Choose a reason for hiding this comment

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

I see this was previously approved and Oleh is off today, approving the latest push too

@tkislan tkislan dismissed stale reviews from jankuca and coderabbitai[bot] via 236cccd October 22, 2025 14:22
@jamesbhobbs jamesbhobbs disabled auto-merge October 23, 2025 10:49
@jamesbhobbs jamesbhobbs merged commit eadd26d into main Oct 23, 2025
11 checks passed
@jamesbhobbs jamesbhobbs deleted the tomaskislan/grn-4762-support-big-number-blocks branch October 23, 2025 10:49
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.

7 participants