diff --git a/frontend/src/components/Chat/MessageList.styles.ts b/frontend/src/components/Chat/MessageList.styles.ts
index 278b7732c9..6d2c44480d 100644
--- a/frontend/src/components/Chat/MessageList.styles.ts
+++ b/frontend/src/components/Chat/MessageList.styles.ts
@@ -3,6 +3,7 @@ import { makeStyles, tokens } from '@fluentui/react-components'
export const useMessageListStyles = makeStyles({
root: {
flex: 1,
+ minWidth: 0,
overflowY: 'auto',
padding: tokens.spacingVerticalXXL,
display: 'flex',
@@ -12,7 +13,8 @@ export const useMessageListStyles = makeStyles({
message: {
display: 'flex',
gap: tokens.spacingHorizontalM,
- maxWidth: '800px',
+ minWidth: 0,
+ maxWidth: 'min(800px, 100%)',
alignSelf: 'flex-start',
},
userMessage: {
@@ -25,6 +27,8 @@ export const useMessageListStyles = makeStyles({
padding: tokens.spacingVerticalM,
borderRadius: tokens.borderRadiusMedium,
flex: 1,
+ minWidth: 0,
+ maxWidth: '100%',
},
userMessageContent: {
backgroundColor: tokens.colorBrandBackground2,
@@ -80,13 +84,20 @@ export const useMessageListStyles = makeStyles({
flexWrap: 'wrap',
gap: tokens.spacingHorizontalS,
marginTop: tokens.spacingVerticalS,
+ minWidth: 0,
+ maxWidth: '100%',
+ },
+ attachmentItem: {
+ minWidth: 0,
+ maxWidth: '100%',
},
imageContainer: {
position: 'relative' as const,
display: 'inline-block',
- maxWidth: '400px',
+ width: 'fit-content',
+ maxWidth: 'min(400px, 100%)',
maxHeight: '400px',
- minWidth: '100px',
+ minWidth: 'min(100px, 100%)',
minHeight: '60px',
},
imageSpinner: {
@@ -96,14 +107,17 @@ export const useMessageListStyles = makeStyles({
transform: 'translate(-50%, -50%)',
},
attachmentPreview: {
- maxWidth: '400px',
+ display: 'block',
+ width: 'auto',
+ height: 'auto',
+ maxWidth: '100%',
maxHeight: '400px',
borderRadius: tokens.borderRadiusMedium,
objectFit: 'contain',
border: `1px solid ${tokens.colorNeutralStroke1}`,
},
attachmentPreviewHidden: {
- maxWidth: '400px',
+ maxWidth: '100%',
maxHeight: '400px',
borderRadius: tokens.borderRadiusMedium,
objectFit: 'contain',
@@ -113,11 +127,18 @@ export const useMessageListStyles = makeStyles({
height: 0,
},
videoPreview: {
- maxWidth: '400px',
+ display: 'block',
+ width: 'auto',
+ height: 'auto',
+ maxWidth: 'min(400px, 100%)',
maxHeight: '300px',
borderRadius: tokens.borderRadiusMedium,
border: `1px solid ${tokens.colorNeutralStroke1}`,
},
+ audioPreview: {
+ width: '300px',
+ maxWidth: '100%',
+ },
attachmentFile: {
display: 'flex',
alignItems: 'center',
@@ -126,6 +147,8 @@ export const useMessageListStyles = makeStyles({
backgroundColor: tokens.colorNeutralBackground1,
borderRadius: tokens.borderRadiusMedium,
border: `1px solid ${tokens.colorNeutralStroke1}`,
+ minWidth: 0,
+ maxWidth: '100%',
},
attachmentFileName: {
flex: 1,
diff --git a/frontend/src/components/Chat/MessageList.tsx b/frontend/src/components/Chat/MessageList.tsx
index f0e0a7d49e..64a2d4caa4 100644
--- a/frontend/src/components/Chat/MessageList.tsx
+++ b/frontend/src/components/Chat/MessageList.tsx
@@ -78,7 +78,7 @@ function MediaWithFallback({ type, src, className }: { type: 'video' | 'audio';
if (type === 'video') {
return
}
- return
+ return
}
/**
@@ -152,7 +152,7 @@ export default function MessageList({ messages, onCopyToInput, onCopyToNewConver
}
return (
-
+
{messages.map((message, index) => {
if (message.role === 'system') return null
const isUser = message.role === 'user'
@@ -209,10 +209,10 @@ export default function MessageList({ messages, onCopyToInput, onCopyToNewConver
{message.originalAttachments && message.originalAttachments.length > 0 && (
{message.originalAttachments.map((att, i) => (
-
+
{att.type === 'image' &&
}
{att.type === 'video' &&
}
- {att.type === 'audio' &&
}
+ {att.type === 'audio' &&
}
{att.type === 'file' &&
📄 {att.name}
}
))}
@@ -263,7 +263,7 @@ export default function MessageList({ messages, onCopyToInput, onCopyToNewConver
{message.attachments && message.attachments.length > 0 && (
{message.attachments.map((att, attIndex) => (
-
+
{att.type === 'image' && (
)}
{att.type === 'audio' && (
-
+
)}
{att.type === 'file' && (