fix: sync URL hash when following same-page search hits - #963
Conversation
`followSearchHit` only called `scrollIntoView()` for same-page hits, leaving the address bar without a hash (or stuck on a stale one from a previously followed hit). Push the hit's hash via `history.pushState` before scrolling so the URL always reflects the jumped-to anchor.
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 7f459f7. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #963 +/- ##
=======================================
Coverage 86.63% 86.63%
=======================================
Files 195 195
Lines 17938 17938
Branches 1632 1632
=======================================
Hits 15540 15540
Misses 2392 2392
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
followSearchHitonly calledscrollIntoView()for same-page hits, leaving the address bar without a hash (or stuck on a stale one from a previously followed hit). Push the hit's hash viahistory.pushStatebefore scrolling so the URL always reflects the jumped-to anchor.rel #955 (comment) cc @avivkeller
Description
Validation
Related Issues
Check List
node --run testand all tests passed.node --run format:check&node --run lint.