fix: consider rich table cell refs in tree operations#586
Open
vagenas wants to merge 2 commits into
Open
Conversation
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Contributor
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
|
✅ DCO Check Passed Thanks @vagenas, all your commits are properly signed off. 🎉 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ests Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
PeterStaar-IBM
approved these changes
May 12, 2026
ceberam
requested changes
Jun 19, 2026
ceberam
left a comment
Member
There was a problem hiding this comment.
@vagenas there is a conflict with test_docling_doc.py
In the meantime...Besides nodes referenced by rich table cells, what about items referenced by a GraphCell or those referenced by a FloatingItem through captions, references, or footnotes ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Consider rich table cell refs during tree operations
This commit fixes an issue where tree operations weren't handling references from
RichTableCellobjects, causing broken document hierarchies.Changes:
_shift_up: When removing a node, updates any table cell references to point to the node's child instead (errors if the node has multiple or no children)._shift_down: Updates table cell references to point to the new wrapper node before moving the subtree._move_subtree: Prevents moving nodes that are referenced by table cells.fix_misplaced_list_itemsauto-healing: Uses updated_shift_downand_move_subtreeinstead of deleting and recreating items, which preserves references correctly.Tests: