fix(web): prevent list cell text and badge overflow (#5510)
* fix(ui): prevent table cell text overflow - add default truncation with hover details for text cells in shared and static data tables to prevent content from spilling into adjacent columns. - adjust API key group, model, and IP restriction columns to fix badge overlap and left alignment drift. - reuse a shared truncated cell component and add width constraints for composite badge cells. * fix(table): prevent badge content from overflowing columns - make table text and badge cells shrink within constrained columns so long values truncate instead of bleeding into adjacent cells. - add a shared BadgeCell wrapper to keep badge alignment consistent across API keys and other list pages. - update affected list views to use constrained wrappers for group, provider, pricing, OAuth, and API info values.
This commit is contained in:
+5
-3
@@ -60,6 +60,7 @@ export function GroupBadge(props: GroupBadgeProps) {
|
||||
ratio,
|
||||
copyable = false,
|
||||
showDot,
|
||||
className,
|
||||
...badgeProps
|
||||
} = props
|
||||
const groupName = group?.trim()
|
||||
@@ -82,6 +83,7 @@ export function GroupBadge(props: GroupBadgeProps) {
|
||||
showDot={showDot ?? (isSpecialGroup ? false : undefined)}
|
||||
variant={isSpecialGroup ? 'neutral' : undefined}
|
||||
autoColor={isSpecialGroup ? undefined : groupName}
|
||||
className={cn('min-w-0 shrink overflow-hidden', className)}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -90,11 +92,11 @@ export function GroupBadge(props: GroupBadgeProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<span className='inline-flex items-center gap-2 text-xs'>
|
||||
{badge}
|
||||
<span className='inline-flex max-w-full min-w-0 items-center gap-2 text-xs'>
|
||||
<span className='max-w-full min-w-0 overflow-hidden'>{badge}</span>
|
||||
<span
|
||||
className={cn(
|
||||
'inline-flex h-5 items-center rounded-full px-1.5 font-mono text-xs leading-none font-medium tabular-nums',
|
||||
'inline-flex h-5 shrink-0 items-center rounded-full px-1.5 font-mono text-xs leading-none font-medium tabular-nums',
|
||||
getGroupRatioClassName(ratio)
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user