fix: rows and columns with RichTableCell#653
Open
PeterStaar-IBM wants to merge 1 commit into
Open
Conversation
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
✅ DCO Check Passed Thanks @PeterStaar-IBM, all your commits are properly signed off. 🎉 |
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/
|
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.
What
TableData.get_row_bounding_boxes / get_column_bounding_boxes only looked at cell.bbox. Since TableCell.bbox is
optional and a RichTableCell typically has bbox=None (its content lives behind ref), those cells were silently
skipped — so any row or column containing a rich cell got a bounding box that ignored the rich cell's actual
extent, or was omitted entirely.
How
Mirroring the existing _get_text pattern, this adds a _get_bbox method:
resolves self.ref, walks the referenced subtree, and returns the union (BoundingBox.enclosing_bbox) of all
descendant provenance boxes. Returns None when no doc / no provenance is available.
get_row_bounding_boxes / get_column_bounding_boxes gain an optional doc keyword and resolve each cell's bbox once
up front via _get_bbox(doc=doc). TableVisualizer forwards doc so the drawn row/column overlays pick up the
resolved boxes.
Compatibility
Backward compatible: doc defaults to None, so existing callers that pass no doc keep current (own-bbox-only)
behavior.
Tests
Adds test_table_data_bounding_boxes_with_rich_table_cell, which builds a table mixing a RichTableCell (bbox=None,
ref → group of text items with prov boxes) and a plain cell, and asserts: