[Agile-224] lazy load backlog work package cards#23962
Draft
ulferts wants to merge 8 commits into
Draft
Conversation
00ab736 to
7ba0d7f
Compare
The skeleton is still not shown but issuing .reload() on the frame replaces any frontend added dom like the menu with the already cached version of the card. This prevents the menu being stale.
6a5a227 to
03ceb70
Compare
6 tasks
| instance_version = connection.quote(OpenProject::VERSION.to_s) | ||
|
|
||
| left_outer_joins(:status, :assigned_to, :type, :priority) | ||
| .joins("LEFT JOIN (#{visible_parent(user)}) card_hash_parents ON card_hash_parents.id = work_packages.parent_id") |
Contributor
Author
There was a problem hiding this comment.
user is passed into WorkPackages.visible only
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.
Ticket
https://community.openproject.org/wp/AGILE-224
What are you trying to accomplish?
Load the work package cards displayed on the backlogs and sprints page lazily and individually via turbo-frames. But also cache them in the frontend so that the hit on loading the cards one by one is in fact only happening initially. The cache is a checksum calculated in the database that includes all the records displayed on the card. The checksum becomes part of the turbo-frame's src. Changes to the checksum in the src represent changes to the work package card busting the cache. When the page needs to be reloaded, e.g. after moving a work package or after changing it in the split screen, only the structure of the page is actually reloaded. When reloading the page, a small JS prevents reshowing the skeletons. Almost all of the work package cards will not need to be reloaded, as signaled by their checksum. Only the dragged or updated work package will actually be loaded from the server.
This PR works nicely together with #23885 which removed the page's state (e.g.
all=true) from the card, especially in the menu.The pattern is extracted from #23308 which includes even more description.
TODO
Out of scope
lielement inside the newly added turbo-frame. This would reduce the number of controllers initialized at load time.content-body'sturbo-frame. The page is still loaded first mostly empty only to then have the turbo frame load the actual backlogs and sprints information.Merge checklist