From 7e5d8e7294cdf7affa9fb6aeee67148d7cde40b0 Mon Sep 17 00:00:00 2001 From: Ilango Date: Mon, 22 Jan 2024 11:10:27 +0530 Subject: [PATCH] Fix image uploads appear on top of chat messages. Now image uploads will appear above the text input on its own row. --- .../src/views/chatmessage/ChatExpandDialog.js | 7 +- .../ui/src/views/chatmessage/ChatMessage.css | 28 ++-- .../ui/src/views/chatmessage/ChatMessage.js | 140 +++++++++--------- .../ui/src/views/chatmessage/ChatPopUp.js | 9 +- 4 files changed, 95 insertions(+), 89 deletions(-) diff --git a/packages/ui/src/views/chatmessage/ChatExpandDialog.js b/packages/ui/src/views/chatmessage/ChatExpandDialog.js index 1b2037a87..e2044ea37 100644 --- a/packages/ui/src/views/chatmessage/ChatExpandDialog.js +++ b/packages/ui/src/views/chatmessage/ChatExpandDialog.js @@ -21,7 +21,7 @@ const ChatExpandDialog = ({ show, dialogProps, onClear, onCancel }) => { aria-describedby='alert-dialog-description' sx={{ overflow: 'visible' }} > - +
{dialogProps.title}
@@ -43,7 +43,10 @@ const ChatExpandDialog = ({ show, dialogProps, onClear, onCancel }) => { )}
- + diff --git a/packages/ui/src/views/chatmessage/ChatMessage.css b/packages/ui/src/views/chatmessage/ChatMessage.css index 9e7a18577..c00186bf7 100644 --- a/packages/ui/src/views/chatmessage/ChatMessage.css +++ b/packages/ui/src/views/chatmessage/ChatMessage.css @@ -1,8 +1,6 @@ .messagelist { width: 100%; - height: 100%; - overflow-y: scroll; - overflow-x: hidden; + height: auto; border-radius: 0.5rem; } @@ -108,32 +106,38 @@ } .center { + width: 100%; display: flex; justify-content: center; align-items: center; position: relative; flex-direction: column; - padding: 10px; + padding: 12px; } -.cloud { +.cloud-wrapper, +.cloud-dialog-wrapper { width: 400px; height: calc(100vh - 260px); - overflow-y: scroll; - border-radius: 0.5rem; display: flex; - justify-content: center; - align-items: center; + align-items: start; + justify-content: start; + flex-direction: column; } +.cloud-dialog-wrapper { + width: 100%; +} + +.cloud, .cloud-dialog { width: 100%; - height: 100vh; + height: auto; + max-height: calc(100% - 72px); overflow-y: scroll; - border-radius: 0.5rem; display: flex; justify-content: center; - align-items: center; + align-items: start; } .cloud-message { diff --git a/packages/ui/src/views/chatmessage/ChatMessage.js b/packages/ui/src/views/chatmessage/ChatMessage.js index 155b3e990..db2ed7492 100644 --- a/packages/ui/src/views/chatmessage/ChatMessage.js +++ b/packages/ui/src/views/chatmessage/ChatMessage.js @@ -703,7 +703,14 @@ export const ChatMessage = ({ open, chatflowid, isDialog }) => { )} {message.fileUploads && message.fileUploads.length > 0 && ( -
+
{message.fileUploads.map((item, index) => { return ( <> @@ -833,9 +840,9 @@ export const ChatMessage = ({ open, chatflowid, isDialog }) => {
-
+
{previews && previews.length > 0 && ( - + {previews.map((item, index) => ( <> {item.mime.startsWith('image/') ? ( @@ -886,85 +893,70 @@ export const ChatMessage = ({ open, chatflowid, isDialog }) => { ))} )} - -
- -
-
-
- + + + + + + + ) + } + endAdornment={ + <> + {isChatFlowAvailableForUploads && ( + onMicrophonePressed()} type='button' disabled={loading || !chatflowid} - edge='start' + edge='end' > - - ) - } - endAdornment={ - <> - {isChatFlowAvailableForSpeech && ( - - onMicrophonePressed()} - type='button' - disabled={loading || !chatflowid} - edge='end' - > - - - - )} - - - {loading ? ( -
- -
- ) : ( - // Send icon SVG in input field - - )} -
-
- - } - /> - {isChatFlowAvailableForUploads && ( - - )} - -
+ )} + + + {loading ? ( +
+ +
+ ) : ( + // Send icon SVG in input field + + )} +
+
+ + } + /> + {isChatFlowAvailableForUploads && ( + + )} +
setSourceDialogOpen(false)} /> diff --git a/packages/ui/src/views/chatmessage/ChatPopUp.js b/packages/ui/src/views/chatmessage/ChatPopUp.js index 670fb00f0..91ba73e23 100644 --- a/packages/ui/src/views/chatmessage/ChatPopUp.js +++ b/packages/ui/src/views/chatmessage/ChatPopUp.js @@ -191,7 +191,14 @@ export const ChatPopUp = ({ chatflowid }) => { - +