From 08f6445d6faf998958dfc2e825f568998d567a2f Mon Sep 17 00:00:00 2001 From: BeepBeepBopBop <116374330+BeepBeepBopBop@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:14:09 +0100 Subject: [PATCH] cc --- LM-Kit-Maestro/UI/Razor/Components/Chat.razor | 106 +++++++++--------- .../UI/Razor/Components/Chat.razor.css | 23 ++-- LM-Kit-Maestro/wwwroot/js/lmkitmaestro.js | 13 ++- 3 files changed, 73 insertions(+), 69 deletions(-) diff --git a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor index e4e44f94..ef13f538 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor +++ b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor @@ -10,7 +10,7 @@ @inherits MvvmComponentBase
-
+
@@ -26,64 +26,62 @@
-
- @if (ViewModel?.ConversationListViewModel.CurrentConversation != null) + @if (ViewModel?.ConversationListViewModel.CurrentConversation != null) + { + if (ViewModel.ConversationListViewModel.CurrentConversation.IsEmpty) { - if (ViewModel.ConversationListViewModel.CurrentConversation.IsEmpty) - { -
-
-
Maestro at your service—let’s orchestrate something - amazing! -
-
- Feel free to ask questions, explore ideas, or engage in meaningful conversations. - -
-
- Whether you need assistance, inspiration, or just some lighthearted chat, I'm here to - help. +
+
+
Maestro at your service—let’s orchestrate something + amazing! +
+
+ Feel free to ask questions, explore ideas, or engage in meaningful conversations. -
+
+
+ Whether you need assistance, inspiration, or just some lighthearted chat, I'm here to + help.
-
-
- Press Enter to send a new message -
+
+ +
+
+ Press Enter to send a new message +
-
- Hold Shift + Enter to insert a new line -
+
+ Hold Shift + Enter to insert a new line
- } - else - { -
- @foreach (var message in ViewModel.ConversationListViewModel.CurrentConversation.Messages) - { - - } -
- } +
} - -
-
- @if (!IsScrolledToEnd) + else + { +
+ @foreach (var message in ViewModel.ConversationListViewModel.CurrentConversation.Messages) { - + } + +
+
+ @if (!IsScrolledToEnd) + { + + } +
+
-
-
+ } + } +
@@ -92,17 +90,17 @@
@if (ViewModel?.ConversationListViewModel?.CurrentConversation?.LMKitConversation?.ContextSize > 0) { - - Tokens: @ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextUsedSpace / - @ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextSize - (@CalculateUsagePercentage(ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextUsedSpace, - ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextSize)%) - + + Tokens: @ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextUsedSpace / + @ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextSize + (@CalculateUsagePercentage(ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextUsedSpace, + ViewModel.ConversationListViewModel.CurrentConversation.LMKitConversation.ContextSize)%) + }
-@*
*@ diff --git a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.css b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.css index 6044d5fd..9957e366 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.css +++ b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.css @@ -16,6 +16,9 @@ height: 100%; width: 100%; scrollbar-gutter: both-edges stable; + margin: auto; + display: flex; + flex-direction: column; } #chat-messages::-webkit-scrollbar { @@ -79,16 +82,17 @@ body.mac .chat-element { justify-content: center; } -#message-list { - margin: auto; - display: flex; - flex-direction: column; -} - #empty-conversation { - flex-direction: column; - gap: 32px; + height: 100%; +/* gap: 32px; display: flex; + align-items: center; + height: 100%; + justify-content: center; + background-color: red; + margin-inline: 0 auto; + width: 100%; + text-align: center;*/ } #chat-info { @@ -133,13 +137,12 @@ body.mac .chat-element { } .sidebar-hide { - visibility: collapse; + display: none; } .sidebar-show { overflow-y: auto; background-color: var(--Surface); - visibility: visible; width: 300px; min-width: 300px; max-width: 300px; diff --git a/LM-Kit-Maestro/wwwroot/js/lmkitmaestro.js b/LM-Kit-Maestro/wwwroot/js/lmkitmaestro.js index 5f1a5bfd..eaa42693 100644 --- a/LM-Kit-Maestro/wwwroot/js/lmkitmaestro.js +++ b/LM-Kit-Maestro/wwwroot/js/lmkitmaestro.js @@ -44,11 +44,14 @@ function setUserInputFocus() { } function scrollToEnd(smooth) { - const container = document.getElementById('chat-messages'); - container.scrollTo({ - top: container.scrollHeight, - behavior: smooth ? 'smooth' : 'auto' - }); + const element = document.getElementById('chat-messages'); + + if (element != null) { + element.scrollTo({ + top: element.scrollHeight, + behavior: smooth ? 'smooth' : 'auto' + }); + } }