ADFA-3912 | Fix fuzzy attribute parsing bounds and UI element tag filtering#1275
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughRelease Notes - ADFA-3912 | Fix fuzzy attribute parsing bounds and UI element tag filtering
Risks & considerations
WalkthroughThe PR adds a substring-range guard in FuzzyAttributeParser, introduces List.buildPlaceholderOverrides, and refactors YoloToXmlConverter.generateXmlLayout into ordered private helpers for candidate extraction, scaling, text association, finalization, and canvas/tag extraction. ChangesAttribute Parsing Validation Guard
Placeholder override utility
XML Generation Pipeline Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
48bb962 to
35ac06e
Compare
Added bounds validation in FuzzyAttributeParser and updated UI element filter logic.
35ac06e to
efe479f
Compare
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
`@cv-image-to-xml/src/main/java/org/appdevforall/codeonthego/computervision/domain/YoloToXmlConverter.kt`:
- Around line 87-95: In associateTextToWidgets change the parent selection so
you do not drop non-text boxes based on annotationMatcher.isTag: keep parents as
all boxes where it.label != "text" (remove the isTag check), while still
filtering initialTexts with annotationMatcher.isTag so only text boxes get
tag-filtered; then call geometryProcessor.assignTextToParents(parents,
initialTexts, scaledBoxes) and proceed with the existing remainingTexts and
geometryProcessor.assignNearbyTextToWidgets call unchanged (references:
associateTextToWidgets, annotationMatcher.isTag,
geometryProcessor.assignTextToParents,
geometryProcessor.assignNearbyTextToWidgets).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b21178be-4d63-4592-b3a7-27fcbba14f63
📒 Files selected for processing (3)
cv-image-to-xml/src/main/java/org/appdevforall/codeonthego/computervision/domain/FuzzyAttributeParser.ktcv-image-to-xml/src/main/java/org/appdevforall/codeonthego/computervision/domain/YoloToXmlConverter.ktcv-image-to-xml/src/main/java/org/appdevforall/codeonthego/computervision/utils/PlaceholderUtils.kt
Description
Fixed an out-of-bounds string extraction error in
FuzzyAttributeParserby adding a safeguard check (current.valueStart > valueEnd) before processing annotations. Additionally, updated the UI element filtering logic inYoloToXmlConverterso that theisTagexclusion only applies to elements explicitly labeled as "text". This ensures valid UI elements are not improperly excluded during conversion.Details
document_5179472272527722523.mp4
Ticket
ADFA-3912
Observation