Skip to content

id(web): loose task list items fuse on save — task_list hardcodes tight, second paragraph/code block destroyed #1036

Closed

Description

@dezren39

Summary

In the id web editor, a loose task list item — a checkbox item containing a second paragraph (or a code block) — is corrupted on save. The paragraph boundary is dropped on the first save, and on the second save the item's blocks fuse into a single run of text. A code block inside a task item is destroyed outright (it becomes inline paragraph text).

Bullet and ordered list items with the exact same structure round-trip correctly, so this is specific to the task-list path.

Evidence (verified on main 70efcd4, standalone probe crate carrying a verbatim copy of pkgs/id/src/web/markdown.rs, comrak 0.56.0; logs in the goal's hidden_files probe-2026-10-26-1945/out3.log)

Multi-paragraph task item:

orig:   "- [ ] first\n\n  second para\n- [ ] other\n"
save 1: "- [ ] first\n  second para\n- [ ] other\n"        ← blank separator gone
save 2: "- [ ] first second para\n- [ ] other\n"           ← paragraphs fused into one

PM after save 1 confirms the damage is structural, not cosmetic: the item holds ONE paragraph containing first, , second para.

Task item with a code block:

orig:   "- [ ] item\n\n  ```\n  code\n  ```\n"
save 1: "- [ ] item\n      code\n"
save 2: "- [ ] item code\n"                                 ← code block gone, text inlined

Controls (same probe, same shapes): multi-paragraph bullet and ordered items preserve the blank line and are two-save fixpoints; a task item whose second block is a nested list survives. Checked items (- [x]) are affected identically.

Root cause

  • Parse direction, pkgs/id/src/web/markdown.rs:214-220: the task_list JSON node carries no tight attr, unlike bullet_list/ordered_list, which store list.tight.
  • Save direction, markdown.rs:1019-1027: the "task_list" arm hardcodes tight: true in the comrak NodeList. A loose list rendered tight gets no blank line between an item's block children, so the re-parse merges them.
  • pkgs/id/web/src/editor.ts:98 — the task_list schema node likewise declares no attrs, so even a codec-side fix needs the schema/runtime side considered (same pattern as id(web): ordered task lists lose their ordering on save — rewritten as bullet task lists #997).

Why it matters

Silent data corruption on save for a common construct: anyone who writes a task with a note paragraph underneath it (or a code snippet in a task) loses the structure — first the separation, then the block itself. Because save 1 still looks plausible, the damage is easy to miss until the fused text is noticed.

Acceptance criteria

  • A loose (multi-paragraph) task list item round-trips with its paragraph boundary preserved and is a two-save fixpoint, for both - [ ] and - [x] items.
  • A code block inside a task list item survives a save as a code block (not inlined into the paragraph text).
  • Tight (single-paragraph) task lists render exactly as before.
  • Regression tests in web::markdown covering the cases above; existing markdown tests pass.

Suggested direction

Carry tight on the task_list node the way bullet/ordered lists do (parse stores it, save reads it instead of hardcoding true), and add the corresponding attr on the editor.ts task_list schema node if the runtime needs it. Related but distinct: #997 (ordered task lists lose their start number).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  3. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job
    • Session / ID: new-issue-creator cron run 2026-10-26 19:45 CDT
    • Found via: filed this run
    • Task: Verified with a standalone probe crate carrying a verbatim copy of src/web/markdown.rs (comrak 0.56.0) on main 70efcd4 (logs hidden_files/probe-2026-10-26-1945/out3.log): a loose task list item's second paragraph loses its blank separator on save 1 and fuses into one paragraph on save 2; a code block inside a task item is inlined as paragraph text by save 2. Root cause: parse stores no tight attr on task_list (markdown.rs:214-220) and the save arm hardcodes tight:true (:1019-1027); editor.ts task_list schema (:98) has no attrs. Bullet/ordered controls with identical shapes are fixpoints. Enqueued as a triage packet to repo-health-code-pilot — the fix spans codec + editor schema (same pattern as id(web): ordered task lists lose their ordering on save — rewritten as bullet task lists #997).
    • Expectation: triage confirms the representation (tight attr on task_list in codec + editor.ts); done when loose task items round-trip with block structure intact, fixpoint over two saves.
    • Links: probe evidence in goal hidden_files (see issue body)
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 27, 2026
  6. 43 remaining items

  7. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Resumed again by queue worker (Lane A), task 1216: the CI rerun for the rustfmt fix @ 5a92096 never triggered (only Auto Assign/CodeRabbit exist for that SHA — an Actions trigger gap; a follow-up empty commit didn't retrigger either, as it touches no pkgs/id/** path). Meanwhile main landed #997 (ordered task lists) in the same task_list code and the PR went conflicted. I merged current main (bc9b67f) into the branch and resolved by combining both features: parse now emits attrs {tight} always plus order for ordered task lists; save reads order for the list type and tight (with the #1036 legacy inference) for both bullet and ordered; editor.ts task_list carries both attrs. #997's shape assertion (bullet task list has no attrs) was updated to the combined shape (no order, tight: true) — the one intentional PM-shape change #1036 exists to make. Verified in the verbatim-codec probe: 83/83 tests pass (both #1036 and #997 suites), rustfmt clean. Merge pushed @ f0c4444 and CI has now triggered normally. Parked for the run.

    {"v":1,"kind":"note","state":"parked","task_id":1216,"summary":"CI never triggered for 5a920963 (Actions gap). Merged main bc9b67f4 into PR 1041 branch, combining #1036 tight with main's #997 order in markdown.rs + editor.ts; #997 shape assertion updated to combined shape. Probe 83/83, rustfmt clean, merge @ f0c44444, CI now running. Parked.","artifacts":["https://github.com/developing-today/code/pull/1041"],"next":"merge PR 1041 when CI green on f0c44444, verify #1036 auto-close, complete task 1216"}
    
  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 27, 2026
  9. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  10. added a commit that references this issue on Oct 27, 2026
  11. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions