Commit a110b28a authored by edy's avatar edy

fix(chat): hide composer skill trigger

parent d3e07f3d
......@@ -67,18 +67,10 @@ export function ChatComposer({
viewMode,
shellStyle,
attachmentInputRef,
skillMenuRef,
attachmentAccept,
attachments,
placeholder,
sendButtonLabel,
skillMenuTitle,
defaultChatLabel,
defaultSkillId,
selectedSkillId,
selectedSkillName,
skills,
skillMenuOpen,
attachmentIcon,
submitIcon,
onSubmit,
......@@ -87,9 +79,6 @@ export function ChatComposer({
onAttachmentSelection,
onOpenAttachmentPicker,
onRemoveAttachment,
onToggleSkillMenu,
onClearSelectedSkill,
onChooseSkill,
onDragEnter,
onDragOver,
onDragLeave,
......@@ -164,38 +153,10 @@ export function ChatComposer({
</div>
) : null}
<div className="composer-footer">
<div className="composer-left-tools" ref={skillMenuRef}>
<div className="composer-left-tools">
<button type="button" className="attachment-trigger icon-only" disabled={!isBound || sending} onClick={onOpenAttachmentPicker} aria-label="上传附件" title="上传附件">
{attachmentIcon}
</button>
<button type="button" className="skill-trigger" disabled={!isBound} aria-label={skillMenuTitle} aria-expanded={skillMenuOpen} onClick={onToggleSkillMenu}>
@
</button>
{selectedSkillId !== defaultSkillId ? (
<button type="button" className="skill-chip" disabled={!isBound} onClick={onClearSelectedSkill}>
{"@" + selectedSkillName}
</button>
) : null}
{skillMenuOpen ? (
<div className="skill-menu" role="menu" aria-label={skillMenuTitle}>
{skills.map((skill) => {
const active = skill.id === selectedSkillId
return (
<button
key={skill.id}
type="button"
role="menuitemradio"
aria-checked={active}
className={"skill-menu-item" + (active ? " active" : "")}
onClick={() => onChooseSkill(skill.id)}
>
<strong>{skill.id === defaultSkillId ? defaultChatLabel : "@" + skill.name}</strong>
<span>{skill.description}</span>
</button>
)
})}
</div>
) : null}
</div>
<button
type="submit"
......
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 to comment