Skip to content

[#72928] Fix backlogs to use Turbo morphing (dev follow-up)#22290

Merged
myabc merged 2 commits intodevfrom
bug/72928-backlogs-not-using-turbo-morphing-dev
Mar 11, 2026
Merged

[#72928] Fix backlogs to use Turbo morphing (dev follow-up)#22290
myabc merged 2 commits intodevfrom
bug/72928-backlogs-not-using-turbo-morphing-dev

Conversation

@myabc
Copy link
Copy Markdown
Contributor

@myabc myabc commented Mar 10, 2026

Ticket

https://community.openproject.org/wp/72928

What are you trying to accomplish?

Port the #72928 Turbo morphing follow-up to the newer sprint-based backlogs components on dev.

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 #72928 change in the new sprint-based implementation in two parts:

  1. Use Turbo morphing when update_agile_sprint refreshes the sprint header.
  2. Add deterministic ids to the sprint header and sprint menu elements that need to survive morphing.

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

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

Tested with:

source /opt/homebrew/opt/chruby/share/chruby/chruby.sh
chruby ruby-3.4.7
bundle exec rspec \
  modules/backlogs/spec/components/backlogs/sprint_component_spec.rb \
  modules/backlogs/spec/components/backlogs/sprint_header_component_spec.rb \
  modules/backlogs/spec/components/backlogs/sprint_menu_component_spec.rb \
  modules/backlogs/spec/controllers/rb_sprints_controller_spec.rb \
  modules/backlogs/spec/requests/rb_master_backlogs_spec.rb \
  modules/backlogs/spec/components/backlogs/backlog_component_spec.rb \
  modules/backlogs/spec/components/backlogs/backlog_menu_component_spec.rb \
  modules/backlogs/spec/components/backlogs/story_menu_component_spec.rb

Result: 93 examples, 0 failures

myabc added 2 commits March 10, 2026 13:59
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.
@myabc myabc changed the title [#72928] Fix backlogs to use Turbo morphing (dev update) [#72928] Fix backlogs to use Turbo morphing (dev follow-up) Mar 10, 2026
@myabc myabc added this to the 17.3.x milestone Mar 10, 2026
@myabc myabc marked this pull request as ready for review March 10, 2026 17:04
@myabc myabc added bugfix javascript Pull requests that update Javascript code ruby Pull requests that update Ruby code needs review labels Mar 10, 2026
Copilot AI review requested due to automatic review settings March 10, 2026 17:04
@github-actions
Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

2 similar comments
@github-actions
Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@github-actions
Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@myabc myabc requested a review from a team March 10, 2026 17:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 EinLama self-requested a review March 11, 2026 09:26
Copy link
Copy Markdown
Contributor

@EinLama EinLama left a comment

Choose a reason for hiding this comment

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

Looks good and works, I could not find any issues :shipit:

@myabc myabc merged commit f7e1714 into dev Mar 11, 2026
27 of 28 checks passed
@myabc myabc deleted the bug/72928-backlogs-not-using-turbo-morphing-dev branch March 11, 2026 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix javascript Pull requests that update Javascript code needs review ruby Pull requests that update Ruby code

Development

Successfully merging this pull request may close these issues.

3 participants