mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
* fix(web): preserve session sidebar scroll during navigation * fix(web): preserve nested session pane scroll * fix(web): avoid repeated file scroll restoration * fix(web): preserve scroll when leaving chat file previews * fix(web): preserve scroll after session resolution
17 lines
653 B
TypeScript
17 lines
653 B
TypeScript
// The /sessions layout keeps its sidebar mounted while its child route changes.
|
|
// TanStack Router restores every scrollable element by default, so a cached child
|
|
// route can otherwise overwrite the sidebar's current scrollTop. The child panes
|
|
// own their own scroll state; internal workspace navigation should skip the
|
|
// router-wide restoration pass.
|
|
export const PRESERVE_SESSION_SIDEBAR_SCROLL = {
|
|
resetScroll: false,
|
|
} as const
|
|
|
|
export function getSessionListSelectionNavigation(sessionId: string) {
|
|
return {
|
|
to: '/sessions/$sessionId' as const,
|
|
params: { sessionId },
|
|
...PRESERVE_SESSION_SIDEBAR_SCROLL,
|
|
}
|
|
}
|