feat: support ADF task lists (checkboxes) in Markdown conversion - #73
Conversation
Markdown -> ADF: "- [ ]" / "- [x]" items now produce real taskList/
taskItem nodes (state TODO/DONE, generated localId), so descriptions and
comments get clickable Jira action items instead of literal bracket text.
ADF -> Markdown: taskList/taskItem previously hit the library translator
as unknown nodes and were flattened to concatenated text ("Test 1Test 2").
They now render as "- [ ] ..." / "- [x] ..." bullet lines, which also
round-trips: an edited description preserves checked state via the
[x] marker.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
There was a problem hiding this comment.
Review
Reviewed the diff, ran the full test suite locally, and probed edge cases with additional throwaway tests against this head (f65b603).
Correctness — verified
- List-boundary logic is symmetric. Task lists are checked before bullet lists in
parseBlocks(required — the prefixes overlap), andparseBulletListgot mirrored guards so adjacent bullet/task lists don't swallow each other. Both directions are covered by dedicated tests. - Marker regex agrees with
isBulletListItemon all three markers (-,*,+). - No JSON tag collisions — the new
LocalID/Statefields on the sharedADFAttrsareomitemptyand unique, so other node types' serialization is untouched. - Round-trip holds under adversarial input. Probed beyond the PR's own tests: a bold/link node as first inline content (
- [ ] **Bold** first) keeps its marker and re-parses as ataskList; nested taskLists from Jira render correctly with tab indent. newLocalIDsets RFC 4122 v4 version/variant bits correctly;crypto/randis the right source.
Minor observations (none blocking)
- Nesting flattens on round-trip — consistent with the parser's existing flat handling of nested bullet lists, so a known limitation rather than a regression.
- Empty task items render as
- [ ](translator drops the trailing space) and re-parse as a plain bullet. Cosmetic. - Mention-first items lose the following space (
@Kristinaplease check) — verified this is pre-existing translator behavior for mentions in any paragraph, not introduced here. - Ordered task items (
1. [ ] x) aren't recognized — out of scope, renders harmlessly as literal text.
Security / performance
Nothing concerning: anchored linear regex compiled once at package level, crypto/rand for ids, all content flows through the existing translator with no new injection surface.
Verdict
Approve. Additive, well-tested, live-verified against Jira per the PR body, and strictly improves on the previous behavior (task lists were silently mangled in both directions). The observations above are follow-up material at most.
Composed by the code-review agent, posted under my account.
Summary
Adds GFM task-list support to both directions of the Markdown⇄ADF conversion.
Markdown → ADF (
internal/api/markdown.go):- [ ]/- [x]items parse into realtaskList/taskItemnodes withstate: TODO/DONEand generatedlocalIds (UUIDv4-shaped, as required by Jira). Previously these fell through tobulletListand rendered as literal[ ]text — no clickable checkboxes. The task-list branch is checked before the bullet-list branch (the prefixes overlap), and each parser breaks cleanly at the other's items so adjacent lists don't swallow each other.ADF → Markdown (
internal/api/jira.go):taskList/taskItemwere unknown to the jira-cli translator and got silently flattened to concatenated text — an issue containing action items rendered them asTest 1Test 2. They now convert to a bullet list with[ ]/[x]markers before hitting the translator. The marker is merged into the leading text node because the translator drops trailing spaces of standalone text nodes.Because both directions speak the same syntax, checked state now round-trips:
atl jira issue view→ edit →atl jira issue edit --descriptionpreserves[x]states (items get fresh localIds, which Jira accepts).Docs updated (README syntax table, AGENTS.md formatting section).
Testing
internal/api/markdown_tasklist_test.go: parse states/localIds/inline marks, mutual list-boundary tests, ADFToText rendering, full round-trip.make checkgreen: gofmt, vet, golangci-lint (0 issues), all package tests pass.- [ ]/- [x]via the patched binary to NX-16095 (comment 561381) — accepted by Jira's ADF validation and reads back with intact markers.