No GUI activity indication if HTMX rendering is enabled #9498

Closed
opened 2025-12-29 20:50:40 +01:00 by adam · 7 comments
Owner

Originally created by @peteeckel on GitHub (Apr 18, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0-beta1

Python Version

3.11

Steps to Reproduce

  1. Enable "HTMX Rendering" in the user preferences
  2. Restart NetBox
  3. Click on any navigation item in the sidebar

Expected Behavior

The display in the main view panel changes immediately. If that isn't possible (as is currently the case because of the extremely long schema load times after restart that are probably caused by a strawberry-django bug, see Art's comment in #15520), at least there should be some indication that something is happening in the background.

Observed Behavior

Nothing whatsoever happens for a long time, then the UI is updated.

The user does not have any indication that the mouse click has been accepted, which is no good UX. For long-running background activity there should at least be some kind of indication that there is something happening in the background.

This is not directly linked to the strawberry-django issue, it's just a good way to reproduce it.

Originally created by @peteeckel on GitHub (Apr 18, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0-beta1 ### Python Version 3.11 ### Steps to Reproduce 1. Enable "HTMX Rendering" in the user preferences 2. Restart NetBox 3. Click on any navigation item in the sidebar ### Expected Behavior The display in the main view panel changes immediately. If that isn't possible (as is currently the case because of the extremely long schema load times after restart that are probably caused by a `strawberry-django` bug, see Art's comment in #15520), at least there should be some indication that something is happening in the background. ### Observed Behavior Nothing whatsoever happens for a long time, then the UI is updated. The user does not have any indication that the mouse click has been accepted, which is no good UX. For long-running background activity there should at least be some kind of indication that there is something happening in the background. This is not directly linked to the `strawberry-django` issue, it's just a good way to reproduce it.
adam closed this issue 2025-12-29 20:50:40 +01:00
Author
Owner

@arthanson commented on GitHub (Apr 18, 2024):

Actually after discussion, this can remain a bug - really a global spinner / activity indicator for HTMX requests. However, I don't think the restart NetBox case is valid as it is actually not running then (it is trying to start up) so it can't do anything until it actually starts.

@arthanson commented on GitHub (Apr 18, 2024): Actually after discussion, this can remain a bug - really a global spinner / activity indicator for HTMX requests. However, I don't think the restart NetBox case is valid as it is actually not running then (it is trying to start up) so it can't do anything until it actually starts.
Author
Owner

@peteeckel commented on GitHub (Apr 19, 2024):

However, I don't think the restart NetBox case is valid as it is actually not running then (it is trying to start up) so it can't do anything until it actually starts.

Fair point. The problem is that with a clean out of the box install it might be difficult to reproduce ... I'll try to find a simple way to create an UI delay where the backend actually does something.

@peteeckel commented on GitHub (Apr 19, 2024): > However, I don't think the restart NetBox case is valid as it is actually not running then (it is trying to start up) so it can't do anything until it actually starts. Fair point. The problem is that with a clean out of the box install it might be difficult to reproduce ... I'll try to find a simple way to create an UI delay where the backend actually does something.
Author
Owner

@peteeckel commented on GitHub (Apr 19, 2024):

Steps to reproduce:

  1. Create /opt/netbox/netbox/validators/delay.py with the following content:
import time

from extras.validators import CustomValidator

class Delay(CustomValidator):

    def validate(self, instance):
        time.sleep(10)
  1. Configure this code as a custom validator for ipam.ipaddress:
from validators.delay import Delay

CUSTOM_VALIDATORS = {
    "ipam.ipaddress": [
        Delay(),
    ]
}
  1. Restart NetBox
  2. Enable HTMX navigation for the current user
  3. Create a new IP address object and click on Create

Same results as above.

@peteeckel commented on GitHub (Apr 19, 2024): Steps to reproduce: 1. Create `/opt/netbox/netbox/validators/delay.py` with the following content: ```python import time from extras.validators import CustomValidator class Delay(CustomValidator): def validate(self, instance): time.sleep(10) ``` 2. Configure this code as a custom validator for `ipam.ipaddress`: ```python from validators.delay import Delay CUSTOM_VALIDATORS = { "ipam.ipaddress": [ Delay(), ] } ``` 3. Restart NetBox 4. Enable HTMX navigation for the current user 5. Create a new IP address object and click on `Create` Same results as above.
Author
Owner

@jeremystretch commented on GitHub (Apr 19, 2024):

We should be able to implement a "spinner" easily using hx-indicator.

@jeremystretch commented on GitHub (Apr 19, 2024): We should be able to implement a "spinner" easily using [`hx-indicator`](https://htmx.org/attributes/hx-indicator/).
Author
Owner

@abhi1693 commented on GitHub (May 15, 2024):

I tried but I'm not yet familiar with htmx. If I can come up with a solution at a later date, I'll pick this up again until then another developer can try this

@abhi1693 commented on GitHub (May 15, 2024): I tried but I'm not yet familiar with htmx. If I can come up with a solution at a later date, I'll pick this up again until then another developer can try this
Author
Owner

@github-actions[bot] commented on GitHub (Aug 14, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Aug 14, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Sep 13, 2024):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Sep 13, 2024): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9498