fix: prevent axis attribute menu from appearing offscreen [CODAP-1048]#2300
fix: prevent axis attribute menu from appearing offscreen [CODAP-1048]#2300
Conversation
Wrap MenuList in a Portal so it renders at the document body level, allowing Popper to properly calculate viewport boundaries for positioning. Add placement="auto" to let Popper choose the optimal menu position based on available space. These changes also fix a Chakra UI issue where the bottom menu item would sometimes disappear, so the spacer MenuItem hack has been removed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2300 +/- ##
==========================================
+ Coverage 86.69% 86.71% +0.02%
==========================================
Files 724 724
Lines 38770 38771 +1
Branches 9588 9596 +8
==========================================
+ Hits 33610 33620 +10
+ Misses 5151 4847 -304
- Partials 9 304 +295
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
codap-v3
|
||||||||||||||||||||||||||||
| Project |
codap-v3
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 08s |
| Commit |
|
| Committer | eireland |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Pull request overview
This PR fixes a longstanding issue where graph axis attribute menus would appear offscreen when the graph was positioned near the bottom of the browser window or when attribute lists were very long.
Changes:
- Wraps the MenuList component in a Chakra UI Portal to render it at document body level
- Changes Menu positioning from
boundary="scrollParent"toplacement="auto"for automatic optimal positioning - Removes the spacer MenuItem hack that was previously needed to prevent bottom items from being cut off
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| v3/src/components/axis/components/axis-or-legend-attribute-menu.tsx | Wraps MenuList in Portal and updates Menu props for proper viewport-aware positioning |
| v3/cypress/support/elements/axis-elements.ts | Updates test selector to find menu items at body level instead of within graph tile |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The MenuList is now rendered via Portal at the document body level, so the test helper needs to find menu items globally rather than inside the axis menu parent element. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
06ae17f to
d9ac133
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Portal the axis attribute menu into .codap-container instead of body to prevent it from appearing on top of the tool shelf and CFM menus. Add z-index to ensure menu appears above tiles. Make menu scrollable with max height of min(50vh, 400px) to handle long attribute lists. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bfinzer
left a comment
There was a problem hiding this comment.
👍🏻LGTM
Nice use of portal and bringing about scrolling!
[CODAP-1048] Impossible to choose attribute from a graph axis menu when list is very long
[CODAP-503] Graph Attribute Menu clipped by window problem
Summary
.codap-containerlevel, allowing Popper to properly calculate viewport boundaries for positioningplacement="auto"to let Popper choose the optimal menu position based on available space.codap-containerinstead ofbodyto prevent it from appearing on top of the tool shelf and CFM menusTest plan
🤖 Generated with Claude Code