fix: active links consider query params and respect existing aria-current (#3755)

## Summary
- `matchesUrl()` now considers query parameters — links with query
params that don't match the current URL get `Ancestor` instead of
`Current` status
- Links with a user-set `aria-current` attribute are left untouched
(both server and client side), fixing daisyUI tab components and similar
use cases
- Client-side `updateLinks()` passes search params and respects user-set
attributes

Closes #3474

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bartek Iwańczuk
2026-04-09 09:42:02 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 895bcacdae
commit fc0ff66b80
5 changed files with 136 additions and 6 deletions
@@ -132,7 +132,11 @@ options[OptionsType.VNODE] = (vnode) => {
if (RENDER_STATE !== null) {
RENDER_STATE.owners.set(vnode, RENDER_STATE!.ownerStack.at(-1)!);
if (vnode.type === "a") {
setActiveUrl(vnode, RENDER_STATE.ctx.url.pathname);
setActiveUrl(
vnode,
RENDER_STATE.ctx.url.pathname,
RENDER_STATE.ctx.url.search,
);
}
}
assetHashingHook(vnode, BUILD_ID);