[codex] Fix markdown list roundtrips#135
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
flashtype-website | 3f57125 | Commit Preview URL Branch Preview URL |
Jun 17 2026, 09:18 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea368371c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| isItalic: editor.isActive("italic"), | ||
| isCode: editor.isActive("code"), | ||
| isBulletList: editor.isActive("bulletList"), | ||
| isBulletList: editor.isActive("bulletList") && !isTaskList, |
There was a problem hiding this comment.
Treat mixed-list plain items as bullets
When the cursor is on the plain bullet item in a mixed list like - plain followed by - [ ] todo, astToTiptapDoc marks the whole bulletList as isTaskList if any sibling has checked, so computeTaskListActive returns true even though the current listItem.checked is null. With this new && !isTaskList gate, the Bullet button is no longer pressed and the Checklist button is shown as active for that plain item, so the toolbar state no longer matches the selected item in mixed lists.
Useful? React with 👍 / 👎.
ea36837 to
3f57125
Compare
Summary
Fixes Markdown list roundtripping in the editor:
- [],- [ ], and- [x]when serializing Markdown.Root Cause
TipTap represents checklists on top of bullet-list/list-item nodes, while the Markdown serializer did not emit task markers from
listItem.checked. The toolbar also treated collapsed clicks inside active lists as unwrap commands, which could convert an existing one-item bullet list back into a paragraph before persistence.Validation
pnpm testpnpm run typecheckgit diff --check/Users/samuel/Desktop/flash_kb/new-file.mdNote
Medium Risk
Touches the Markdown save path and list editing UX; wrong behavior could corrupt saved file content, though changes are scoped and heavily tested.
Overview
Fixes Markdown save roundtrips for bullet lists, checklists, and toolbar behavior so list syntax is not dropped accidentally.
Serialization:
serializeAstnow injects[ ]/[x]markers fromlistItem.checkedbefore the Rust serializer runs, so checked tasks roundtrip through the editor.Formatting toolbar: Collapsed clicks on bullet/numbered list buttons no longer unwrap the current item; unwrap only happens with an explicit text selection. Bullet vs checklist aria-pressed state is split so task items are not shown as plain bullets.
Typing shortcuts: Checklist triggers inside an existing list only flip
checkedon the first paragraph of the item, avoiding false task conversion when[ ]is typed in a continuation line.Adds regression coverage (toolbar, shortcuts, editor persistence including a long-document mid-edit case) and a patch changenote.
Reviewed by Cursor Bugbot for commit 3f57125. Bugbot is set up for automated code reviews on this repo. Configure here.