Overview
src/app/store/searchStore.ts calls window.history.replaceState whenever search filters change. replaceState overwrites the current history entry without creating a new one, so the Back button cannot navigate to a previous search query. Users who want to go back to their previous search state are forced to manually re-enter all their filters.
Specifications
Features:
- Each distinct search query creates a history entry so the Back button restores the previous search
- URL reflects current filter state and is shareable
Tasks:
- Replace replaceState with pushState for significant filter changes (new search query, changed category)
- Retain replaceState for minor transient changes such as pagination cursor updates
- Implement a popstate event listener to restore filter state when navigating Back
- Add tests asserting that pushState is called on a new search query
Impacted Files:
- src/app/store/searchStore.ts
Acceptance Criteria
- Navigating Back after a search returns to the previous query with all filters restored
- URL accurately reflects current filter state
- replaceState is only used for pagination or cursor updates, not query changes
Overview
src/app/store/searchStore.ts calls window.history.replaceState whenever search filters change. replaceState overwrites the current history entry without creating a new one, so the Back button cannot navigate to a previous search query. Users who want to go back to their previous search state are forced to manually re-enter all their filters.
Specifications
Features:
Tasks:
Impacted Files:
Acceptance Criteria