fix nav menu dropdown clipping#9469
Conversation
allow output area overflow on hover/focus to prevent clipping, and raise z-index to 50 for better stacking
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/css/app/Cell.css">
<violation number="1" location="frontend/src/css/app/Cell.css:100">
P2: `overflow: visible !important` will override the table-specific `overflow: hidden` (line ~109) on hover/focus, since `!important` trumps specificity. Consider scoping the rule to exclude the table case, e.g. using `:not(:has(> .output:only-child > marimo-ui-element:only-child > marimo-table))`, or adding a matching `!important` to the table rule to preserve its override.</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as User
participant Nav as NavigationMenu
participant Cell as Notebook Cell
participant Output as Output Area
participant Stack as Z-Index Context
Note over User,Stack: Nav Menu Dropdown Display Flow
User->>Nav: Hover/focus nav menu trigger
Nav->>Nav: Check orientation & visibility
Nav->>Stack: Set z-index to 50
Stack-->>Nav: Elevated stacking
Note over Nav,Cell: Menu dropdown now stacks above cell
User->>Cell: Scroll or interact with notebook
Cell->>Cell: hover output area
alt Output area has content overflow
Cell->>Output: NEW: overflow: visible (on hover/focus-within)
Output->>Output: Display full content without clipping
Output-->>Cell: Content visible
else Output area no overflow
Output->>Output: Normal overflow behavior
end
Note over Cell,Output: Previously: overflow was hidden/clipped
Cell->>Stack: Maintain default z-index context
Stack-->>Nav: Nav dropdown remains on top (z=50)
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
use portaled Popover components for horizontal menus in NavigationMenuPlugin. this prevents clipping while maintaining hover behavior and left-alignment
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
3 issues found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/css/app/Cell.css">
<violation number="1">
P2: Removing the hover/focus overflow override regresses interactive outputs by keeping `.output-area` clipped (`overflow: auto`) even when menus/popovers need to extend outside the cell.</violation>
</file>
<file name="frontend/src/plugins/layout/NavigationMenuPlugin.tsx">
<violation number="1" location="frontend/src/plugins/layout/NavigationMenuPlugin.tsx:135">
P2: Controlled popover ignores open requests, so the dropdown cannot open via click/keyboard/touch and becomes hover-only.</violation>
</file>
<file name="frontend/src/components/ui/navigation.tsx">
<violation number="1">
P2: Lowering the navigation menu root from z-50 to z-10 regresses the dropdown’s stacking order and can put it behind surrounding UI, undermining the clipping fix.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
ensures nav menu can be opened via click and keyboard
|
@mscolnick thanks for the suggestion, applied it! quick question: this dropdown currently opens on hover, while most other buttons in the ui open (and close) dropdowns on click. should i align this behavior? it's outside this commit's scope but we're already in these files |
|
i think this changes more than i'd expect. ideally there is a |
use portaled nav dropdowns to resolve clipping in notebook cells while supporting hover, click, and keyboard interactions
closes #7167