This repository was archived by the owner on Aug 5, 2026. It is now read-only.
Improve Context Menu Mobile Layout - #4993
Open
Yanko Mirov (tranculent) wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR refines the Context Menu layout/styling by introducing a sticky header + scrollable list pattern, adding a mobile back button, and updating item icon placement.
Changes:
- Added
StickyHeader,ScrollableList, andBackButtonbuilding blocks for long context menus. - Updated
BpkContextMenu.ItemAPI to use a left-sideiconprop instead ofendIcon. - Adjusted SCSS to support the new layout, including responsive max height and scoped scrolling.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenuStickyHeader.tsx | Adds a wrapper component to anchor header content at the top of the menu surface. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenuScrollableList.tsx | Adds a wrapper component to scope scroll behavior to just the list region. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenuItem.tsx | Changes item icon API/placement (left-side icon) and updates markup accordingly. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenuBackButton.tsx | Adds a mobile-only back button that closes the nearest menu context. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenu.tsx | Exposes the new subcomponents on the BpkContextMenu namespace. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenu.stories.tsx | Updates stories for the new icon prop and demonstrates the sticky/scrollable layout. |
| packages/backpack-web/src/bpk-component-context-menu/src/BpkContextMenu.module.scss | Implements responsive sizing, sticky header styling, local scrollbar, and back button styles. |
| packages/backpack-web/src/bpk-component-context-menu/index.ts | Exports types for the newly added components. |
| packages/backpack-web/src/bpk-component-context-menu/README.md | Updates docs for icon and documents new StickyHeader/BackButton APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Style improvements and new compound parts for
BpkContextMenu, building on the initial component shipped in #4913.Changes
New compound parts
BpkContextMenu.StickyHeaderBpkContextMenu.BackButtonBpkContextMenu.ScrollableListBpkContextMenu.PanelGroupBpkContextMenu.PanelBpkContextMenu.SaveTriggerSub-menu navigation (mobile/desktop split)
BpkContextMenu.TriggerItemgainspanelIdanddesktopFlyoutpropsTriggerItemwithpanelIdreplaces the current card content with the targetPanel(drill-down, no horizontal scroll)TriggerItemwithdesktopFlyoutinternally manages a nestedMenu.Rootand opens the flyout on hover — existing side-by-side behaviour preservedVisual / CSS fixes
BpkContextMenu.Itemicon moved from right to left (endIcon→icon)max-block-size: 7.7 items on mobile (back button + actions + 4.5 visible trips), 8.7 on desktop — both use.7fractional for a consistent scroll indicatorScrollableListusesMutationObserverto keep the keyboard-highlighted item in view when arrow-navigatingbpk-context-menu-item-hover-guardkeyframe animationpointer-events: noneon[data-state='closed']prevents the invisible card blocking clicks during the fade-outAccessibility
BackButtonand panel-modeTriggerItemwrapped inMenu.Itemso Ark includes them in arrow-key navigationdata-highlightedstyle applied toBackButtonfor keyboard visibilityoutline-offset: 0on focus rings prevents the bottom edge bleeding out as a visible separator lineConsumer pattern