Skip to content

feat(diff): composite — paragraph move crossing a table boundary contests the whole table block #229

Description

@JSv4

Follow-on from the DocxDiff N-way consolidate work (PR #228), surfaced during the pre-D4 hardening (native move + per-cell table composition).

Current behavior

When a reviewer moves a paragraph to a position that crosses a table boundary (e.g. relocating a trailing paragraph to between a lead paragraph and a table), the block aligner can read the table as the displaced block. The consolidate then collapses that table to a whole-table block-level conflict (under BaseWins the base table is kept), so a second reviewer's disjoint table-cell edit in that table is surfaced as part of the block conflict rather than composed per-cell.

This is not a correctness failure: there is no silent loss, reject ≡ base holds, and the contested table edit is recorded in the conflict (not dropped). It is a precision/quality limitation in how a paragraph move adjacent to a table interacts with per-cell table composition.

Repro (sketch)

  • Base: paragraph A + 2×2 table + paragraph B.
  • Reviewer Alice: move paragraph B to just before the table (crossing the table boundary).
  • Reviewer Bob: edit one table cell.
  • Observed: whole-table block conflict; Bob's cell edit not composed. (If Alice instead moves B to the very top so the lead+table stay contiguous, both compose cleanly — confirming the boundary-crossing is the trigger.)

Desired

A paragraph move adjacent to / crossing a table boundary should not contest the table block; the move and the disjoint table-cell edit should each apply independently (native move + per-cell compose), conflicts == 0, reject ≡ base.

Pointers

  • Docxodus/Ir/Diff/IrCompositeMerger.cs (move planning PlanMoves, table-compose branch / ComposeTableDiffs)
  • Docxodus/Ir/Diff/IrBlockAligner.cs (which block is chosen as the relocated/displaced one)
  • Design context: docs/architecture/ir_diff_engine.md § N-way composite / Consolidate.

Acceptance criteria

  • A reviewer move that crosses a table boundary + another reviewer's disjoint table-cell edit both apply (native move + composed cell), conflicts == 0, reject ≡ base, no content loss.
  • Regression: base 2-way parity stays 179/179; full suite green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions