Skip to content

Feat/215 persist report filters - #229

Merged
shossain786 merged 3 commits into
seleniumboot:masterfrom
PUSHPAK-JAISWAL:feat/215-persist-report-filters
Nov 1, 2026
Merged

shossain786 merged 3 commits into
seleniumboot:masterfrom
PUSHPAK-JAISWAL:feat/215-persist-report-filters

Conversation

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor

What & why

The Test Cases tab in the HTML report previously reset to "All" every time the report was reopened or refreshed, and active tag filters were cleared, while theme preference already persisted via sb-theme in localStorage.

This PR persists the active status filter and tag filter across page reloads using localStorage, following the same pattern as sb-theme:

  • Status Filter Persistence (sb-status-filter): Persists the selected status (PASSED, FAILED, SKIPPED, FLAKY) to localStorage; removes the key when "ALL" is selected.
  • Tag Filter Persistence (sb-tag-filter): Persists the active tag name to localStorage; removes the key when the active tag is toggled off or cleared with clearTagFilter().
  • Restoration on Load: On page load, restores button styling, restores the active tag pill, and re-applies filters via applySearch().
  • Stale Tag Resilience: If a stored tag no longer exists in the current report's test cases, it is gracefully ignored without restricting rows or displaying an invalid tag pill.
  • Storage Error Handling: All localStorage read, write, and remove operations are enclosed in try ... catch blocks to gracefully handle Safari private browsing mode, disabled storage, or quota limits without failing report rendering.
  • Dashboard Tab Invariant: Filter restoration preserves the default initial view of the Dashboard tab without triggering automatic navigation to the Test Cases tab.
  • Template & Build Cleanup:
    • Replaced raw template expressions {{DONUT_DATA}} and {{TREND_DATA}} in report.js with JSON.parse('...') to eliminate JavaScript parser/linter errors (ts(1136)).
    • Explicitly declared com.fasterxml.jackson.core:jackson-core in pom.xml to ensure clean IDE/language server type resolution for JsonProcessingException.

Closes #215

Type of change

  • Bug fix
  • New feature (opt-in, aligned with the framework philosophy)
  • Documentation
  • Internal refactor / test coverage

Checklist

  • All existing tests pass (mvn clean test / mvn clean verify)
  • New behaviour is covered by unit tests
  • No new external dependencies introduced without prior discussion
  • Code follows existing conventions (no new frameworks, minimal abstraction)
  • No breaking changes to @SeleniumBootApi public APIs (or a major version bump is justified below)
  • Docs updated if user-facing behaviour changed (CHANGELOG.md)

@shossain786 shossain786 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.

Thanks @PUSHPAK-JAISWAL — the persistence logic itself looks good: guarded storage access, stale tags ignored, and no tab switching on load. A few small things to trim before merge:

  1. pom.xml: drop the explicit jackson-core dependency. jackson-databind already brings it in transitively, and the checklist says no new dependencies without discussion.
  2. Drop the unused JsonProcessingException imports in HtmlReportGeneratorTest and ReportTabBehaviourTest.
  3. Drop the JSON.parse('{{DONUT_DATA}}') / {{TREND_DATA}} change (and the ' escaping plus the matching test edit). It's unrelated to #215, and escaping only ' would break on a backslash in the data. Separate PR if you still want it.
  4. Optional: please confirm manually that a filter survives a reload.

Once 1–3 are out I'm happy to merge.

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor Author

@shossain786 ok i will make changes

@PUSHPAK-JAISWAL
PUSHPAK-JAISWAL force-pushed the feat/215-persist-report-filters branch from cf0ead7 to c293899 Compare November 1, 2026 06:59
@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor Author

@shossain786 i have changed the requested and did a manual refresh verification this is the output if i am able to attach it.

Screen.Recording.2026-11-01.122900.mp4

@shossain786 shossain786 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.

Thanks @PUSHPAK-JAISWAL — all three items are addressed and the PR is now scoped to #215. Merging.

@shossain786
shossain786 merged commit 5c8660f into seleniumboot:master Nov 1, 2026
2 checks passed
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.

Report: remember the status and tag filters across reloads

2 participants