Feat/detect line text overlap - #2069
Conversation
📝 WalkthroughWalkthroughAdds line-versus-text glyph crossing detection with visibility and grazing thresholds, preserves line endpoints and effective alpha during parsing, wires findings into slide linting, and reports low-opacity text that lies outside the canvas. ChangesSlide lint behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SlideXML
participant LineExtractor
participant CrossingDetector
participant LintSlide
SlideXML->>LineExtractor: Parse line endpoints and effective alpha
LineExtractor->>CrossingDetector: Provide line and text elements
CrossingDetector->>CrossingDetector: Test segment against eroded glyph rectangle
CrossingDetector->>LintSlide: Return bbox_overlap findings
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/lark-slides/scripts/xml_text_overlap_lint.py`:
- Around line 1682-1688: Update detect_line_text_crossings to reuse the line
elements and anonymous-ID assignment produced by extract_elements, or preserve
those IDs when parsing the XML again. Ensure each unnamed line receives the same
stable line-{...} identifier across both reporting paths and lint runs, while
leaving named line IDs unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 654f724e-7b24-4508-b1ae-b7234953c3de
📒 Files selected for processing (2)
skills/lark-slides/scripts/xml_text_overlap_lint.pyskills/lark-slides/scripts/xml_text_overlap_lint_test.py
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@b5fac4b224667e008befbb9703b0283c568bd8b4🧩 Skill updatenpx skills add larksuite/cli#feat/detect_line_text_overlap -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2069 +/- ##
=======================================
Coverage 75.15% 75.16%
=======================================
Files 912 912
Lines 96453 96451 -2
=======================================
+ Hits 72492 72495 +3
+ Misses 18383 18380 -3
+ Partials 5578 5576 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fangshuyu-768
left a comment
There was a problem hiding this comment.
The 124 existing tests pass, but targeted cases exposed four correctness issues in the new blocking line/text crossing rule.
Summary
Improve the Slides XML layout lint gate by tightening canvas overflow reporting and adding detection for visible line elements that cross readable text glyphs.
Changes
<line>elements that cross text glyphs and report them asbbox_overlaperrors.Test Plan
lark-cli slideslint flow works as expectedRelated Issues
Summary by CodeRabbit