Conversation
📝 WalkthroughWalkthroughRemoved the debug seed implementation and its exports from the desktop devtool seed module. Bumped TipTap and related type/package versions. Reworked TipTap utils: json2md now uses MarkdownManager with stricter typing; md2json gains try/catch and a fallback document on parse failure. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as caller
participant Utils as packages/tiptap/src/shared/utils.ts
participant Manager as MarkdownManager
Caller->>Utils: md2json(markdown)
Utils->>Manager: new MarkdownManager({ extensions: getExtensions() }).parse(markdown)
alt parse success
Manager-->>Utils: JSONContent
Utils-->>Caller: JSONContent
else parse failure
Manager-->>Utils: throws error
Utils-->>Utils: console.error(error)
Utils-->>Caller: fallback JSONContent (paragraph with original markdown)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 2 inconclusive)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
⏰ 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 (13)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/tiptap/src/shared/utils.ts (1)
1-3: md2json robustness improved; minor optional refinementsUsing
MarkdownManagerwithgetExtensions()inside a try/catch and falling back to adoccontaining the original markdown as a single paragraph is a solid way to prevent crashes when parsing bad or unexpected Markdown. The behavior change (returning “raw markdown as text” instead of throwing) is reasonable for a shared utility.Two optional thoughts you might consider (not blockers):
- If
MarkdownManagerconstruction is relatively expensive or used in hot paths, you could cache a single instance at module scope and reuse it instead of creating a new one per call.- If downstream consumers need to distinguish “parsed successfully” vs “fallback used”, you might in the future surface that via a wrapper return type (e.g.,
{ doc, hadParseError }) or a dedicated logging hook instead ofconsole.error.If you want, I can sketch a small refactor that caches a manager instance while preserving the current API shape.
Also applies to: 74-86
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
apps/desktop/src/devtool/seed/index.ts(1 hunks)apps/desktop/src/devtool/seed/versions/debug.ts(0 hunks)apps/desktop/src/devtool/seed/versions/index.ts(0 hunks)packages/tiptap/package.json(2 hunks)packages/tiptap/src/shared/utils.ts(2 hunks)
💤 Files with no reviewable changes (2)
- apps/desktop/src/devtool/seed/versions/index.ts
- apps/desktop/src/devtool/seed/versions/debug.ts
🧰 Additional context used
🧬 Code graph analysis (2)
packages/tiptap/src/shared/utils.ts (1)
packages/tiptap/src/shared/extensions/index.ts (1)
getExtensions(19-89)
apps/desktop/src/devtool/seed/index.ts (4)
apps/desktop/src/devtool/seed/shared/index.ts (1)
SeedDefinition(22-26)apps/desktop/src/devtool/seed/versions/empty.ts (1)
emptySeed(4-12)apps/desktop/src/devtool/seed/versions/random.ts (1)
randomSeed(118-127)apps/desktop/src/devtool/seed/versions/curated.ts (1)
curatedSeed(6-17)
⏰ 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: fmt
🔇 Additional comments (3)
apps/desktop/src/devtool/seed/index.ts (1)
2-6: Seed list update (debug seed removal) looks goodImporting only
emptySeed,randomSeed, andcuratedSeedand exporting them in[emptySeed, randomSeed, curatedSeed]keeps the publicseedssurface clean and production‑friendly. No issues from this change on its own.packages/tiptap/package.json (1)
20-39: Tiptap & TanStack version bumps look internally consistentAll
@tiptap/*packages used here are aligned on^3.10.7, and the TanStack + React type bumps are coherent with the existing peer ranges. Nothing stands out as incorrect in this manifest alone, but dependency issues often show up only at install/runtime.Please run your usual install + test workflow on this branch and double‑check there are no new peer‑dependency warnings or regressions around the editor (especially Markdown/seed flows) before merging.
Also applies to: 50-52
packages/tiptap/src/shared/utils.ts (1)
66-71: No internal callers found—the stricterjson2mdtyping is safeMy search of the codebase found that
json2mdhas zero call sites internally. The function is exported but not used anywhere within the repository, which means the stricterJSONContenttyping poses no risk to existing internal code.The change is functionally correct and is actually an improvement: it eliminates the ambiguity of the old signature and makes the API contract explicit. If
json2mdis part of a public package API, external consumers would need to ensure they passJSONContent, but that's a reasonable contract clarification rather than a breaking change caused by the implementation—it's a documentation of intended behavior.
No description provided.