November 25, 2026
URL filters that survive refresh and the Back button
A useful filtered-search link should reopen the choices that produced it. If the address says “lamps up to $50” while the search box is empty, the page is giving two different accounts of what happened. Neither should require a witness.
In my Dupe frontend work, I worked on keeping the visible search input synchronized with the search term in the URL, including clearing the input when that term disappears. I also separated initial prefilling from later user edits. That is a specific part of making a shared search understandable.
For this article, our separate local demo on 23 November 2026 checked how URL state behaves with a fictional catalog. It illustrates the review process; it does not test Dupe’s live search.
Decide what a shared link should restore
Start with the choices another person needs: the search phrase, relevant filters and, where useful, the sort order. An open menu or an unfinished keystroke may not belong in the shared state.
Our demo used four fictional items: three lamps priced at $20, $45 and $80, plus a $30 book stand. Searching for “lamp” with a maximum of $50 produced this relative URL:
/catalog?search=lamp&maxPrice=50
Opening that selection in a fresh tab restored the search phrase, maximum price and two matching lamps. Reloading preserved them too. The demo has fixed data, so the rows stayed identical. A real marketplace can restore the same criteria while returning different rows because stock or prices have changed.
Agree on which promise the product makes. A shareable search usually preserves the request, not a frozen copy of the inventory.
Read the URL back into the interface
Writing selected values into the address is only half the work. On arrival, the page must read those values into both its controls and its results. It must also respond when navigation changes the URL while the page is already open.
That second situation matters to the Dupe contribution: an input initialized once can become stale when the route’s search term changes later. Synchronizing the mounted input with that term also gives removal a clear meaning: no search parameter means an empty search input.
For implementation, URLSearchParams provides methods to read, set and delete query values. Use that parsing layer consistently, then apply the product’s rules to the values it returns. A query parser does not decide whether a negative maximum price makes sense for your catalog.
Choose where the Back button should stop
In our demo, clicking Apply created a history entry. Changing the maximum from $50 to $25 reduced the results from two lamps to one. Back restored $50, the input value and both matching lamps; Forward restored $25 and the single match.
The browser gives developers two different operations: pushState adds an entry, while replaceState updates the current entry. Decide which user actions deserve a return point. Adding an entry for every letter typed can make Back feel like an undo key for spelling.
Browser history also needs an interface update. The popstate event reports history traversal; calling pushState or replaceState does not itself fire that event. Our demo rendered after its own changes and again when navigation restored a previous entry. Your framework may provide the corresponding routing mechanism.
Define clearing and invalid values
Clear filters removed both parameters in the demo, emptied the inputs and restored all four items. Back then returned to the previous filtered selection. That behavior followed our choice to treat Clear as a deliberate history step.
We also opened a URL with maxPrice=abc. The demo removed the invalid maximum, kept “lamp” and showed all three lamps. It normalized the address without adding another history stop.
Dropping an invalid value is one policy. Another product might show a correction message instead. Specify the outcome before implementation, and keep the address, controls and displayed results consistent with it. A silently ignored value should not remain on screen looking active.
Review the whole trip
For a small catalog, this sequence is practical: apply a selection, open its link in a fresh tab, refresh, change one filter, use Back and Forward, then clear it. Include an invalid value entered directly in the address. Check the controls as carefully as the result count.
Those actions were exercised in our fictional demo in one browser. They establish what that example did, not cross-browser coverage, faster shopping or a conversion improvement.
Put the expected states into an AI brief for a product listing page, or adapt Amito’s interface specifications. A useful acceptance check is concrete: after reopening this link, which values should the reader see, and what should one press of Back restore?