fix(chat): make queued message removal focusable (#1146)
Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
committed by
GitHub
co-authored by
Isaac Sanchez
parent
429ed0842e
commit
006e84dbc4
@@ -29,34 +29,34 @@ const QueuedMessageChip = memo(({ message, sessionId, onEdit }: QueuedMessageChi
|
|||||||
const attachmentCount = message.attachments?.length ?? 0;
|
const attachmentCount = message.attachments?.length ?? 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<div className="flex w-full items-center gap-1.5 text-sm h-5 px-1">
|
||||||
type="button"
|
<button
|
||||||
onClick={() => onEdit(message)}
|
type="button"
|
||||||
className="flex w-full items-center gap-1.5 text-sm hover:opacity-80 transition-opacity text-left h-5 px-1"
|
onClick={() => onEdit(message)}
|
||||||
>
|
className="flex min-w-0 flex-1 items-center gap-1.5 text-left hover:opacity-80 transition-opacity"
|
||||||
<RiMessage2Line
|
>
|
||||||
className="h-4 w-4 flex-shrink-0 text-muted-foreground"
|
<RiMessage2Line
|
||||||
/>
|
className="h-4 w-4 flex-shrink-0 text-muted-foreground"
|
||||||
<span className="text-muted-foreground flex-shrink-0">
|
/>
|
||||||
Queued
|
<span className="text-muted-foreground flex-shrink-0">
|
||||||
{attachmentCount > 0 && (
|
Queued
|
||||||
<span className="ml-1">{t('chat.queuedMessage.attachments', { count: attachmentCount })}</span>
|
{attachmentCount > 0 && (
|
||||||
)}
|
<span className="ml-1">{t('chat.queuedMessage.attachments', { count: attachmentCount })}</span>
|
||||||
</span>
|
)}
|
||||||
<span className="text-foreground truncate">
|
</span>
|
||||||
{firstLine || t('chat.queuedMessage.empty')}
|
<span className="text-foreground truncate">
|
||||||
</span>
|
{firstLine || t('chat.queuedMessage.empty')}
|
||||||
<span
|
</span>
|
||||||
onClick={(e) => {
|
</button>
|
||||||
e.stopPropagation();
|
<button
|
||||||
removeFromQueue(sessionId, message.id);
|
type="button"
|
||||||
}}
|
onClick={() => removeFromQueue(sessionId, message.id)}
|
||||||
className="flex items-center justify-center h-6 w-6 flex-shrink-0 hover:bg-[var(--interactive-hover)] rounded-full transition-colors cursor-pointer"
|
className="flex items-center justify-center h-6 w-6 flex-shrink-0 hover:bg-[var(--interactive-hover)] rounded-full transition-colors"
|
||||||
aria-label={t('chat.queuedMessage.removeAria')}
|
aria-label={t('chat.queuedMessage.removeAria')}
|
||||||
>
|
>
|
||||||
<RiCloseLine className="h-4 w-4 text-muted-foreground" />
|
<RiCloseLine className="h-4 w-4 text-muted-foreground" />
|
||||||
</span>
|
</button>
|
||||||
</button>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user