From db449f0915c13e1897c0ecfc471c6f43e4f1d1b8 Mon Sep 17 00:00:00 2001 From: yuxuanhui Date: Sun, 13 Sep 2026 14:31:03 +0800 Subject: [PATCH] fix: keep template table cells compact with Semi tooltips --- frontend/src/research/ResearchWorkspace.tsx | 57 ++++++++++++++------- frontend/src/research/workspace.css | 12 +++++ 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/frontend/src/research/ResearchWorkspace.tsx b/frontend/src/research/ResearchWorkspace.tsx index ee98f5c..05d2053 100644 --- a/frontend/src/research/ResearchWorkspace.tsx +++ b/frontend/src/research/ResearchWorkspace.tsx @@ -15,7 +15,9 @@ import { Table, TextArea, Toast, + Typography, } from "@douyinfe/semi-ui-19"; +import { WorkspaceTable } from "../components/WorkspaceTable"; import { ResearchInput } from "../ai/ResearchInput"; import { IconAIEditLevel3 } from "@douyinfe/semi-icons"; import { api, post, formatTime } from "../api"; @@ -354,20 +356,20 @@ export function ResearchWorkspace({ } > {listMode === "assets" ? ( - <> - - className="research-table" +
+ + key={JSON.stringify([search, assetPage])} + fill dataSource={assets} rowKey="id" - pagination={false} - size="small" - sticky - style={{ minWidth: 720 }} + scroll={{ x: 800, y: "100%" }} empty="还没有模板。新建或导入一个模板开始研究。" columns={[ { title: "模板名称", key: "name", + width: 280, + ellipsis: { showTitle: false }, render: (_, item) => ( ), }, @@ -397,8 +405,17 @@ export function ResearchWorkspace({ { title: "表达式", key: "expression", - width: 260, - render: (_, item) => {item.content.expression}, + width: undefined, + ellipsis: { showTitle: false }, + render: (_, item) => ( + + {item.content.expression} + + ), }, { title: "分类", @@ -412,19 +429,21 @@ export function ResearchWorkspace({ key: "actions", width: 80, render: (_, item) => ( - - task("删除模板", () => removeAsset(item)) - } - /> +
+ + task("删除模板", () => removeAsset(item)) + } + /> +
), }, ]} /> - +
) : ( <> diff --git a/frontend/src/research/workspace.css b/frontend/src/research/workspace.css index 2e31d6b..b75d57b 100644 --- a/frontend/src/research/workspace.css +++ b/frontend/src/research/workspace.css @@ -104,6 +104,18 @@ .research-table-scroll { overflow-x: auto; } +.research-template-table-container { + display: flex; + flex-direction: column; + height: 100%; + min-height: 0; + min-width: 0; + overflow: hidden; +} +.research-template-expression { + font-family: ui-monospace, SFMono-Regular, Menlo, monospace; + font-size: 12px; +} .research-table .semi-table-row-cell { vertical-align: top; overflow-wrap: anywhere;