Repository navigation
Conversation
Renders the work package table's row context menu with the markup of Primer::Alpha::ActionMenu and lets the action-menu element from Primer ViewComponents supply keyboard handling, focus zones and submenus. The ContextualActionMenu presenter positions the menu at the pointer or under the focused cell and keeps it anchored while the table scrolls. Adds OpActionMenuComponent and OpActionMenuService next to the legacy op-context-menu, which the single and card menus keep using. The item contract gains `children` for submenus and `octicon` for Primer icons. The service removes the open popover on close instead of hiding it so neither the browser's focus restore nor the element's refocus of the invoker races the table's own focus return. Escape is handled at the document so a press before focus moved into the menu still closes it and still counts as owned by the menu. Scrolling no longer closes the menu; it follows its row like other Primer menus. Primer ViewComponents 0.95 closes the whole menu when a submenu closes with ArrowLeft or Escape; the component refocuses the submenu's item until opf/primer_view_components#547 ships. https://community.openproject.org/wp/DREAM-974
Replaces the flat "Move" group in the table row menu with a "Move" submenu holding the four move actions, matching the Backlogs card menu and SortableLists::MoveMenu, with the same octicons. Adds page object helpers for opening a submenu and choosing from it. https://community.openproject.org/wp/DREAM-974
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
This PR is stacked on #26569 (DREAM-974, move actions). Please review/merge that PR first.
Ticket
https://community.openproject.org/wp/DREAM-974
What are you trying to accomplish?
tl;dr for humans: The work package table's row menu now looks and behaves like every other Primer menu in OpenProject, and the four move actions sit under a "Move ▸" submenu instead of a flat group.
Renders the table row context menu as a Primer
ActionMenu: Angular emits theActionListmarkup from the existingOpContextMenuItemdata, the<action-menu>element from Primer ViewComponents supplies keyboard handling, focus zones and submenu toggling, and theContextualActionMenupresenter from AGILE-481 positions it at the pointer or under the focused cell. Nests the move actions from DREAM-974 under a "Move ▸" submenu, matching the Backlogs card menu.What approach did you choose and why?
Keeps
OpContextMenuItemas the data contract and addschildrenandocticon, so permitted actions, plugin hooks and bulk menus are untouched; only the table's handlers switch fromOPContextMenuServiceto the newOpActionMenuService. The single and card menus keep the old rendering for now.The service removes the open popover on close instead of hiding it, so the browser's focus restore and the element's own refocus of the invoker never fight the table's
returnFocusFromMenu. Escape is handled at the document so a press before focus moved into the menu, or a scripted one in specs, closes it and still counts as owned by the menu.Primer ViewComponents 0.95 closes the whole menu when a submenu closes with ArrowLeft or Escape; opf/primer_view_components#547 fixes that, and until the gem carries it the component refocuses the submenu's item itself.
Behaviour change: scrolling no longer closes the menu, it follows its row like other Primer menus.
Hints for dev review
op-action-menu.component.htmlmirrorsPrimer::Alpha::ActionMenuwithSubMenuItem; compare against arails runnerrender if in doubt.op-action-menu.service.ts#closeis where the focus-return ordering lives.AI involvement
Merge checklist