Skip to content

Render PortAdmin feedback modal from pre-loaded template#3772

Merged
Simrayz merged 1 commit intomasterfrom
fix/portadmin-edit-feedback-is-slow
Feb 11, 2026
Merged

Render PortAdmin feedback modal from pre-loaded template#3772
Simrayz merged 1 commit intomasterfrom
fix/portadmin-edit-feedback-is-slow

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Feb 10, 2026

Fixes #3772

Scope and purpose

An administrator from the nav-ref group reported and demonstrated a bug in Portadmin where the feedback modal does not open before a long delay. I was not able to reproduce their bug, but the only identified probable culprit is the network call to load the initial modal with HTMX.

This PR changes the feedback modal to load from a pre-rendered template, which is cloned and destroyed when the modal is closed. This should show the modal immediately without requiring a round-trip to the server first, while using the server-rendered modal template.

Since we simplified the modal loading, I also removed the render modal view and related tests.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • Wrote the commit message so that the first line continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • Based this pull request on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@Simrayz Simrayz force-pushed the fix/portadmin-edit-feedback-is-slow branch from 46794f8 to 655a691 Compare February 10, 2026 14:17
@Simrayz Simrayz requested a review from a team February 10, 2026 14:17
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test results

    21 files      21 suites   24m 22s ⏱️
 2 822 tests  2 822 ✅ 0 💤 0 ❌
15 780 runs  15 780 ✅ 0 💤 0 ❌

Results for commit 655a691.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.14%. Comparing base (3babe1c) to head (655a691).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3772      +/-   ##
==========================================
- Coverage   63.14%   63.14%   -0.01%     
==========================================
  Files         616      616              
  Lines       45545    45542       -3     
  Branches       43       43              
==========================================
- Hits        28761    28758       -3     
  Misses      16774    16774              
  Partials       10       10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Simrayz Simrayz marked this pull request as ready for review February 10, 2026 14:37
Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

An administrator from the nav-ref group reported and demonstrated a bug in Portadmin where the feedback modal does not open before a long delay. I was not able to reproduce their bug, but the only identified probable culprit is the network call to load the initial modal with HTMX.

Seems like an apt analysis. When mr. Nesland demoed it to us, I received multiple tracebacks from their NAV installation about netconf errors in the backend. If the original depended on a non-failing HTMX response from the backend before displaying anything, then that would certainly be an issue :)

@Simrayz
Copy link
Copy Markdown
Contributor Author

Simrayz commented Feb 11, 2026

An administrator from the nav-ref group reported and demonstrated a bug in Portadmin where the feedback modal does not open before a long delay. I was not able to reproduce their bug, but the only identified probable culprit is the network call to load the initial modal with HTMX.

Seems like an apt analysis. When mr. Nesland demoed it to us, I received multiple tracebacks from their NAV installation about netconf errors in the backend. If the original depended on a non-failing HTMX response from the backend before displaying anything, then that would certainly be an issue :)

Sounds like this will certainly fix it then yeah. The normal modal-flow in NAV is to load it with a htmx endpoint, which of course requires a response before rendering the modal (by appending to the body).

@Simrayz Simrayz merged commit 53badf5 into master Feb 11, 2026
19 checks passed
@Simrayz Simrayz deleted the fix/portadmin-edit-feedback-is-slow branch February 11, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants