{/* 筛选与工具并入同一行(宽屏单行,窄屏自动换行),让出更多图片可视高度 */}
{(modelOptions.length > 0 || sizeOptions.length > 0) && (
}
placeholder={t('搜索...')}
value={searchInput}
onChange={setSearchInput}
aria-label={t('搜索...')}
className='image-task-search'
showClear
/>
{/* 密度切换 */}
}
onClick={() => updatePrefs({ density: 'comfortable' })}
>
{t('舒适')}
}
onClick={() => updatePrefs({ density: 'compact' })}
>
{t('紧凑')}
}
onClick={() => updatePrefs({ density: 'grid' })}
>
{t('网格')}
}
>
) : density === 'compact' ? (
) : (
)
}
theme='outline'
aria-label={t('切换显示密度')}
title={t('切换显示密度')}
/>
{/* 多选模式切换 */}
}
theme={selectMode ? 'light' : 'outline'}
type={selectMode ? 'primary' : 'tertiary'}
onClick={() => {
if (selectMode) exitSelectMode();
else setSelectMode(true);
}}
aria-label={t('对比模式')}
aria-pressed={selectMode}
title={t('对比模式')}
/>
{/* 收藏过滤 */}
}
theme={favOnly ? 'light' : 'outline'}
onClick={() => setFavOnly((v) => !v)}
aria-label={t('只看收藏')}
aria-pressed={favOnly}
title={t('只看收藏')}
/>
}
theme='outline'
onClick={() => onRefresh(true, false)}
aria-label={t('刷新任务列表')}
title={t('刷新任务列表')}
/>