feat(ux): update truncate dots to be shorter in tables (#17825)

This commit is contained in:
Dev Randalpura
2026-01-29 07:56:56 -08:00
committed by GitHub
parent f619cd8750
commit f9da18e0cc
2 changed files with 3 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ export const TableRenderer: React.FC<TableRendererProps> = ({
const candidate = content.substring(0, mid); const candidate = content.substring(0, mid);
const candidateWidth = getPlainTextLength(candidate); const candidateWidth = getPlainTextLength(candidate);
if (candidateWidth <= contentWidth - 3) { if (candidateWidth <= contentWidth - 1) {
bestTruncated = candidate; bestTruncated = candidate;
left = mid + 1; left = mid + 1;
} else { } else {
@@ -91,7 +91,7 @@ export const TableRenderer: React.FC<TableRendererProps> = ({
} }
} }
cellContent = bestTruncated + '...'; cellContent = bestTruncated + '';
} }
} }

View File

@@ -57,7 +57,7 @@ exports[`TableRenderer > renders a simple table correctly 1`] = `
exports[`TableRenderer > renders a table with long headers and 4 columns correctly 1`] = ` exports[`TableRenderer > renders a table with long headers and 4 columns correctly 1`] = `
" "
┌──────────────────┬──────────────────┬───────────────────┬──────────────────┐ ┌──────────────────┬──────────────────┬───────────────────┬──────────────────┐
│ Very Long Col... │ Very Long Col... │ Very Long Colu... │ Very Long Col... │ Very Long Colum… │ Very Long Colum… │ Very Long Column… │ Very Long Colum…
├──────────────────┼──────────────────┼───────────────────┼──────────────────┤ ├──────────────────┼──────────────────┼───────────────────┼──────────────────┤
│ Data 1.1 │ Data 1.2 │ Data 1.3 │ Data 1.4 │ │ Data 1.1 │ Data 1.2 │ Data 1.3 │ Data 1.4 │
│ Data 2.1 │ Data 2.2 │ Data 2.3 │ Data 2.4 │ │ Data 2.1 │ Data 2.2 │ Data 2.3 │ Data 2.4 │