Skip to content

Load filtered device history with htmx - #3663

Merged
Simrayz merged 2 commits into
masterfrom
chore/load-device-history-results-with-htmx
Dec 9, 2025
Merged

Simrayz merged 2 commits into
masterfrom
chore/load-device-history-results-with-htmx

Conversation

@Simrayz

@Simrayz Simrayz commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

Scope and purpose

I noticed that the entire device history page is refreshed when changing filters. This is both unnecessary and causes a brief "flicker" after clicking "filter".

This PR loads filtered results with HTMX, and reuses the existing devicehistory_view by returning a partial for HTMX requests.

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 self-assigned this Dec 3, 2025
@Simrayz Simrayz added the htmx label Dec 3, 2025
@Simrayz
Simrayz force-pushed the chore/load-device-history-results-with-htmx branch from c059843 to 9ab023b Compare December 3, 2025 14:24
@Simrayz
Simrayz requested a review from a team December 3, 2025 14:36
@github-actions

github-actions Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Test results

    27 files      27 suites   45m 18s ⏱️
 2 704 tests  2 704 ✅ 0 💤 0 ❌
20 022 runs  20 022 ✅ 0 💤 0 ❌

Results for commit a0464d9.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.02%. Comparing base (cf1861e) to head (dae3d23).
⚠️ Report is 371 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3663   +/-   ##
=======================================
  Coverage   63.02%   63.02%           
=======================================
  Files         612      612           
  Lines       45226    45228    +2     
  Branches       43       43           
=======================================
+ Hits        28503    28505    +2     
  Misses      16713    16713           
  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 force-pushed the chore/load-device-history-results-with-htmx branch from ceb0f40 to a0464d9 Compare December 5, 2025 10:09

@johannaengland johannaengland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beautiful

@Simrayz
Simrayz force-pushed the chore/load-device-history-results-with-htmx branch from a0464d9 to 6709a3f Compare December 9, 2025 17:30
@Simrayz
Simrayz force-pushed the chore/load-device-history-results-with-htmx branch from 6709a3f to dae3d23 Compare December 9, 2025 17:47
@Simrayz
Simrayz merged commit cc16b7f into master Dec 9, 2025
12 of 13 checks passed
@Simrayz
Simrayz deleted the chore/load-device-history-results-with-htmx branch December 9, 2025 17:47
@sonarqubecloud

sonarqubecloud Bot commented Dec 9, 2025

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants