Skip to content

Conversation

@yujonglee
Copy link
Contributor

@yujonglee yujonglee commented Jan 7, 2026

Summary

Refactors the file persistence system and improves markdown/tiptap bidirectional conversion:

File Persistence Refactoring:

  • Renamed collector.tsbatch-writer.ts with clearer documentation
  • Renamed markdown-dir.tsfrontmatter-entity.ts for better naming
  • Introduced unified MdContent enum type with variants: Md, Tiptap, Frontmatter, TiptapFrontmatter
  • Consolidated write_markdown_batch and write_frontmatter_batch into single write_md_batch command

Rust-based Conversion:

  • Added parse_md_to_tiptap command for markdown → tiptap JSON conversion
  • Session notes now persist as tiptap JSON with frontmatter instead of raw markdown

Test Fixes:

  • Updated test assertions in human, organization, and prompts persister tests to use new MdContent type format ({ type: "frontmatter", value: {...} })

Edge Case Tests (new):

  • Added comprehensive tests for tiptap conversion covering: nested lists (4 levels), mixed task/bullet lists, complex inline formatting (bold+italic, bold links), links with special characters, task lists with formatting, nested blockquotes, special characters (emoji, unicode, HTML entities)
  • Added round-trip tests (md→tiptap→md) for basic formatting, lists, task lists, headings, blockquotes, and code blocks

Known Limitation: Strikethrough (~~text~~) is not supported in the Rust markdown conversion - the underlying mdast library doesn't support Delete nodes.

Updates since last revision:

  • Fixed dprint formatting in test file
  • Added plugins/export to Cargo.toml workspace exclude list (TypeScript-only plugin without Rust code)
  • Fixed fs-sync plugin permissions: added parse_md_to_tiptap to build.rs, replaced write_markdown_batch/write_frontmatter_batch with write_md_batch in permissions

Review & Testing Checklist for Human

  • Data migration: Verify existing user data (sessions, notes) loads correctly after this change
  • Round-trip conversion: Test that markdown → tiptap → markdown preserves content (especially task lists, nested lists, formatting)
  • Session persistence: Create a new session, add notes with various formatting, close and reopen - verify content is preserved
  • Edge cases: Test notes with checkboxes, nested lists, images, links, code blocks
  • Strikethrough: Confirm strikethrough text is not used in the app (it won't persist correctly)

Recommended test plan:

  1. Run the app with existing user data directory
  2. Open existing sessions and verify notes display correctly
  3. Create new session with rich formatting (headings, lists, checkboxes, links)
  4. Close and reopen the app, verify all content persists correctly

Notes

Link to Devin run: https://app.devin.ai/sessions/ed19fa3ca48e4777b9976e69c5f6d5b0
Requested by: @yujonglee

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 2a81e29
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/695f59576cabbf0008c27072

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit 2a81e29
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/695f5957b341850008e05b3d

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 2a81e29
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/695f59574ef222000876d92f

devin-ai-integration bot and others added 4 commits January 8, 2026 03:22
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Add tests for nested lists (4 levels deep)
- Add tests for mixed task and regular lists
- Add tests for complex inline formatting (bold+italic, bold link, italic code)
- Add tests for links with special characters (query params, fragments, encoded spaces)
- Add tests for task lists with formatting (bold, italic, code, links)
- Add tests for nested blockquotes (3 levels)
- Add tests for blockquotes with formatting and lists
- Add tests for special characters (emoji, unicode, HTML entities)
- Add round-trip tests (md->tiptap->md) for basic formatting, lists, task lists, headings, blockquotes, code blocks, and complex documents

Generated with claude CLI assistance.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Fix dprint formatting in test_roundtrip_complex_document
- Add plugins/export to Cargo.toml exclude list (TypeScript-only plugin)

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Add parse_md_to_tiptap to build.rs COMMANDS list
- Replace write_markdown_batch and write_frontmatter_batch with write_md_batch
- Update default.toml to reference the correct permission names
- Add autogenerated permission files for new commands
- Remove obsolete permission files

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee closed this Jan 8, 2026
@yujonglee yujonglee deleted the better-tiptap-coverage branch January 8, 2026 09:35
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.

2 participants