fix(ui): increase table tooltip max height to 80vh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -565,19 +565,8 @@ const ReactTableTooltip = ({ content }: { content: string }) => {
|
||||
})();
|
||||
const tableMaxWidth = Math.min(Math.max(colCount * 140, 400), window.innerWidth * 0.85);
|
||||
|
||||
// 根据行数动态计算高度:表头 36px + 每行 30px,最小 150,最大 70vh
|
||||
const rowCount = (() => {
|
||||
if (isMdTable) {
|
||||
const sepMatch = content.match(/\|[\s-:]+(?:\|[\s-:]+)+\|/);
|
||||
if (sepMatch) {
|
||||
const bodyPart = content.substring(content.indexOf(sepMatch[0]) + sepMatch[0].length);
|
||||
const bodyCells = bodyPart.split('|').filter(c => c.trim()).length;
|
||||
return Math.ceil(bodyCells / colCount);
|
||||
}
|
||||
}
|
||||
return content.split('\n').filter(l => l.trim() && l.includes('|')).length;
|
||||
})();
|
||||
const tableMaxHeight = Math.min(Math.max(36 + rowCount * 30 + 20, 150), window.innerHeight * 0.7);
|
||||
// 高度不限制,让表格内容完整显示,最大 80vh
|
||||
const tableMaxHeight = window.innerHeight * 0.8;
|
||||
|
||||
return (
|
||||
<div className="text-xs p-1 rounded cursor-text w-full text-left">
|
||||
|
||||
Reference in New Issue
Block a user