From e6f473f432db459c8346f670f5976d3663d892bf Mon Sep 17 00:00:00 2001 From: xu0o0 Date: Sat, 18 Apr 2026 01:23:47 +0800 Subject: [PATCH] fix(coding-agent): prevent text selection from triggering click toggles in exported HTML (#3332) --- .../coding-agent/src/core/export-html/template.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/coding-agent/src/core/export-html/template.js b/packages/coding-agent/src/core/export-html/template.js index 57bdb811..f2b00b06 100644 --- a/packages/coding-agent/src/core/export-html/template.js +++ b/packages/coding-agent/src/core/export-html/template.js @@ -709,6 +709,7 @@ div.appendChild(content); // Navigate to the newest leaf through this node, but scroll to the clicked node div.addEventListener('click', () => { + if (window.getSelection().toString()) return; const leafId = findNewestLeaf(entry.id); navigateTo(leafId, 'target', entry.id); }); @@ -827,7 +828,7 @@ previewHighlighted = escapeHtml(previewCode); } - return `