[openstreetmap/openstreetmap-website] Lazy loading relation members (PR #6326)

mmd notifications at github.com
Fri Aug 15 19:31:49 UTC 2025


This PR introduces async loading of relation members, which is the main reason for large relations to take quite some time to load and display.

Current process:
1. Navigate to relation -> Rails renders tags, member list, returns final result to browser. Until then, a blank screen is shown.
2. Browser fetches full relation details, renders map

New process:
1. Navigate to relation -> render tags only. This step is expected to return results much quicker to the browser
2. Browser requests relation member list in separate query. Turbo updates DOM once finished.
3. Concurrent to step 2, browser requests full relation detail and starts rendering the map.

For large member lists, we're hiding the list by default anyway, so that the user doesn't notice the DOM update.  If relation member loading takes longer, a spinner is shown when expanding the member list.


You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/6326

-- Commit Summary --

  * Lazy loading relation members

-- File Changes --

    M app/abilities/ability.rb (2)
    M app/controllers/old_relations_controller.rb (2)
    A app/controllers/relation_members_controller.rb (11)
    M app/controllers/relations_controller.rb (2)
    M app/views/browse/_relation.html.erb (21)
    M app/views/browse/_relation_member.html.erb (2)
    A app/views/browse/_relation_member_frame.html.erb (5)
    M config/routes.rb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/6326.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6326.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6326
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6326 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250815/f47882e1/attachment.htm>


More information about the rails-dev mailing list