fix(web): browser back from search results jumped to the agent page#23
Merged
Conversation
…nt page Search results were applied with router.replace, so they never became a history entry — pressing back from results landed on whatever preceded the home page (often /chat, hence 'why does back go to the agent?'). Make ?q= the source of truth: a successful search PUSHES /?q=... as its own entry, and a searchParams effect reacts to back/forward — back to '/' clears results, returning to a ?q= entry re-runs that search. The reset arrow also pushes so back can restore the results. Verified end-to-end with a scripted browser: /chat -> home -> search -> back lands on the clean home, second back returns to /chat.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Bug: search results used
router.replace, so they never became a history entry — back from results landed on whatever preceded the home page (often/chat).Fix:
?q=is now the source of truth — searchespushtheir results URL, and asearchParamseffect handles back/forward (back to/clears results; revisiting a?q=entry re-runs it).Verified with a scripted real browser:
/chat → home → search → back→ clean home ✓, second back →/chat✓.