refactor(credential-selector): enhance layout with overflow handling for better UI responsiveness

This commit is contained in:
twwu 2025-08-22 14:49:24 +08:00
parent 2f6c51927e
commit 83cc3b4710
4 changed files with 5 additions and 4 deletions

View File

@ -47,7 +47,7 @@ const CredentialSelector = ({
mainAxis: 4,
}}
>
<PortalToFollowElemTrigger onClick={toggle}>
<PortalToFollowElemTrigger onClick={toggle} className='grow overflow-hidden'>
<Trigger
currentCredential={currentCredential}
pluginName={pluginName}

View File

@ -35,8 +35,8 @@ const Trigger = ({
name={name}
size={20}
/>
<div className='flex items-center gap-x-1'>
<span className='system-md-semibold min-w-0 truncate text-text-secondary'>
<div className='flex grow items-center gap-x-1 overflow-hidden'>
<span className='system-md-semibold grow truncate text-text-secondary'>
{t('datasetPipeline.credentialSelector.name', {
credentialName: name,
pluginName,

View File

@ -23,7 +23,7 @@ const Header = ({
return (
<div className='flex items-center gap-x-2'>
<div className='flex grow items-center gap-x-1'>
<div className='flex grow items-center gap-x-1 overflow-hidden'>
<CredentialSelector
{...rest}
/>

View File

@ -65,6 +65,7 @@ const getIcon = (type: BlockEnum, className: string) => {
[BlockEnum.Agent]: <Agent className={className} />,
[BlockEnum.KnowledgeBase]: <KnowledgeBase className={className} />,
[BlockEnum.DataSource]: <Datasource className={className} />,
[BlockEnum.DataSourceEmpty]: <></>,
}[type]
}
const ICON_CONTAINER_BG_COLOR_MAP: Record<string, string> = {