diff --git a/.changeset/cool-bikes-suffer.md b/.changeset/cool-bikes-suffer.md new file mode 100644 index 0000000000..07cf1f4359 --- /dev/null +++ b/.changeset/cool-bikes-suffer.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/app": patch +--- + +fix(table-chart): wrap mode now breaks long URLs/IDs instead of overflowing into adjacent columns diff --git a/packages/app/src/HDXMultiSeriesTableChart.tsx b/packages/app/src/HDXMultiSeriesTableChart.tsx index 6d449c6c58..f4d0de403b 100644 --- a/packages/app/src/HDXMultiSeriesTableChart.tsx +++ b/packages/app/src/HDXMultiSeriesTableChart.tsx @@ -146,13 +146,20 @@ export const Table = ({ 'text-truncate': !wrapLinesEnabled, }); + // maxWidth: 100% prevents long unbreakable strings (URLs, + // hashes) from forcing the inner div wider than the table + // cell, which would visually overflow into the next column. + const cellDivStyle: React.CSSProperties = { + maxWidth: '100%', + }; + if (onRowClick) { return (
onRowClick(row.original, e)} @@ -180,7 +187,11 @@ export const Table = ({ ); } - return
{formattedValue}
; + return ( +
+ {formattedValue} +
+ ); }, size: i === numColumns - 2 @@ -336,7 +347,11 @@ export const Table = ({ > {row.getVisibleCells().map(cell => { return ( - + {flexRender( cell.column.columnDef.cell, cell.getContext(), diff --git a/packages/app/styles/_bootstrap-utilities.scss b/packages/app/styles/_bootstrap-utilities.scss index fa97c1583c..6fa6fee8cb 100644 --- a/packages/app/styles/_bootstrap-utilities.scss +++ b/packages/app/styles/_bootstrap-utilities.scss @@ -968,6 +968,26 @@ white-space: nowrap !important; } +// Word break — needed for cells in wrap mode so long URLs/identifiers +// without whitespace can break instead of overflowing into the next column. +.text-break { + word-wrap: break-word !important; + word-break: break-word !important; +} + +// Vertical alignment — applies to table cells (and inline/inline-block). +.align-top { + vertical-align: top !important; +} + +.align-middle { + vertical-align: middle !important; +} + +.align-bottom { + vertical-align: bottom !important; +} + // Font size utilities .fs-1 { font-size: 2.5rem !important; // 40px