~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Tabs keep the page where they are again, as SvelteKit 3 reads it

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:web/keep-scroll

What changes

A repository's tabs, and every other row of tabs or filters marked to keep the page where it is (a pull's Conversation and Files changed, a file's Preview, Code and Blame, lists' Open and Closed and filter menus, a profile's tabs and repositories' filters, the home feed's tabs, settings' navs), no longer scroll the page to the top when one is picked. The click also keeps focus on the tab it picked rather than sending it back to the page's start.

Why

The earlier fixes marked these rows data-sveltekit-noscroll, but SvelteKit 3 replaced that attribute with data-sveltekit-reset="false". Outside dev it ignores the old one without a word (dev only warns link_option_replaced), so every row still scrolled to the top on prod. The new attribute covers both scroll and focus, which is what a tab wants.

How it was checked

Read in SvelteKit 3.1's client: restore_scroll and reset_focus both run only when the link's reset option is on, and data-sveltekit-noscroll is no longer read at all. Nothing is drawn differently; the shots check shows whether any page moved.

Shortcomings

Not tried in a browser. A pick whose page is shorter than where you were still leaves you at its end.

🤖 Generated with Claude Code

Approved

This swaps data-sveltekit-noscroll for data-sveltekit-reset="false" on all 10 places that used it. I searched the base branch for noscroll and found no other uses, so none are left behind. web/package.json depends on @sveltejs/kit ^3.0.0, so the new attribute is the right one. The diff is mechanical, and each row keeps its other attributes (@attach, bind:this, aria-label). I couldn't confirm the scroll and focus behavior without a browser, and the description says it wasn't tried in one either. A quick manual check on prod or a preview is worthwhile.

Merged as 8e3f4b3