Commit c5600f9b by QuentinHsu

perf(channels): compact model test row actions

- replace per-model test text buttons with icon-only actions matching the channel list.
- let the action column shrink to its icon content to reduce table width.
parent b35dfa32
...@@ -26,6 +26,7 @@ import { ...@@ -26,6 +26,7 @@ import {
Check, Check,
CheckCircle2, CheckCircle2,
Copy, Copy,
Gauge,
Info, Info,
Loader2, Loader2,
Settings, Settings,
...@@ -293,7 +294,7 @@ function getTestTableColumnClass(columnId: string) { ...@@ -293,7 +294,7 @@ function getTestTableColumnClass(columnId: string) {
case 'result': case 'result':
return 'w-80 min-w-80 max-w-80 whitespace-normal' return 'w-80 min-w-80 max-w-80 whitespace-normal'
case 'actions': case 'actions':
return 'bg-popover w-24 min-w-24 whitespace-nowrap sm:w-28 sm:min-w-28' return 'bg-popover w-px whitespace-nowrap'
default: default:
return undefined return undefined
} }
...@@ -922,17 +923,26 @@ function ChannelTestDialogContent({ ...@@ -922,17 +923,26 @@ function ChannelTestDialogContent({
const isTestingModel = testingModels.has(model) const isTestingModel = testingModels.has(model)
return ( return (
<Tooltip>
<TooltipTrigger
render={
<Button <Button
variant='outline' variant='ghost'
size='sm' size='icon-sm'
onClick={() => testSingleModel(model)} onClick={() => testSingleModel(model)}
disabled={isTestingModel || isBatchTesting} disabled={isTestingModel || isBatchTesting}
aria-label={t('Test Connection')}
/>
}
> >
{isTestingModel && ( {isTestingModel ? (
<Loader2 className='animate-spin' data-icon='inline-start' /> <Loader2 className='size-4 animate-spin' />
) : (
<Gauge className='size-4' />
)} )}
{t('Test')} </TooltipTrigger>
</Button> <TooltipContent>{t('Test Connection')}</TooltipContent>
</Tooltip>
) )
}, },
enableSorting: false, enableSorting: false,
...@@ -1130,7 +1140,7 @@ function ChannelTestDialogContent({ ...@@ -1130,7 +1140,7 @@ function ChannelTestDialogContent({
<col className='w-auto' /> <col className='w-auto' />
<col className='w-28' /> <col className='w-28' />
<col className='w-80' /> <col className='w-80' />
<col className='w-auto' /> <col className='w-px' />
</colgroup> </colgroup>
} }
getColumnClassName={(columnId) => getColumnClassName={(columnId) =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment