mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Persist sidebar across navigations to preserve scroll position
Move AppSidebar out of per-route view components into App.svelte so it
is never unmounted on navigation. This fixes the sidebar scroll position
resetting to the top whenever the user opens a repository or navigates
between Issues, Patches and the repo home view.
Also removes the redundant invoke<Config>("config") call from each repo
route loader — the value is now taken from sidebarData.config, which
loadSidebarData() already fetches.
This commit is contained in:
@@ -52,6 +52,18 @@ export type LoadedRoute =
|
||||
| LoadedInboxRoute
|
||||
| LoadedGuideRoute;
|
||||
|
||||
export function isLoadedRepoRoute(
|
||||
route: LoadedRoute,
|
||||
): route is LoadedRepoRoute {
|
||||
return (
|
||||
route.resource === "repo.home" ||
|
||||
route.resource === "repo.issue" ||
|
||||
route.resource === "repo.issues" ||
|
||||
route.resource === "repo.patch" ||
|
||||
route.resource === "repo.patches"
|
||||
);
|
||||
}
|
||||
|
||||
export async function loadSidebarData(): Promise<SidebarData> {
|
||||
const [config, repos, notificationCount, seededNotReplicated] =
|
||||
await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user