Improve dropdowns performance with lazy
What does this MR do?
Related to #321845 (closed)
Sets the artifacts
and manual
dropdowns in the pipelines page to lazy
.
Why?
Depending on the pipeline, we will render up to 2 dropdowns for artifacts and manual actions respectively, in the gitlab
project pipelines render ~15 of artifacts and many more elements when the pipeline has been stopped:
pipelines at GitLab |
---|
![]() |
This renders potentially hundreds of elements in the page that are never seen by users, until they open the dropdowns.
From https://bootstrap-vue.org/docs/components/dropdown:
By default, renders the menu contents in the DOM even when the menu is not shown. When there are a large number of dropdowns rendered on the same page, performance could be impacted due to larger overall memory utilization. You can instruct to render the menu contents only when it is shown by setting the lazy prop to true.
Screenshots (strongly suggested)
Pipeline page works the same way:
In a small test project with artifacts, the page contains fewer elements with lazy enabled:
before (959 elements) | after (946 / 952 elements ) |
---|---|
![]() |
![]() |
Bonus
The position of the artifacts dropdown has been improved:
before | after |
---|---|
![]() |
![]() |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team