Skip to content

Lists: numId 0 is no list, Decrease Indent pins the margin, indent repairs old levels (#1728) - #1791

Merged
yeroo merged 5 commits into
mainfrom
issue-1728-leftovers-from-1653-bulleted-and
Oct 25, 2026
Merged

yeroo merged 5 commits into
mainfrom
issue-1728-leftovers-from-1653-bulleted-and

Conversation

@yeroo

@yeroo yeroo commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #1728 (leftovers from #1653 / PR #1727).

What changed

  • numId 0 is no list (r2-p1). <w:numId w:val="0"/> means "no numbering". ParProps::in_list() is now the list test in the terminal render, PDF export, Markdown, RTF, AutoFormat as you type, the Compare merger (which kept dropping an explicit 0, so the style's numbering came back) and the suite (list_markers, blank_base; eff_indent gives an explicit numId 0 no level step). The serializer still writes numId 0: it cancels a style's numbering.
  • Decrease Indent reaches the margin (r2-p2). A list item with its own left indent goes to 0 and is written w:left="0" (serialize::pin_shadow_left_zero, idempotent, attribute order kept), so the level's indent no longer comes back and the item stays on its own-indent path in the session as after a reload. change_indent now records no undo step when a press would change nothing (step_indent compared on a clone); that also drops the empty step a Decrease at 0 recorded on a plain paragraph.
  • Older builds' indent-less levels (r3-m3). Package::repair_list_indents() repairs docxy's reserved lists (9990/9991), sharing ensure_list's repair. Terminal docxy and docxwasm run it before Increase/Decrease Indent; the suite runs it after an indent that made an undo step (Shift+Tab, Ctrl+M, ribbon/KeyTips/harness act, Repeat). The suite draws levels from ilvl, so there the repair is for the saved file (Word, Pages).
  • CLAUDE.md: a short "Lists" note.

Testing

New unit tests: render, PDF export, Markdown, RTF, AutoFormat, serializer and Compare for numId 0; editor tests for the margin pin, its idempotence (byte-identical w:ind, no undo step) and Increase after it; package tests for the repair (other list byte-identical, no part created, second call a no-op); a terminal docxy test through the ribbon act and Ctrl+M; suite tests for list_markers/blank_base and eff_indent.
cargo fmt --all --check, clippy -D warnings (docxcore, docxy, docxwasm, suite), cargo test -p docxcore -p docxy -p docxwasm (2794 passed), cargo test --manifest-path suite/Cargo.toml (2687 passed).
The suite's indent call sites have no unit seam (Docxy cannot be built in a test); they are covered by the package test and by reading them. No .uit case: no harness verb reads numbering.xml.

Review

revmux round 1 (4 Claude reviewers): 0 Major; 2 minor doc-comment errors, 1 immaterial duplication and 1 pre-existing suite eff_indent gap fixed in eb99c49; 1 pre-existing finding (style-numbered item at 0) deferred as a follow-up, as is the Paragraph dialog's set_indent(0) on a list item (planned out of scope): both in #1792.
review stopped: round 1 had no Major; all findings fixed

🤖 Generated with Claude Code

https://claude.ai/code/session_011yWYrLAGAD6qrej5aEktVD

yeroo and others added 4 commits October 25, 2026 10:59
…Format, compare and the suite (#1728)

w:numId="0" means "no numbering" in OOXML (it cancels a style's
numbering), so every list-membership test goes through ParProps::in_list().
The serializer still writes the 0, and compare's merge no longer drops it
as an undefined list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EieX45QTPDJv2KbHRv753D
…and keeps it there (#1728)

At 0 a list item on the direct-indent path wrote no w:left, so its
numbering level's indent came back and the item jumped right. It now
pins an explicit w:left="0" in the loaded w:ind (idempotently, keeping
attribute order), so it stays on the direct path in session as after a
reload. change_indent's early-out compares the stepped props, so a
Decrease that changes nothing records no undo step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EieX45QTPDJv2KbHRv753D
…levels first (#1728)

An item of docxy's lists with no direct indent steps its level, which
moves it only if that level has a w:ind; a 9990/9991 list saved before
the level indents did not move until Bullets was pressed again.
Package::repair_list_indents runs ensure_list's repair for both ids and
every host's indent path calls it: terminal docxy (ribbon, Ctrl+M) and
docxwasm before the edit, the suite after an indent that made a step
(Shift+Tab, Ctrl+M, the ribbon act, Repeat by key and QAT).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EieX45QTPDJv2KbHRv753D
The suite's eff_indent gives an explicit numId 0 no level step (no numId
may still be a style's list, so it keeps one). The repair comments say
why it matters: Word and Pages indent by the level, while the suite draws
from ilvl; terminal docxy and docxwasm repair before the edit, the suite
after one. The shadow helpers share table_props::element_name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EieX45QTPDJv2KbHRv753D
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.58308% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docxwasm/src/bridge.rs 20.00% 4 Missing ⚠️
docxcore/src/editor.rs 96.87% 3 Missing ⚠️
docxy/src/main.rs 97.91% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EieX45QTPDJv2KbHRv753D
@yeroo
yeroo merged commit aa797ee into main Oct 25, 2026
14 checks passed
@yeroo

yeroo commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Merged automatically (auto-merge is on for this checkout): review stopped: round 1 had no Major; all findings fixed; merge rounds: 1 CI fix round (suite cargo fmt, formatting only); whole suite green on 02764ae (11301 tests); merge-check ok.

Leftovers: #1792 (checklist):

  • r1-p2 (minor, review r1, pre-existing, docxcore/src/editor.rs:4107): Decrease Indent to 0 on a style-numbered list item brings the level indent back
  • plan-setindent (minor, planned out of scope, docxcore/src/editor.rs): Paragraph dialog left indent 0 on a list item brings the level indent back

No disputed findings. Not filed, as they are design choices rather than work: repairing old-build levels at load (rejected in the plan) and the suite's own numIds 1/2.

@yeroo
yeroo deleted the issue-1728-leftovers-from-1653-bulleted-and branch October 25, 2026 09:58
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.

Leftovers from #1653: Bulleted and numbered lists save with no indent in numbering.xml; Pages lays the list out at the right margin

2 participants