mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-03 04:43:01 +00:00
fix(web): truncate long task IDs so they stay inside their column
The task-log and MJ task ID cells used a w-max wrapper, so long IDs (and the platform/action subtitle) overflowed the column and rendered under the adjacent Cost column. Constrain the cell to the column width and let the badge label ellipsize; the copy button still copies the full ID.
This commit is contained in:
+2
-2
@@ -153,12 +153,12 @@ export function useDrawingLogsColumns(
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='flex w-max flex-col gap-0.5'>
|
||||
<div className='flex min-w-0 flex-col items-start gap-0.5'>
|
||||
<CopyableStatusBadge
|
||||
value={mjId}
|
||||
variant='neutral'
|
||||
size='sm'
|
||||
className='font-mono'
|
||||
className='max-w-full min-w-0 shrink overflow-hidden font-mono [&>[data-slot=status-badge-label]]:min-w-0 [&>[data-slot=status-badge-label]]:max-w-full [&>[data-slot=status-badge-label]]:shrink [&>[data-slot=status-badge-label]]:overflow-hidden [&>[data-slot=status-badge-label]]:text-ellipsis'
|
||||
>
|
||||
{mjId}
|
||||
</CopyableStatusBadge>
|
||||
|
||||
+4
-3
@@ -135,22 +135,23 @@ export function useTaskLogsColumns(isAdmin: boolean): ColumnDef<TaskLog>[] {
|
||||
return <span className='text-subtle-foreground text-xs'>-</span>
|
||||
}
|
||||
return (
|
||||
<div className='flex w-max flex-col gap-0.5'>
|
||||
<div className='flex min-w-0 flex-col items-start gap-0.5'>
|
||||
<CopyableStatusBadge
|
||||
value={taskId}
|
||||
variant='neutral'
|
||||
size='sm'
|
||||
className='font-mono'
|
||||
className='max-w-full min-w-0 shrink overflow-hidden font-mono [&>[data-slot=status-badge-label]]:min-w-0 [&>[data-slot=status-badge-label]]:max-w-full [&>[data-slot=status-badge-label]]:shrink [&>[data-slot=status-badge-label]]:overflow-hidden [&>[data-slot=status-badge-label]]:text-ellipsis'
|
||||
>
|
||||
{taskId}
|
||||
</CopyableStatusBadge>
|
||||
<span className='text-subtle-foreground max-w-[200px] truncate text-xs'>
|
||||
<span className='text-subtle-foreground max-w-full truncate text-xs'>
|
||||
{getTaskPlatformName(log.platform)} ·{' '}
|
||||
{t(taskActionMapper.getLabel(log.action))}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
size: 260,
|
||||
meta: {
|
||||
cardRole: 'title',
|
||||
cardSpan: 2,
|
||||
|
||||
Reference in New Issue
Block a user