Skip to content

Commit 9c72720

Browse files
committed
hotfix: ui
1 parent b733b98 commit 9c72720

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/chat/ChatWidget.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export function ChatWidget({
675675
<>
676676
{/* Message Thread */}
677677
{messages.map((message) => (
678-
<div key={message.id} className={cn("flex gap-3", message.sender === 'user' && "flex-row-reverse")}>
678+
<div key={message.id} className={cn("flex gap-3 w-full", message.sender === 'user' && "flex-row-reverse")}>
679679
{message.sender === 'agent' && (
680680
<div
681681
className="w-8 h-8 rounded-lg shrink-0 flex items-center justify-center text-sm font-medium overflow-hidden"
@@ -691,7 +691,7 @@ export function ChatWidget({
691691
)}
692692
</div>
693693
)}
694-
<div className={cn("flex-1", message.sender === 'user' && "flex flex-col items-end")}>
694+
<div className={cn("flex-1 min-w-0 overflow-hidden", message.sender === 'user' && "flex flex-col items-end")}>
695695
{message.sender === 'user' ? (
696696
<div
697697
className="rounded-2xl rounded-tr-md px-4 py-3 max-w-[85%] shadow-sm"
@@ -703,7 +703,7 @@ export function ChatWidget({
703703
<p>{message.content}</p>
704704
</div>
705705
) : (
706-
<div className="max-w-[90%] pr-2">
706+
<div style={{ maxWidth: 'calc(100% - 16px)', overflow: 'hidden' }}>
707707
<div
708708
className="appgram-chat-markdown"
709709
style={{
@@ -809,24 +809,24 @@ export function ChatWidget({
809809
{message.sources && message.sources.length > 0 && (
810810
<div
811811
className="mt-4 pt-3"
812-
style={{ borderTop: `1px solid ${resolvedColors.border}` }}
812+
style={{ borderTop: `1px solid ${resolvedColors.border}`, overflow: 'hidden', width: '100%' }}
813813
>
814814
<p
815815
className="text-xs mb-2"
816816
style={{ color: resolvedColors.mutedForeground }}
817817
>
818818
Related articles
819819
</p>
820-
<div className="space-y-1.5">
820+
<div className="space-y-1.5 overflow-hidden">
821821
{message.sources.map((source) => (
822822
<button
823823
key={source.article_id}
824824
onClick={() => handleSourceClick(source)}
825-
className="flex items-center gap-2 text-xs hover:underline transition-colors text-left group"
825+
className="flex items-center gap-2 text-xs hover:underline transition-colors text-left group w-full min-w-0 max-w-full"
826826
style={{ color: accentColor }}
827827
>
828828
<FileTextIcon className="w-3.5 h-3.5 shrink-0 opacity-70 group-hover:opacity-100" />
829-
<span className="truncate">{source.title}</span>
829+
<span className="truncate min-w-0">{source.title}</span>
830830
</button>
831831
))}
832832
</div>

0 commit comments

Comments
 (0)