-
Notifications
You must be signed in to change notification settings - Fork 4
fix: markdown blocks being saved as type=code in .deepnote files #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Modified createBlockFromPocket to infer block type from cell kind when pocket metadata is missing - Markdown cells (NotebookCellKind.Markup) now correctly default to type='markdown' instead of type='code' - Added unit tests to verify markdown type preservation - Ensures round-trip fidelity for markdown blocks even when __deepnotePocket metadata is not preserved
📝 WalkthroughWalkthroughThese changes extend the Deepnote converter to properly handle markdown cells without pocket metadata. The production code now infers a default block type— Suggested reviewers
Pre-merge checks✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (2)**/*.{test,spec}.ts📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
Files:
src/platform/**/*.ts📄 CodeRabbit inference engine (.github/instructions/platform.instructions.md)
Files:
🧬 Code graph analysis (3)src/notebooks/deepnote/deepnoteDataConverter.unit.test.ts (1)
src/platform/deepnote/pocket.unit.test.ts (2)
src/platform/deepnote/pocket.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (6)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
=====================================
Coverage 73% 73%
=====================================
Files 574 574
Lines 46863 46881 +18
Branches 5520 5521 +1
=====================================
+ Hits 34410 34428 +18
Misses 10635 10635
Partials 1818 1818
🚀 New features to boost your workflow:
|

Problem
Markdown blocks in .deepnote files were being saved with
type=codeinstead of retaining their correcttype=markdown. This was causing data corruption in the serialization/deserialization process.Root Cause
The
createBlockFromPocketfunction insrc/platform/deepnote/pocket.tshad a hardcoded fallback totype='code'when the pocket metadata was missing or didn't contain a type field. This happened because VSCode may not preserve the__deepnotePocketmetadata when cells are edited.Solution
Modified
createBlockFromPocketto infer the block type from the cell'skindproperty when the pocket metadata doesn't have a type:cell.kind === NotebookCellKind.Code, default totype='code'cell.kind === NotebookCellKind.Markup, default totype='markdown'Changes
src/platform/deepnote/pocket.tsto use cell kind as fallback for block typesrc/platform/deepnote/pocket.unit.test.tsto verify the fixsrc/notebooks/deepnote/deepnoteDataConverter.unit.test.tsTesting
✅ All 1932 unit tests pass
✅ New tests specifically verify markdown cells without pocket metadata retain
type=markdown✅ Ensures round-trip fidelity for markdown blocks
Pull Request opened by Augment Code with guidance from the PR author
Summary by CodeRabbit
Bug Fixes
Tests