From cf809d3dd7c213061b73551c4a5141f7d81e6e12 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 12 Dec 2025 13:26:50 -0800 Subject: [PATCH] Fix bug --- web_src/js/features/repo-diff-selection.ts | 6 ------ web_src/js/features/repo-diff.ts | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/web_src/js/features/repo-diff-selection.ts b/web_src/js/features/repo-diff-selection.ts index 04ea1f9b20..60fadc86e2 100644 --- a/web_src/js/features/repo-diff-selection.ts +++ b/web_src/js/features/repo-diff-selection.ts @@ -252,12 +252,6 @@ function handleDiffLineNumberClick(cell: HTMLElement, e: MouseEvent) { export function initDiffLineSelection() { addDelegatedEventListener(document, 'click', diffLineNumberCellSelector, (cell, e) => { if (e.defaultPrevented) return; - // Ignore clicks on or inside code-expander-buttons - const target = e.target as HTMLElement; - if (target.closest('.code-expander-button') || target.closest('.code-expander-buttons') || - target.closest('button, a, input, select, textarea, summary, [role="button"]')) { - return; - } handleDiffLineNumberClick(cell, e); }); window.addEventListener('hashchange', () => { diff --git a/web_src/js/features/repo-diff.ts b/web_src/js/features/repo-diff.ts index 206b5964a7..af3ee2ba94 100644 --- a/web_src/js/features/repo-diff.ts +++ b/web_src/js/features/repo-diff.ts @@ -170,9 +170,11 @@ async function loadMoreFiles(btn: Element): Promise { const resp = await response.text(); const respDoc = parseDom(resp, 'text/html'); const respFileBoxes = respDoc.querySelector('#diff-file-boxes')!; + const respFileBoxesChildren = Array.from(respFileBoxes.children); // respFileBoxes.children will be empty after replaceWith // the response is a full HTML page, we need to extract the relevant contents: // * append the newly loaded file list items to the existing list - document.querySelector('#diff-incomplete')!.replaceWith(...Array.from(respFileBoxes.children)); + document.querySelector('#diff-incomplete')!.replaceWith(...respFileBoxesChildren); + for (const el of respFileBoxesChildren) window.htmx.process(el); onShowMoreFiles(); return true; } catch (error) {