Skip to content

Commit

Permalink
Merge pull request #180 from iceljc/features/refine-chat-window
Browse files Browse the repository at this point in the history
Features/refine chat window
  • Loading branch information
iceljc authored Aug 2, 2024
2 parents 915d3e6 + df17cbd commit 713a3a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import RichContent from './rich-content/rich-content.svelte';
import RcMessage from "./rich-content/rc-message.svelte";
import RcDisclaimer from './rich-content/rc-disclaimer.svelte';
import MessageImageGallery from '$lib/common/MessageImageGallery.svelte';
import MessageFileGallery from '$lib/common/MessageFileGallery.svelte';
import ChatImageUploader from './chat-util/chat-image-uploader.svelte';
import ChatImageGallery from './chat-util/chat-image-gallery.svelte';
import PersistLog from './persist-log/persist-log.svelte';
Expand Down Expand Up @@ -444,7 +444,7 @@
// @ts-ignore
postback: {
...postback,
payload: `${postback?.payload || msgText || ''} ${filePayload}`
payload: `${postback?.payload || msgText || ''}\r\n${filePayload}`
}
};
}
Expand All @@ -470,7 +470,7 @@
// @ts-ignore
postback: {
...postback,
payload: `${postback?.payload || msgText || ''} ${filePayload}`
payload: `${postback?.payload || msgText || ''}\r\n${filePayload}`
}
};
}
Expand Down Expand Up @@ -623,7 +623,7 @@
if (audioCount > 0) {
fileStrs.push(`${audioCount} audio ${audioCount > 1 ? 'files' : 'file'}`);
}
return prefix + fileStrs.join(' and ');
return prefix + fileStrs.join(' and ') + '.';
}
function endChat() {
Expand Down Expand Up @@ -1083,7 +1083,7 @@
<RcDisclaimer content={message.post_action_disclaimer} />
{/if}
{#if !!message.is_chat_message || !!message.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryStyles={'justify-content: flex-end;'}
fetchFiles={() => getConversationFiles(params.conversationId, message.message_id, FileSourceType.User)}
/>
Expand Down Expand Up @@ -1113,7 +1113,7 @@
<RcMessage message={message} />
<AudioSpeaker text={message?.rich_content?.message?.text || message?.text} />
{#if !!message.is_chat_message || !!message.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryStyles={'justify-content: flex-start;'}
fetchFiles={() => getConversationFiles(params.conversationId, message.message_id, FileSourceType.Bot)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { _ } from 'svelte-i18n'
import { USER_SENDERS } from '$lib/helpers/constants';
import Markdown from '$lib/common/Markdown.svelte';
import MessageImageGallery from '$lib/common/MessageImageGallery.svelte';
import MessageFileGallery from '$lib/common/MessageFileGallery.svelte';
import { FileSourceType } from '$lib/helpers/enums';
/** @type {import('$types').ChatResponseModel[]} */
Expand Down Expand Up @@ -70,7 +70,7 @@
<Markdown text={dialog?.rich_content?.message?.text || dialog?.text} containerClasses={'text-primary'} />
</p>
{#if !!dialog.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryClasses={'dialog-file-display'}
fetchFiles={() => getConversationFiles(conversation.id, dialog.message_id, showInRight(dialog) ? FileSourceType.User : FileSourceType.Bot)}
/>
Expand Down

0 comments on commit 713a3a8

Please sign in to comment.