From a3c31417829aa96fc89ea035def8ff3038907d3d Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Mon, 18 Dec 2023 15:14:24 +0100 Subject: [PATCH] fix: set explicit branches sidebar height when none found in storage - to prevent content shifting when filters are applied/unapplied --- .../ui/src/routes/[projectId]/navigation/Branches.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/routes/[projectId]/navigation/Branches.svelte b/packages/ui/src/routes/[projectId]/navigation/Branches.svelte index 4df0c13c5..f79ff81a0 100644 --- a/packages/ui/src/routes/[projectId]/navigation/Branches.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/Branches.svelte @@ -25,7 +25,7 @@ const githubEnabled$ = githubService.isEnabled$; const userSettings = getContext(SETTINGS_CONTEXT); - const height = persisted(undefined, 'branchesHeight_' + projectId); + const height = persisted(undefined, 'branchesHeight'); let includePrs = persisted(true, 'includePrs_' + projectId); let includeRemote = persisted(true, 'includeRemote_' + projectId); @@ -118,6 +118,13 @@ updateResizable(); observer = new ResizeObserver(() => updateResizable()); if (viewport) observer.observe(resizeGuard); + + // Set explicit height if not found in storage. In practice this means + // that the height is by default maximised, and won't shift when filters + // are applied/unapplied. + if (!$height && maxHeight) { + $height = maxHeight; + } }); onDestroy(() => observer.disconnect());