Rack Elevation Lazy Loading #11205

Closed
opened 2025-12-29 21:41:55 +01:00 by adam · 4 comments
Owner

Originally created by @tbotnz on GitHub (May 21, 2025).

Originally assigned to: @jnovinger, @tbotnz on GitHub.

NetBox version

v4.3.1

Feature type

New functionality

Proposed functionality

add lazy loading to rack elevations

Use case

current solution does not scale

Database changes

No response

External dependencies

No response

Originally created by @tbotnz on GitHub (May 21, 2025). Originally assigned to: @jnovinger, @tbotnz on GitHub. ### NetBox version v4.3.1 ### Feature type New functionality ### Proposed functionality add lazy loading to rack elevations ### Use case current solution does not scale ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featurecomplexity: medium labels 2025-12-29 21:41:55 +01:00
adam closed this issue 2025-12-29 21:41:55 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 22, 2025):

add lazy loading to rack elevations

Please add more detail about your proposed implementation.

current solution does not scale

The list is paginated and will load only a fixed number of racks per request regardless of how many have been created.

@jeremystretch commented on GitHub (May 22, 2025): > add lazy loading to rack elevations Please add more detail about your proposed implementation. > current solution does not scale The list is paginated and will load only a fixed number of racks per request regardless of how many have been created.
Author
Owner

@tbotnz commented on GitHub (May 22, 2025):

@jeremystretch the pagination options can go up to 100, 1000 and users will happily pick it. This leads to requests eventually failing and unhappy users. Even with the pagination there is still 1 additional request for every rack on the page due to the use of the <object> tag, so 100 racks = 100 http requests

My implementation addresses the issue by only loading the racks as they are intersecting with the viewport, meaning only the racks on the screen are loaded (even if there are another 100+ on the page), the rest will load progressively as they are scrolled into the viewport. This means that there is a request per rack but only for the racks shown in the viewport ( as opposed to trying to load every rack on the page )

@tbotnz commented on GitHub (May 22, 2025): @jeremystretch the pagination options can go up to 100, 1000 and users will happily pick it. This leads to requests eventually failing and unhappy users. Even with the pagination there is still 1 additional request for every rack on the page due to the use of the `<object>` tag, so 100 racks = 100 http requests My implementation addresses the issue by only loading the racks as they are intersecting with the viewport, meaning only the racks on the screen are loaded (even if there are another 100+ on the page), the rest will load progressively as they are scrolled into the viewport. This means that there is a request per rack but only for the racks shown in the viewport ( as opposed to trying to load every rack on the page )
Author
Owner

@arthanson commented on GitHub (May 29, 2025):

It looks like you have a PR in for this so assigning to you @tbotnz

@arthanson commented on GitHub (May 29, 2025): It looks like you have a PR in for this so assigning to you @tbotnz
Author
Owner

@nobless commented on GitHub (Sep 10, 2025):

Image Image

This commit breaks UI;

@nobless commented on GitHub (Sep 10, 2025): <img width="1294" height="103" alt="Image" src="https://github.com/user-attachments/assets/88d1fd0e-0581-4e9c-8ecb-73adf6c95b1a" /> <img width="1540" height="935" alt="Image" src="https://github.com/user-attachments/assets/13ce47d6-48b3-42b2-b859-dd5a6f330080" /> This commit breaks UI;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11205