Skip to content

Commit b733b98

Browse files
committed
hotfix: chatwidget ui
1 parent 899b695 commit b733b98

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/components/chat/ChatWidget.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,11 @@ export function ChatWidget({
607607
{/* Chat Area */}
608608
<div
609609
ref={chatContainerRef}
610-
className="flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-5"
610+
className="flex-1 overflow-y-auto overflow-x-hidden p-4 pr-5 space-y-5"
611611
style={{
612612
backgroundColor: resolvedColors.chatBackground,
613-
// Contain content to prevent horizontal overflow
614613
overscrollBehavior: 'contain',
614+
wordBreak: 'break-word',
615615
}}
616616
>
617617
{!showChat ? (
@@ -703,19 +703,22 @@ export function ChatWidget({
703703
<p>{message.content}</p>
704704
</div>
705705
) : (
706-
<div className="max-w-[95%]">
706+
<div className="max-w-[90%] pr-2">
707707
<div
708708
className="appgram-chat-markdown"
709709
style={{
710710
color: resolvedColors.foreground,
711711
fontSize: 'inherit',
712712
lineHeight: '1.6',
713+
wordBreak: 'break-word',
714+
overflowWrap: 'break-word',
715+
whiteSpace: 'pre-wrap',
713716
}}
714717
>
715718
<ReactMarkdown
716719
components={{
717720
p: ({ children }) => (
718-
<p style={{ margin: '0 0 0.75em 0' }}>{children}</p>
721+
<p style={{ margin: '0 0 0.75em 0', wordBreak: 'break-word', overflowWrap: 'break-word' }}>{children}</p>
719722
),
720723
a: ({ href, children }) => (
721724
<a
@@ -765,9 +768,13 @@ export function ChatWidget({
765768
backgroundColor: resolvedColors.border,
766769
padding: '0.75em',
767770
borderRadius: '8px',
768-
overflow: 'auto',
771+
overflowX: 'auto',
772+
overflowY: 'hidden',
769773
margin: '0.5em 0',
770774
fontSize: '0.875em',
775+
maxWidth: '100%',
776+
whiteSpace: 'pre-wrap',
777+
wordBreak: 'break-word',
771778
}}
772779
>
773780
{children}

0 commit comments

Comments
 (0)