Skip to content

Keep a checkbox inside a code sample from becoming a task - #90

Merged
rociiu merged 2 commits into
rociiu:mainfrom
rudycelekli:fix/notes-code-fence-todos
Oct 25, 2026
Merged

rociiu merged 2 commits into
rociiu:mainfrom
rudycelekli:fix/notes-code-fence-todos

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Checking off a task in a note treated a checkbox inside a code sample as a real task when the sample showed a ~~~ fence, or a shorter fence inside a longer one. The task after that sample could not be toggled from the editor.

Test

npx vitest run test/writer-tasks.test.ts in apps/web. The two new cases fail on main and pass here.

A sample that shows another fence, or a shorter fence inside a longer one, was checked off as a real todo, and the task after the sample was left alone.
Typecheck treats each capture as optional, so a real fence line failed the build before the checkbox logic ran.
@rudycelekli
rudycelekli force-pushed the fix/notes-code-fence-todos branch from 326fbe2 to 2368f3f Compare October 24, 2026 04:45
@rociiu

rociiu commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Thanks, the fence tracking looks right and the new tests cover both cases.

CI failed on an end-to-end test that this PR doesn't touch: remote-access.spec.ts › revoke and revoke all make tokens unusable and empty the list. All unit tests passed. It looks flaky, so I'll re-run it.

Two small nits, not blocking:

  • toggleTaskAt recomputes fencedLines(value.split("\n")). It could use the cached fenced value instead.
  • In Markdown, a fence indented 4 or more spaces is an indented code block, not a fence. FENCE_LINE accepts any indent. That's an edge case and fine to leave.

@rociiu

rociiu commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Thanks @rudycelekli! The fence tracking fix and the new tests look good. Merging.

@rociiu
rociiu merged commit 1682db4 into rociiu:main Oct 25, 2026
1 of 2 checks passed
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