Commit a110b28a authored by edy's avatar edy

fix(chat): hide composer skill trigger

parent d3e07f3d
...@@ -67,18 +67,10 @@ export function ChatComposer({ ...@@ -67,18 +67,10 @@ export function ChatComposer({
viewMode, viewMode,
shellStyle, shellStyle,
attachmentInputRef, attachmentInputRef,
skillMenuRef,
attachmentAccept, attachmentAccept,
attachments, attachments,
placeholder, placeholder,
sendButtonLabel, sendButtonLabel,
skillMenuTitle,
defaultChatLabel,
defaultSkillId,
selectedSkillId,
selectedSkillName,
skills,
skillMenuOpen,
attachmentIcon, attachmentIcon,
submitIcon, submitIcon,
onSubmit, onSubmit,
...@@ -87,9 +79,6 @@ export function ChatComposer({ ...@@ -87,9 +79,6 @@ export function ChatComposer({
onAttachmentSelection, onAttachmentSelection,
onOpenAttachmentPicker, onOpenAttachmentPicker,
onRemoveAttachment, onRemoveAttachment,
onToggleSkillMenu,
onClearSelectedSkill,
onChooseSkill,
onDragEnter, onDragEnter,
onDragOver, onDragOver,
onDragLeave, onDragLeave,
...@@ -164,38 +153,10 @@ export function ChatComposer({ ...@@ -164,38 +153,10 @@ export function ChatComposer({
</div> </div>
) : null} ) : null}
<div className="composer-footer"> <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="上传附件"> <button type="button" className="attachment-trigger icon-only" disabled={!isBound || sending} onClick={onOpenAttachmentPicker} aria-label="上传附件" title="上传附件">
{attachmentIcon} {attachmentIcon}
</button> </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> </div>
<button <button
type="submit" 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