From 627e9e436de83af1f19943e343ee9b79115fcb46 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 7 May 2026 18:27:38 +0800 Subject: [PATCH] fix(frontend): render markdown tables in chat wiki drawer The wiki page drawer opened from the chat view rendered tables without borders or padding because the global `.wiki-graph-drawer .wiki-reader-body` style block was missing GFM table rules. Add the same table styles already used by `WikiBrowser.vue` so tables show consistent borders, header background, and hover states across both entry points. --- .../chat/components/AgentStreamDisplay.vue | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vue index c1f488d0..2573f756 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.vue +++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue @@ -3546,6 +3546,58 @@ const handleAddToKnowledge = (answerEvent: any) => { text-decoration: none !important; } } + + table { + display: block; + width: fit-content; + max-width: 100%; + overflow-x: auto; + margin: 0 0 16px; + border-collapse: collapse; + font-size: 13px; + line-height: 1.55; + background: var(--td-bg-color-container); + border: 1px solid var(--td-component-stroke); + border-radius: 6px; + -webkit-overflow-scrolling: touch; + } + + table thead { + background: var(--td-bg-color-secondarycontainer); + } + + table th, + table td { + padding: 8px 12px; + border-bottom: 1px solid var(--td-component-stroke); + border-right: 1px solid var(--td-component-stroke); + text-align: left; + vertical-align: top; + word-break: break-word; + } + + table th { + font-weight: 600; + color: var(--td-text-color-primary); + white-space: nowrap; + } + + table th:last-child, + table td:last-child { + border-right: none; + } + + table tbody tr:last-child td { + border-bottom: none; + } + + table tbody tr:hover { + background: var(--td-bg-color-secondarycontainer); + } + + table code { + font-size: 12px; + } } } // Dark mode: invert agent icon (uses currentColor which doesn't work in )