feat: skill tag的复数处理。测试复skill的数量

This commit is contained in:
肖应宇 2026-04-09 11:37:51 +08:00 committed by Titan
parent 5606519619
commit f3f87e220e
2 changed files with 14 additions and 5 deletions

View File

@ -313,6 +313,9 @@ export function IframeTestPanel() {
selectedSkills: [
{ id: "5", name: "文档处理" },
{ id: "1216", name: "市场研究报告" },
{ id: "1245", name: "市场研究报告" },
{ id: "520", name: "市场研究报告" },
{ id: "409", name: "市场研究报告" },
],
},
"*",

View File

@ -366,7 +366,7 @@ export function InputBox({
"pointer-events-none invisible h-[0px] translate-y-2 p-[0px] opacity-0",
)}
>
<PromptInputTools>
<PromptInputTools className="min-w-0 flex-1">
{/* TODO: Add more connectors here
<PromptInputActionMenu>
<PromptInputActionMenuTrigger className="px-2!" />
@ -654,10 +654,10 @@ function IframeSkillDialogButton({
const { t } = useI18n();
return (
<div className="flex items-center gap-2">
<div className="flex min-w-0 flex-1 items-center gap-2">
<Tooltip content={t.inputBox.selectSkill}>
<PromptInputButton
className={cn("group px-2! hover:bg-[#EAE2F5]", className)}
className={cn("group shrink-0 px-2! hover:bg-[#EAE2F5]", className)}
onClick={openSkillDialog}
>
<svg
@ -680,9 +680,15 @@ function IframeSkillDialogButton({
</Tag>
) : null}
{!isBootstrapping && selectedSkills.length > 0 ? (
<div className="flex flex-wrap items-center gap-2">
<div
className="flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overflow-y-hidden whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
onWheel={(event) => {
if (event.deltaY === 0) return;
event.currentTarget.scrollLeft += event.deltaY;
}}
>
{selectedSkills.map((skill, index) => (
<Tag key={`${skill.skill_id}-${skill.title}-${index}`}>
<Tag key={`${skill.skill_id}-${skill.title}-${index}`} className="shrink-0">
{skill.title}
{/* TODO: 因为后端接口不支持取消选择skill所以暂时禁用取消选择按钮 */}
{/* <button