Skip to content

fix(web): browser back from search results jumped to the agent page#23

Merged
andylizf merged 1 commit into
mainfrom
fix/search-back-history
Jun 5, 2026
Merged

fix(web): browser back from search results jumped to the agent page#23
andylizf merged 1 commit into
mainfrom
fix/search-back-history

Conversation

@andylizf
Copy link
Copy Markdown
Contributor

@andylizf andylizf commented Jun 5, 2026

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 — searches push their results URL, and a searchParams effect 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 ✓.

…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.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 5, 2026 6:41am

@andylizf andylizf merged commit 7bacbd5 into main Jun 5, 2026
6 checks passed
@andylizf andylizf deleted the fix/search-back-history branch June 5, 2026 06:41
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.

1 participant