From 9430e3230f153b169cb0a8b673faba4eaadaf7e7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 24 Jul 2026 06:10:26 +0200 Subject: [PATCH] enhance: keep status check list scrolled on merge box reload (#38597) Remember the scroll offset when the merge box reloads. This is a crude patch now, a proper fix would be a fully vue-rendered template with a json payload from backend, which is much more work. Idiomorph was also considered but deemed unviable. --- web_src/js/features/repo-issue-pull.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_src/js/features/repo-issue-pull.ts b/web_src/js/features/repo-issue-pull.ts index 3fcaa604467..77948c4edda 100644 --- a/web_src/js/features/repo-issue-pull.ts +++ b/web_src/js/features/repo-issue-pull.ts @@ -53,7 +53,9 @@ function initRepoPullMergeBoxRefresh(el: Element) { const resp = await GET(`${pullLink}/merge_box`); if (!resp.ok) return; const newEl = createElementFromHTML(await resp.text()); + const scrollTop = el.querySelector('.commit-status-list')?.scrollTop; el.replaceWith(newEl); // don't morph, do full replacement to make sure data-global-init and Vue components are re-initialized + if (scrollTop) newEl.querySelector('.commit-status-list')?.scrollTo({top: scrollTop, behavior: 'instant'}); }, }); }