fix(frontend): keep Map Analysis popup inside the viewport (#806) - #1052
Conversation
Closes OWASP#806. Enable Popper.js preventOverflow so the CRE info popup shifts to stay visible when its trigger sits near the right edge, and cap its width on narrow viewports.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Summary by CodeRabbit
WalkthroughChangesGap analysis popup
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to The Map Analysis popup now constrains its width and avoids viewport overflow, improving readability near screen edges. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
northdpole
left a comment
There was a problem hiding this comment.
Simple correct fix for #806: enable Popper preventOverflow and cap popup width. LGTM.
Fixes #806.
Summary
The CRE information popup on the Map Analysis page gets positioned outside the viewport when its trigger sits near the right edge of the screen, hiding most of the content.
What changed
application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx:preventOverflowon the CRE infoPopupso it shifts to stay within the viewport. (semantic-ui-react already enablesflip, butpreventOverflowis disabled by default.)min(550px, calc(100vw - 40px))so it also fits on narrow viewports.How to reproduce
Testing
npx prettier@2 --check application/frontend/src/pages/GapAnalysis/GapAnalysis.tsxpasses.yarn build(webpack production) compiles clean, only pre-existing bundle-size warnings.