Skip to content

Commit

Permalink
Introduced chat tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
lcarrere committed Dec 7, 2024
1 parent dbb6b57 commit 9e10688
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
24 changes: 11 additions & 13 deletions LM-Kit-Maestro/UI/Razor/Components/ChatMessage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,32 @@

@if (MessageViewModel.Sender == MessageSender.User || (MessageViewModel.Sender == MessageSender.Assistant && !MessageViewModel.MessageInProgress))
{


<div class="messageFooter @(MessageJustTerminated ? "show" : "hide")">
<div class="messageFooterContent @(MessageViewModel.Sender == MessageSender.User ? "userMessageFooterContent" : "")">
@if (HasMultipleResponses)
{
<button @onclick="OnPreviousResponseButtonClicked" class="chatActionButton material-icons">
<button title="@TooltipLabels.PREVIOUS_GENERATED_RESPONSE" @onclick="OnPreviousResponseButtonClicked" class="chatActionButton material-icons">
chevron_left
</button>

<span class="messageFooterText">
@($"{responseIndex + 1} / {MessageViewModel.PreviousContent!.Count + 1}")
</span>

<button @onclick="OnNextResponseButtonClicked" class="chatActionButton material-icons">
<button title="@TooltipLabels.NEXT_GENERATED_RESPONSE" @onclick="OnNextResponseButtonClicked" class="chatActionButton material-icons">
chevron_right
</button>
}

<button @onclick="OnCopyMessageButtonClicked" class="chatActionButton material-icons">
<button title="@TooltipLabels.COPY_MESSAGE" @onclick="OnCopyMessageButtonClicked" class="chatActionButton material-icons">
@(MessageJustCopied ? "check" : "content_copy")
</button>

@if (MessageViewModel.Sender == MessageSender.Assistant)
{
if (MessageViewModel.IsLastAssistantMessage)
{
<button @onclick="OnRegenerateResponseButtonClicked" class="chatActionButton material-icons">
<button title="@TooltipLabels.REGENERATE_RESPONSE" @onclick="OnRegenerateResponseButtonClicked" class="chatActionButton material-icons">
sync
</button>
}
Expand Down Expand Up @@ -134,13 +132,13 @@
font-size: 12px;
padding: 2px;
min-height: 20px;
min-width: 20px;
min-width: 20px;
display: inline-flex;
justify-content: center;
align-items: center;
background-color: transparent;
color: var(--Outline);
}
}
.chatActionButton:hover {
background-color: var(--Surface3);
Expand Down Expand Up @@ -169,13 +167,13 @@
align-items: center;
}
.messageFooter:hover {
visibility: visible;
}
.messageFooter:hover {
visibility: visible;
}
.messageFooterText {
font-size: 12px;
line-height: 20px;
font-size: 12px;
line-height: 20px;
color: var(--Outline);
display: inline-block;
transform: translateY(-2px); /* tweaking text vertical position to align it with button icons */
Expand Down
10 changes: 10 additions & 0 deletions LM-Kit-Maestro/UI/TooltipLabels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace LMKit.Maestro.UI
{
internal static class TooltipLabels
{
public const string REGENERATE_RESPONSE = "Regenerate response";
public const string PREVIOUS_GENERATED_RESPONSE = "Previous generated response";
public const string NEXT_GENERATED_RESPONSE = "Next generated response";
public const string COPY_MESSAGE = "Copy message";
}
}

0 comments on commit 9e10688

Please sign in to comment.