From 7f48cef3449093e8a6af4e4204c14f918b2bac54 Mon Sep 17 00:00:00 2001 From: hunter-dev Date: Wed, 26 Aug 2026 22:05:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(outline):=20hover=20=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E6=AE=8B=E7=95=99=E2=80=94=E2=80=94=E5=86=85=E8=81=94=20onMous?= =?UTF-8?q?eEnter/onMouseLeave=20=E7=94=A8=20if(i!=3D=3DactiveIdx)=20?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6,=20=E7=82=B9=E5=87=BB=E5=90=8E=20activeIdx?= =?UTF-8?q?=20=E5=8F=98=E5=8C=96=E5=AF=BC=E8=87=B4=20onMouseLeave=20?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=B8=BA=20false=20=E4=B8=8D=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E8=83=8C=E6=99=AF.=20=E6=94=B9=E7=94=A8=E7=BA=AF=20CS?= =?UTF-8?q?S=20:hover=20=E6=9B=BF=E4=BB=A3=E5=86=85=E8=81=94=20JS,=20?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E8=87=AA=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20hover=20=E7=8A=B6=E6=80=81=E6=97=A0=E7=AB=9E=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/src/renderer/features/outline/OutlinePanel.tsx | 6 ++---- apps/desktop/src/renderer/styles.css | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/renderer/features/outline/OutlinePanel.tsx b/apps/desktop/src/renderer/features/outline/OutlinePanel.tsx index 183976c..685892f 100644 --- a/apps/desktop/src/renderer/features/outline/OutlinePanel.tsx +++ b/apps/desktop/src/renderer/features/outline/OutlinePanel.tsx @@ -109,10 +109,8 @@ export function OutlinePanel() { {headings.map((h, i) => (
scrollTo(h)} className={i === activeIdx ? 'outline-item outline-item-active' : 'outline-item'} - style={{ paddingLeft: 8 + (h.level - 1) * 12, cursor: 'pointer', padding: '4px 4px 4px ' + (8 + (h.level-1)*12) + 'px', - fontSize: 13, borderRadius: 4 }} - onMouseEnter={e => { if (i !== activeIdx) e.currentTarget.style.background = 'var(--control-border)'; }} - onMouseLeave={e => { if (i !== activeIdx) e.currentTarget.style.background = 'transparent'; }}> + style={{ cursor: 'pointer', padding: '4px 4px 4px ' + (8 + (h.level-1)*12) + 'px', + fontSize: 13, borderRadius: 4 }}> {h.text || '(空标题)'}
))} diff --git a/apps/desktop/src/renderer/styles.css b/apps/desktop/src/renderer/styles.css index 4aee2ee..09042d4 100644 --- a/apps/desktop/src/renderer/styles.css +++ b/apps/desktop/src/renderer/styles.css @@ -74,7 +74,8 @@ html, body, #root { margin: 0; height: 100%; } border-radius: 4px; } -/* FR-O3:大纲当前项高亮——主题变量适配 */ +/* FR-O3:大纲项 hover + 当前项高亮——用 CSS :hover 避免内联 style 竞态 */ +.outline-item:hover { background: var(--control-border); } .outline-item-active { background: var(--control-border) !important; border-left: 2px solid var(--accent) !important;