Skip to content

Commit 935a1e5

Browse files
docs(agent-guide): list scrollRestoration among the router keys that reach the browser
The table's whole purpose is that a key not on it is dead config, so a new forwarded key that is missing from it reads as one that does nothing.
1 parent 7b7d2eb commit 935a1e5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎docs/guide/agent-guide.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4867,6 +4867,7 @@ grep -rn "from 'stx/routes'" --include='*.ts' . | grep -v 'import type' # must
48674867
| `prefetch` | `:325` | `:106` | `client.js:830` | `true` |
48684868
| `cache` | `:326` | `:108` | `client.js:312`, `365`, `847` | `true` |
48694869
| `scrollToTop` | `:324` | `:104` | `client.js:449`, `712` | `true` |
4870+
| `scrollRestoration` | `config-types.ts` | yes (next to `scrollToTop`) | `applyScroll`, the popstate handler | `true` |
48704871
| `viewTransitions` | `:321` | `:98` | `client.js:15`, `901` | `true` |
48714872
| `viewTransitionDuration` | `:322` | `:100` | `client.js:902` | `220` |
48724873
| `viewTransitionEasing` | `:323` | `:102` | `client.js:903` | `cubic-bezier(0.16,1,0.3,1)` |
@@ -4879,6 +4880,8 @@ grep -rn "from 'stx/routes'" --include='*.ts' . | grep -v 'import type' # must
48794880
| `skipSelectors` | `:328` | **no** | never | — |
48804881
| `viewTransitionCSS` | `:329` | **no** | never | — |
48814882
4883+
`scrollRestoration` is why back and forward return to where an entry was left rather than to the top: it switches `history.scrollRestoration` to manual and keeps positions in `sessionStorage`, keyed by a token in each history entry. Setting it to `false` restores the old always-top behaviour and hands reload restoration back to the browser.
4884+
48824885
Two keys are only reachable through `window.__stxRouterConfig` directly, not through `config/ui.ts`: `loadingClass` (`client.js:9`, `303`, `310`) and `prefetchCacheMax` (`client.js:9`, `86`).
48834886
48844887
`interceptAllLinks` is worth pinning explicitly, as `config/ui.ts:31-35` already argues: stx-router's own default is `false` (`client.js:9`) while the serve path hardcodes `true` (`serve.js:9764`) before merging `stxConfig.router`. Once §9.1 is complete across `SiteNav.stx` and `SiteFooter.stx`, flip it to `false` — that is the whole point of the conversion.

0 commit comments

Comments
 (0)