Restore context menus for collapsed breadcrumbs#26140
Restore context menus for collapsed breadcrumbs#26140raunak-rpm wants to merge 2 commits intojenkinsci:masterfrom
Conversation
When breadcrumbs overflow and are collapsed into the overflow menu, they were losing their context menu functionality. The overflow menu was only creating simple link items without preserving the dropdown indicators that provide access to contextMenu and childrenContextMenu. This fix detects breadcrumb items that have dropdown-indicator elements and attaches nested tippy dropdowns to the corresponding overflow menu items. The context menu data is fetched on hover, matching the behavior of non-collapsed breadcrumbs. The implementation: - Checks each collapsed breadcrumb item for .dropdown-indicator - Extracts data-model, data-children, and data-href attributes - Attaches a submenu dropdown using Utils.generateDropdown - Fetches and renders context menu items with proper action handling - Preserves all menu item types (HEADER, SEPARATOR, actions, navigation) Fixes jenkinsci#16764
|
Yay, your first pull request towards Jenkins core was created successfully! Thank you so much! |
There was a problem hiding this comment.
Pull request overview
This PR restores context menu functionality for breadcrumb items that overflow into the "..." menu when the viewport is narrow. The fix implements lazy-loading dropdown menus that fetch context menu data on hover, following the same pattern used in jumplists.js.
Changes:
- Added two helper functions (
mapContextMenuItemsandcreateContextMenuCallback) that mirror the pattern in jumplists.js for transforming server response items and creating lazy-loading dropdown callbacks - Enhanced the overflow menu generation to detect breadcrumb items with dropdown indicators and attach nested tippy dropdowns that preserve the original context menu functionality
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Happy to hear others thoughts, but I'm not sure if this is needed. I think the scenario where a desktop user has collapsed breadcrumbs and wants to access their submenu is slim - I also think that breadcrumbs having submenus in the first place is a poor UX, and wouldn't want to extend it for this. |
|
I plan to close this pull request after a 24 hour waiting period because it is failing to compile on ci.jenkins.io and the pull request submitter has not taken action to correct the mistake. I agree with @janfaracik that I don't think this is needed. That offers yet another reason to close the pull request. @raunak-rpm if you intend for this to be reviewed further, you need to fix the issue that is causing the build to fail on ci.jenkins.io. |
|
Closing as abandoned by the submitter. |
Fixes #16764
When breadcrumbs overflow into the "..." menu due to narrow viewport width, the collapsed breadcrumb items lose their context menu (dropdown) functionality. This is a regression that affects navigation usability.
Root Cause
The
breadcrumbs-overflow.jsmodule was creating simple link items for the overflow menu without preserving the.dropdown-indicatorelement data that enables context menus on hover. The original breadcrumb items containdata-model,data-children, anddata-hrefattributes that configure the dropdown behavior, but these were being discarded during the overflow menu generation.Solution
This fix adds two helper functions following the same pattern used in
jumplists.js:mapContextMenuItems(items)- Transforms server response items to the dropdown item format expected byUtils.generateDropdownItems()createContextMenuCallback(hasModel, hasChildren, href)- Creates a lazy-loading callback that fetches context menu data on hover, supporting both "Actions" (contextMenu) and "Navigation" (childrenContextMenu) sectionsAfter generating the overflow menu items, the fix iterates through collapsed breadcrumb items, detects those with
.dropdown-indicatorelements, extracts the relevant data attributes, and attaches nested tippy dropdowns that fetch context menu data on mouseenter.Testing done
mvn -am -pl war,bom -Pquick-build clean installmvn -pl war jetty:runProposed changelog entries
Proposed changelog category
/label regression-fix, web-ui
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@timja @janfaracik