Skip to content

[DREAM-974] Show the table row menu as a Primer ActionMenu - #26571

Draft
myabc wants to merge 2 commits into
feature/dream-974-move-actionsfrom
feature/dream-974-primer-row-menu
Draft

myabc wants to merge 2 commits into
feature/dream-974-move-actionsfrom
feature/dream-974-primer-row-menu

Conversation

@myabc

@myabc myabc commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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 the ActionList markup from the existing OpContextMenuItem data, the <action-menu> element from Primer ViewComponents supplies keyboard handling, focus zones and submenu toggling, and the ContextualActionMenu presenter 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 OpContextMenuItem as the data contract and adds children and octicon, so permitted actions, plugin hooks and bulk menus are untouched; only the table's handlers switch from OPContextMenuService to the new OpActionMenuService. 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.html mirrors Primer::Alpha::ActionMenu with SubMenuItem; compare against a rails runner render if in doubt.
  • op-action-menu.service.ts#close is where the focus-return ordering lives.
  • Try by hand: right-click a row, Shift+F10 on a cell, ArrowRight into "Move", ArrowLeft and Escape back, Escape again.

AI involvement

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

myabc added 2 commits November 3, 2026 02:00
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
@myabc
myabc added this pull request to stack #26617 November 4, 2026 00:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant