Skip to content

feat: support ADF task lists (checkboxes) in Markdown conversion - #73

Merged
ktaganova merged 3 commits into
mainfrom
claude/adf-task-lists
Sep 3, 2026
Merged

feat: support ADF task lists (checkboxes) in Markdown conversion#73
ktaganova merged 3 commits into
mainfrom
claude/adf-task-lists

Conversation

@PascalTemel

Copy link
Copy Markdown
Contributor

Summary

Adds GFM task-list support to both directions of the Markdown⇄ADF conversion.

Markdown → ADF (internal/api/markdown.go): - [ ] / - [x] items parse into real taskList/taskItem nodes with state: TODO/DONE and generated localIds (UUIDv4-shaped, as required by Jira). Previously these fell through to bulletList and 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/taskItem were unknown to the jira-cli translator and got silently flattened to concatenated text — an issue containing action items rendered them as Test 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 --description preserves [x] states (items get fresh localIds, which Jira accepts).

Docs updated (README syntax table, AGENTS.md formatting section).

Testing

  • New internal/api/markdown_tasklist_test.go: parse states/localIds/inline marks, mutual list-boundary tests, ADFToText rendering, full round-trip.
  • make check green: gofmt, vet, golangci-lint (0 issues), all package tests pass.
  • Live verification against Jira: posted a comment with - [ ]/- [x] via the patched binary to NX-16095 (comment 561381) — accepted by Jira's ADF validation and reads back with intact markers.

PascalTemel and others added 3 commits August 17, 2026 17:29
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.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 42.28% (+1.16%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/jira.go 28.01% (+1.27%) 557 (+11) 156 (+10) 401 (+1) 👍
github.com/enthus-appdev/atl-cli/internal/api/markdown.go 89.78% (-1.13%) 411 (+37) 369 (+29) 42 (+8) 👎

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

  • github.com/enthus-appdev/atl-cli/internal/api/markdown_tasklist_test.go

@ktaganova ktaganova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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), and parseBulletList got mirrored guards so adjacent bullet/task lists don't swallow each other. Both directions are covered by dedicated tests.
  • Marker regex agrees with isBulletListItem on all three markers (-, *, +).
  • No JSON tag collisions — the new LocalID/State fields on the shared ADFAttrs are omitempty and 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 a taskList; nested taskLists from Jira render correctly with tab indent.
  • newLocalID sets RFC 4122 v4 version/variant bits correctly; crypto/rand is the right source.

Minor observations (none blocking)

  1. 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.
  2. Empty task items render as - [ ] (translator drops the trailing space) and re-parse as a plain bullet. Cosmetic.
  3. Mention-first items lose the following space (@Kristinaplease check) — verified this is pre-existing translator behavior for mentions in any paragraph, not introduced here.
  4. 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.

@ktaganova
ktaganova merged commit c7bfa1a into main Sep 3, 2026
11 checks passed
@ktaganova
ktaganova deleted the claude/adf-task-lists branch September 3, 2026 10:54
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