Skip to content

Move project menu list into an async call, avoiding the same repeated calls per project - #23656

Merged
ulferts merged 5 commits into
devfrom
chore/async-project-menu
Jun 15, 2026
Merged

Move project menu list into an async call, avoiding the same repeated calls per project#23656
ulferts merged 5 commits into
devfrom
chore/async-project-menu

Conversation

@oliverguenther

@oliverguenther oliverguenther commented Jun 10, 2026

Copy link
Copy Markdown
Member

Ticket: https://community.openproject.org/wp/OP-19536

The action menu of the project list is currently rendered inline for every project eagerly, which has a significant chunk of render time, especially since a lot of permission checks are involved.

For non-logged-in users, this render time is completely useless, which is why we can also shortcut the menu entirely.

Edit by Attila:
The RowComponent is inherited in various places which still define inline menu items. The implementation is updated to handle both inline menu items and a menu url provided.

@oliverguenther
oliverguenther requested a review from a team June 10, 2026 08:59
Comment thread app/components/projects/row_actions_component.html.erb Dismissed
Comment thread app/components/projects/row_actions_component.html.erb Dismissed
Comment thread app/components/projects/row_actions_component.html.erb Dismissed
Comment thread app/components/projects/row_actions_component.html.erb Dismissed
@oliverguenther
oliverguenther force-pushed the chore/async-project-menu branch from 5f91854 to aa27c6d Compare June 10, 2026 09:15
@oliverguenther
oliverguenther force-pushed the chore/async-project-menu branch from ce86fc2 to ca6fbe9 Compare June 10, 2026 09:24
@dombesz
dombesz requested review from dombesz and removed request for a team June 10, 2026 12:29

@dombesz dombesz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Feel free to merge once CI is green.

dombesz added 2 commits June 11, 2026 20:20
Project menus can be accessed by:
1. Users with read permission if the project is active.
2. Admins only if the project is archived.

Since there is no dedicated authorization method for such case, a new
helper method require_admin_or_active_project is added.
…ed action menus too.

The component is subclassed in various places that do not implement the
lazy row menu, so it still has to support 2 operational modes.
@dombesz
dombesz force-pushed the chore/async-project-menu branch from 89d03d5 to 0f6ed76 Compare June 12, 2026 11:41

@ulferts ulferts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spotted two things:

  • The action is called menu. Initially I thought this referred to the menu with in the project when in it is rather about the row menu. Something like list_row_menu might prevent that and would be easy to change to.
  • When opening the now asynchronous menus of projects at the bottom of the page, the behaviour is not always correct. It oftentimes continues to open to the bottom even if there isn't enough space. This was different before, with the synchronous menu.

I guess the former can easily be changed whereas the latter requires a bug report as this is probably behaviour that exists in the component itself.

@dombesz
dombesz force-pushed the chore/async-project-menu branch from 04bc275 to d12f683 Compare June 12, 2026 15:50
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/wikis/spec/features/admin/internal_provider_spec.rb[1:1]

@dombesz
dombesz requested a review from ulferts June 12, 2026 16:46
@dombesz
dombesz force-pushed the chore/async-project-menu branch from 181cfe5 to d12f683 Compare June 12, 2026 16:51
@dombesz

dombesz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Thanks @ulferts , I addressed the first issue in this PR as it is relevant. The second issue will be addressed in the openproject-primer_view_components gem. opf/primer_view_components#478

@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/wikis/spec/features/admin/internal_provider_spec.rb[1:1]

@ulferts
ulferts merged commit 414075a into dev Jun 15, 2026
28 checks passed
@ulferts
ulferts deleted the chore/async-project-menu branch June 15, 2026 07:05
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants