Repository navigation
feat: share dashboard filters through the URL (#385) - #387
Open
timdegroot1996 wants to merge 1 commit into
Open
timdegroot1996 wants to merge 1 commit into
timdegroot1996 wants to merge 1 commit into
Conversation
The active page and global filters are written to the query string after every filter pass (history.replaceState), so a filtered view can be bookmarked or sent as a link. On load the query string is applied to the filter modal right after the default filters are captured, so the filter profile "differs from default" checks stay correct. Only filters that differ from the defaults are written. The filter state is read and applied through the filter profile functions, so all global filters are covered (run, tags + mode, versions, dates, metadata, amount, suite path, custom filters). Values that do not exist in the opened dashboard are ignored instead of hiding every run, and query parameters the dashboard does not own are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #385
Problem
A filtered dashboard view could not be shared or bookmarked: filters lived only in the filter modal and were lost on reload.
Solution
New module
js/filter/url.js:history.replaceState, e.g.?page=dashboard&run=WebshopUI&tag=dev&amount=3.capture_default_filters(), so the filter profile "differs from default" checks still compare against the real defaults.filter.<name>,filterMode.<name>).--amountdefault that the first filter pass clamps to the number of runs is still treated as the default, so it is not written.Docs: new "Sharing Filters Through the URL" section in
docs/filtering.mdwith the parameter table.Behaviour change
A reload now keeps the filters (they are in the URL), and
pageis always present in the URL.Tests
tests/javascript/filter_url.test.js(build, parse, invalid values, round trip).06_filters.robot):Validate Filters From The Url Are Applied,Validate Changed Filters Are Written To The Url. Both fail without the wiring, pass with it.🤖 Generated with Claude Code