From 17cc99de37c8a7a3108e827ea9db7fd754297373 Mon Sep 17 00:00:00 2001 From: "majun.jason" Date: Wed, 5 Aug 2026 15:24:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=90=9C=E7=B4=A2=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 高亮展示搜索结果中的命中词,覆盖普通文本与结构化消息内容 - 为全部及分类搜索结果提供聊天定位,定位后清空搜索并回到完整消息上下文 - 修复移动端搜索框聚焦自动放大,并补充桌面与移动端测试覆盖 --- src/main/export-html-template.ts | 59 ++++++++++++++++++++++++++++++-- tests/e2e/export-archive.spec.ts | 35 ++++++++++++++++++- tests/unit/export-media.test.ts | 19 ++++++++++ 3 files changed, 110 insertions(+), 3 deletions(-) diff --git a/src/main/export-html-template.ts b/src/main/export-html-template.ts index 34157ba..9237a45 100644 --- a/src/main/export-html-template.ts +++ b/src/main/export-html-template.ts @@ -306,6 +306,10 @@ body { opacity: 1; transform: translate(0, -50%); } +@media (hover: none) { + .locate-all { opacity: 1; pointer-events: auto; } + .locate-label { display: none; } +} .message.located .bubble { animation: locate-message 1.5s ease-out; } @keyframes locate-message { 0%, 32% { outline: 3px solid #36a477; outline-offset: 3px; } @@ -376,6 +380,14 @@ body { .sent .bubble { background: var(--mine); border-color: #c7e6d4; border-radius: 18px 10px 18px 18px; } .sender { color: var(--muted); font-size: 12px; margin-bottom: 5px; } .content { line-height: 1.7; word-break: break-word; white-space: pre-wrap; } +.search-highlight { + border-radius: 3px; + padding: 0 1px; + background: #ffe58f; + color: inherit; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; +} .audio-wrap { width: 260px; max-width: 100%; min-width: 0; } .audio { display: block; width: 100%; max-width: 100%; height: 38px; } .media-status { @@ -596,7 +608,13 @@ body { box-shadow: none; } .controls { grid-column: 2; min-width: 0; justify-content: flex-start; } - .controls input[type=search] { width: 100%; min-width: 0; height: 36px; padding: 0 10px; } + .controls input[type=search] { + width: 100%; + min-width: 0; + height: 36px; + padding: 0 10px; + font-size: 16px; + } .filters { grid-column: 1 / -1; display: flex; @@ -1025,7 +1043,7 @@ const renderExportScript = (name: string): string => ` const source = conversations.length > 1 && activeConversation === 'all' ? '' + esc(message.exportConversationName || '聊天') + '' : '' - const locateAction = activeKind === 'all' + const locateAction = activeKind === 'all' && !query.value.trim() ? '' : '