From 39b38119c1cc1619fff35a3fd373f28cebb02064 Mon Sep 17 00:00:00 2001 From: xuncha <1658671838@qq.com> Date: Mon, 2 Mar 2026 22:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChatPage.scss | 159 ++++++++++++++++++++++++---------------- src/pages/ChatPage.tsx | 150 ++++++++++++++++++++++++------------- 2 files changed, 197 insertions(+), 112 deletions(-) diff --git a/src/pages/ChatPage.scss b/src/pages/ChatPage.scss index 0c30aa2..4ccdd2b 100644 --- a/src/pages/ChatPage.scss +++ b/src/pages/ChatPage.scss @@ -4137,55 +4137,51 @@ // 消息信息弹窗 .message-info-overlay { position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.6); + inset: 0; + background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); + z-index: 2000; display: flex; align-items: center; justify-content: center; - z-index: 2000; - padding: 20px; } .message-info-modal { - width: 520px; + width: 360px; max-width: 90vw; max-height: 80vh; background: var(--card-bg); + border: 1px solid var(--border-color); border-radius: 12px; - box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); overflow: hidden; - .modal-header { + .detail-header { display: flex; align-items: center; justify-content: space-between; - padding: 16px 20px; + padding: 16px; border-bottom: 1px solid var(--border-color); - h3 { - font-size: 16px; + h4 { + font-size: 15px; font-weight: 600; color: var(--text-primary); + margin: 0; } .close-btn { - width: 28px; - height: 28px; + background: none; border: none; - background: transparent; - border-radius: 6px; + padding: 4px; cursor: pointer; + color: var(--text-secondary); + border-radius: 6px; display: flex; align-items: center; justify-content: center; - color: var(--text-tertiary); - transition: all 0.2s; &:hover { background: var(--bg-hover); @@ -4194,56 +4190,98 @@ } } - .modal-body { + .detail-content { flex: 1; overflow-y: auto; - padding: 16px 20px; + padding: 16px; + + &::-webkit-scrollbar { width: 4px; } + &::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 2px; } } - .info-section { - margin-bottom: 16px; + .detail-section { + margin-bottom: 20px; + &:last-child { margin-bottom: 0; } - h4 { - font-size: 13px; + .section-title { + display: flex; + align-items: center; + gap: 6px; + font-size: 12px; font-weight: 600; color: var(--text-secondary); - margin: 0 0 8px 0; - } - } + margin-bottom: 12px; + letter-spacing: 0.5px; - .info-grid { - display: flex; - flex-direction: column; - gap: 6px; - } + svg { opacity: 0.7; } - .info-item { - display: flex; - align-items: baseline; - gap: 8px; - font-size: 13px; - - .label { - color: var(--text-tertiary); - min-width: 80px; - flex-shrink: 0; - } - - .value { - color: var(--text-primary); - word-break: break-all; - - &.code { - font-family: monospace; - font-size: 12px; - background: var(--bg-tertiary); - padding: 2px 6px; + .copy-btn { + margin-left: auto; + display: flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + padding: 0; + border: none; border-radius: 4px; + background: transparent; + color: var(--text-tertiary); + cursor: pointer; + &:hover { background: var(--bg-secondary); color: var(--text-primary); } } } } - .raw-content-container { + .detail-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 0; + border-bottom: 1px solid var(--border-color); + font-size: 13px; + + &:last-child { border-bottom: none; } + + svg { color: var(--text-tertiary); flex-shrink: 0; } + + .label { color: var(--text-secondary); flex-shrink: 0; } + + .value { + flex: 1; + text-align: right; + color: var(--text-primary); + word-break: break-all; + user-select: text; + + &.highlight { color: var(--primary); font-weight: 600; } + &.mono { font-family: 'Consolas', 'Monaco', monospace; font-size: 12px; } + } + + .copy-btn { + display: flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + padding: 0; + border: none; + border-radius: 4px; + background: transparent; + color: var(--text-tertiary); + cursor: pointer; + flex-shrink: 0; + opacity: 0; + transition: opacity 0.15s, color 0.15s, background 0.15s; + + &:hover { background: var(--bg-secondary); color: var(--text-primary); } + svg { color: inherit; } + } + + &:hover .copy-btn { opacity: 1; } + } + + .raw-content-box { background: var(--bg-tertiary); border-radius: 8px; padding: 12px; @@ -4252,15 +4290,12 @@ pre { margin: 0; - font-size: 12px; - font-family: monospace; - color: var(--text-primary); white-space: pre-wrap; word-break: break-all; + font-family: 'Consolas', 'Monaco', monospace; + font-size: 12px; + color: var(--text-primary); + user-select: text; } } - - .select-text { - user-select: text; - } } \ No newline at end of file diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx index 05fddde..b795fe4 100644 --- a/src/pages/ChatPage.tsx +++ b/src/pages/ChatPage.tsx @@ -2749,71 +2749,121 @@ function ChatPage(_props: ChatPageProps) { {showMessageInfo && createPortal(
{showMessageInfo.rawContent || showMessageInfo.content}
+ {showMessageInfo.localType !== 1 && (showMessageInfo.rawContent || showMessageInfo.content) && (
+ {showMessageInfo.rawContent || showMessageInfo.content}