From cbe9a0f74e54dd44732be1c8540b2c1e3318eb21 Mon Sep 17 00:00:00 2001 From: wren Date: Mon, 23 Mar 2026 19:45:00 +0800 Subject: [PATCH] fix(ui): show table summary with hover tooltip for full table view Table fields now show a compact summary (first row preview + table icon) with the full rendered table appearing on hover via Tooltip component, consistent with the existing overflow tooltip behavior. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/components/reviews/ReviewPointsList.tsx | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/app/components/reviews/ReviewPointsList.tsx b/app/components/reviews/ReviewPointsList.tsx index c3c2428..51e7e2e 100644 --- a/app/components/reviews/ReviewPointsList.tsx +++ b/app/components/reviews/ReviewPointsList.tsx @@ -546,11 +546,31 @@ const ReactTableTooltip = ({ content }: { content: string }) => { - // 表格内容直接渲染表格组件,非表格内容保持原有行为 + // 表格内容:主区域显示摘要,hover 悬浮显示完整表格 if (isTableLike) { + // 生成摘要文本:取第一行数据作为预览 + const summaryText = (() => { + const firstLine = content.split('\n').find(l => l.trim() && !/^\s*\|[-\s:]+\|/.test(l)); + return firstLine ? firstLine.trim().substring(0, 80) + (firstLine.length > 80 ? '...' : '') : content.substring(0, 80); + })(); + return (
- {renderedContent} + +
+ + {summaryText} +
+
); }