Skip to content

htmlreport: preserve filter state when navigating back/forward#7993

Merged
danmar merged 1 commit intocppcheck-opensource:mainfrom
rgetz:rgetz-fix-html-back
Dec 10, 2025
Merged

htmlreport: preserve filter state when navigating back/forward#7993
danmar merged 1 commit intocppcheck-opensource:mainfrom
rgetz:rgetz-fix-html-back

Conversation

@rgetz
Copy link
Copy Markdown
Contributor

@rgetz rgetz commented Nov 28, 2025

Currently, using browser back/forward buttons resets filtered issue lists, even though checkbox states persist. This is confusing and makes it hard to see the filtered results consistently.

Changes:

  • Added a reapplyFilters() function that reapplies ID, severity, classification, and tool filters based on the current checkbox states.
  • Hooked reapplyFilters() to the pageshow event to restore filtered classes when navigating with back/forward.

Tested on Chrome (144.0.7534.0 (Official Build) dev (64-bit))

Currently, using browser back/forward buttons resets filtered issue lists,
even though checkbox states persist. This is confusing and makes it hard to
see the filtered results consistently.

Changes:
- Added a `reapplyFilters()` function that reapplies ID, severity,
  classification, and tool filters based on the current checkbox states.
- Hooked `reapplyFilters()` to the `pageshow` event to restore filtered
  classes when navigating with back/forward.
@sonarqubecloud
Copy link
Copy Markdown

@rgetz
Copy link
Copy Markdown
Contributor Author

rgetz commented Dec 10, 2025

@danmar - sorry to poke you about this one - this makes the html reports much more usable for me...

@danmar danmar merged commit 514dc56 into cppcheck-opensource:main Dec 10, 2025
55 checks passed
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Dec 10, 2025

please ping me if I don't review in a week or two

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants