[#72928] Fix backlogs to use Turbo morphing (dev follow-up)#22290
Conversation
Update agile sprint header refreshes to use Turbo morphing so DOM state is preserved more reliably when sprint details are changed. https://community.openproject.org/wp/72928
Assign deterministic ids to sprint headers and sprint menu elements so Turbo morphing can reconcile the old and new DOM reliably.
dev update)|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
2 similar comments
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
There was a problem hiding this comment.
Pull request overview
Ports the Turbo morphing follow-up from #72928 to the newer sprint-based Backlogs components by ensuring the sprint header refresh uses method: :morph and by adding deterministic DOM ids needed for reliable morph reconciliation.
Changes:
- Use Turbo Stream morphing when refreshing the sprint header after
update_agile_sprint. - Add stable, deterministic ids for sprint header and sprint action menu elements (menu trigger/list/items).
- Extend/adjust component specs and controller spec to assert morphing + stable ids.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| modules/backlogs/app/controllers/rb_sprints_controller.rb | Sends the sprint header Turbo Stream update with method: :morph. |
| modules/backlogs/app/components/backlogs/sprint_component.html.erb | Adds a stable id to the rendered sprint BorderBox header. |
| modules/backlogs/app/components/backlogs/sprint_menu_component.rb | Introduces **system_arguments and sets a deterministic menu_id (and related args) for stable ActionMenu ids. |
| modules/backlogs/app/components/backlogs/sprint_menu_component.html.erb | Uses forwarded system arguments for ActionMenu and assigns stable ids to relevant menu items. |
| modules/backlogs/spec/controllers/rb_sprints_controller_spec.rb | Verifies the sprint header Turbo Stream update includes method="morph". |
| modules/backlogs/spec/components/backlogs/sprint_component_spec.rb | Asserts stable id on sprint header container. |
| modules/backlogs/spec/components/backlogs/sprint_header_component_spec.rb | Asserts stable id on sprint menu trigger as rendered by the header. |
| modules/backlogs/spec/components/backlogs/sprint_menu_component_spec.rb | Asserts stable ids on ActionMenu trigger/list and the Stories/Tasks item. |
You can also share your feedback on Copilot code review. Take the survey.
EinLama
left a comment
There was a problem hiding this comment.
Looks good and works, I could not find any issues ![]()
Ticket
https://community.openproject.org/wp/72928
What are you trying to accomplish?
Port the
#72928Turbo morphing follow-up to the newer sprint-based backlogs components ondev.This updates the agile sprint header Turbo Stream refresh to use
method: :morph, and adds stable ids to the new sprint header and sprint menu elements so Turbo can reconcile the DOM reliably.What approach did you choose and why?
I mirrored the original
#72928change in the new sprint-based implementation in two parts:update_agile_sprintrefreshes the sprint header.I kept the stable-id tests intentionally narrow. The component specs verify representative stable ids that matter for morphing without asserting every generated menu item id, which would make the suite more brittle than useful.
I did not recreate the page-level request-spec work from the original PR because that coverage already exists on
dev.Merge checklist
Tested with:
Result:
93 examples, 0 failures