From 9b2c7b56629fc8e7a456a98fd11c05da4fa6599f Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Wed, 5 Feb 2025 13:40:18 -0600 Subject: [PATCH] refine styles --- src/lib/scss/custom/pages/_chat.scss | 25 ++++++++++-- .../[conversationId]/chat-box.svelte | 39 ++++++++++++------- .../persist-log/persist-log.svelte | 2 + 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/src/lib/scss/custom/pages/_chat.scss b/src/lib/scss/custom/pages/_chat.scss index 77536cf7..cda9fe5e 100644 --- a/src/lib/scss/custom/pages/_chat.scss +++ b/src/lib/scss/custom/pages/_chat.scss @@ -102,6 +102,10 @@ height: 80%; max-height: 25px; } + + .chat-head-agent-name { + font-size: 0.8em; + } } .chat-head-user { @@ -109,7 +113,7 @@ display: flex; gap: 5px; width: fit-content; - font-size: 12px; + font-size: 0.7em !important; } } } @@ -127,6 +131,7 @@ display: flex; justify-content: flex-end; align-items: center; + gap: 5px; } .user-chat-nav { @@ -141,8 +146,14 @@ background-color: var(--#{$prefix}light); border-radius: 50%; border: none; - width: 40px; - height: 40px; + // width: 40px; + // height: 40px; + width: 2em; + height: 2em; + + i { + font-size: 0.8em; + } } .dropdown { @@ -176,6 +187,10 @@ border-top-left-radius: 0px; border-bottom-left-radius: 0px; } + + i, span { + font-size: 0.9em; + } } } @@ -420,6 +435,10 @@ .log-footer { flex: 2%; + + .log-footer-nav-btn { + font-size: 0.75em; + } } .instant-log-body { diff --git a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index 8d5c7585..75f11709 100644 --- a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -87,6 +87,7 @@ const params = $page.params; const messageLimit = 100; const screenWidthThreshold = 1024; + const chatWidthThreshold = 300; const maxTextLength = 64000; const duration = 2000; @@ -219,6 +220,7 @@ selectedTags = conversation?.tags || []; initUserSentMessages(dialogs); initChatView(); + handlePaneResize(); signalr.onMessageReceivedFromClient = onMessageReceivedFromClient; signalr.onMessageReceivedFromCsr = onMessageReceivedFromClient; @@ -659,7 +661,7 @@ if (disableSpeech) return; if (!isListening) { - llmRealtime.start(params.agentId, message => { + llmRealtime.start(params.agentId, (/** @type {any} */ message) => { console.log(message); }); isListening = true; @@ -1317,6 +1319,14 @@ isLoading = false; }); } + + function handlePaneResize() { + const header = document.querySelector('.chat-head'); + if (!header) return; + + const width = header.getBoundingClientRect().width; + isLite = width < chatWidthThreshold; + } @@ -1432,9 +1442,9 @@
- + handlePaneResize()}> {#if isLoadInstantLog} - + {/if} - +
@@ -1469,18 +1479,18 @@
-
    +
    {#if PUBLIC_DEBUG_MODE === 'true' && isFrame} -
  • +
    -
  • +
    {/if} -
  • +
    {#if !isLite} @@ -1547,9 +1557,9 @@ /> {/if} -
  • +
-
  • +
    {#if !isLite} {/if} -
  • - +
    +
    @@ -1869,7 +1878,7 @@ {#if isLoadPersistLog} - +