Skip to content

Conversation

@tkislan
Copy link
Member

@tkislan tkislan commented Nov 4, 2025

Summary by CodeRabbit

  • Bug Fixes

    • More robust input-slider parsing to ensure numeric values are recognized and invalid entries are handled gracefully.
  • Chores

    • Updated input validation implementation to improve reliability of user-entered values.

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

coderabbitai bot commented Nov 4, 2025

📝 Walkthrough

Walkthrough

The inputBlockContentFormatter.ts file was updated to improve input slider value handling. A zod dependency was added and the slider logic now uses z.coerce.number().safeParse(value) to coerce/validate values, returning the parsed number as a string on success or '' on failure. Debug logging was also added to formatInputBlockCellContent to log block type and metadata. No exported or public signatures were changed.

Pre-merge checks

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title directly describes the main change: fixing input-slider value parsing from metadata, which matches the code modifications.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 59cad83 and 8c9e2a6.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/inputBlockContentFormatter.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: codecov/project
  • GitHub Check: Build & Test
🔇 Additional comments (2)
src/notebooks/deepnote/inputBlockContentFormatter.ts (2)

60-64: Slider parsing implementation looks solid.

Using z.coerce.number().safeParse() correctly handles numeric coercion and validation. In Zod 4, infinite values are rejected by default, which is appropriate for sliders. Empty string fallback aligns with other input types.


33-34: Console.log removed.

The debug logging flagged in previous reviews is no longer present.


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

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73%. Comparing base (821aadd) to head (8c9e2a6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #180   +/-   ##
=====================================
  Coverage     73%     73%           
=====================================
  Files        575     575           
  Lines      46922   46924    +2     
  Branches    5521    5521           
=====================================
+ Hits       34488   34490    +2     
  Misses     10612   10612           
  Partials    1822    1822           
Files with missing lines Coverage Δ
...c/notebooks/deepnote/inputBlockContentFormatter.ts 67% <100%> (+1%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 821aadd and 59cad83.

📒 Files selected for processing (1)
  • src/notebooks/deepnote/inputBlockContentFormatter.ts (3 hunks)
⏰ 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/notebooks/deepnote/inputBlockContentFormatter.ts (1)

63-64: Improved handling.

z.coerce.number() handles both numeric and string values from metadata, which is more robust than the type check. Note: Zod 4 rejects Infinity by default.

Based on library documentation.

Signed-off-by: Tomas Kislan <tomas@kislan.sk>
@tkislan tkislan marked this pull request as ready for review November 4, 2025 18:43
@tkislan tkislan requested a review from a team as a code owner November 4, 2025 18:43
@saltenasl saltenasl merged commit 565055c into main Nov 4, 2025
13 checks passed
@saltenasl saltenasl deleted the tk/fix-input-slider-metadata-parser branch November 4, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants