diff --git a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.cs b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.cs index 2aaaf47..2d0d0c0 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.cs +++ b/LM-Kit-Maestro/UI/Razor/Components/Chat.razor.cs @@ -22,6 +22,7 @@ public partial class Chat private double _scrollTop; private bool _isScrolledToEnd = false; + private bool _isShowingActionPopup; public bool IsScrolledToEnd { @@ -240,6 +241,7 @@ private void OnConversationItemSelected(ConversationViewModel conversationViewMo } } + private void OnConversationItemShowMoreClicked(ConversationViewModel conversationViewModel) { if (conversationViewModel != ViewModel.ConversationListViewModel.CurrentConversation) @@ -248,6 +250,60 @@ private void OnConversationItemShowMoreClicked(ConversationViewModel conversatio } } + private async Task OnShowMoreClicked(ConversationViewModel conversationViewModel) + { + if (_isShowingActionPopup) + { + return; + } + + _isShowingActionPopup = true; + + ChatConversationActionPopupViewModel chatConversationActionPopupViewModel = new ChatConversationActionPopupViewModel() + { + ConversationX = 400, + //ConversationY = conversationItem.Y - collectionView.ScrollY + conversationItem.Height + UIConstants.TabBarHeight + UIConstants.PageTopBarHeight, + //ConversationItemHeight = conversationItem.Height, + //ConversationListHeight = Height + }; + + var popup = new ChatConversationActionPopup(ViewModel.PopupNavigation, chatConversationActionPopupViewModel) + { + Animation = new Mopups.Animations.FadeAnimation() + { + DurationIn = 1, + DurationOut = 1, + EasingIn = Easing.Linear, + EasingOut = Easing.Linear + } + }; + + conversationViewModel!.IsShowingActionPopup = true; + await ViewModel.PopupNavigation.PushAsync(popup); + + var result = await popup.PopupTask; + + if (result != null && result.Value is ChatConversationAction chatConversationAction) + { + switch (chatConversationAction) + { + case ChatConversationAction.Select: + ViewModel.ConversationListViewModel.CurrentConversation = conversationViewModel!; + break; + + case ChatConversationAction.Rename: + conversationViewModel!.IsRenaming = true; + break; + + case ChatConversationAction.Delete: + await ViewModel.ConversationListViewModel.DeleteConversation(conversationViewModel!); + break; + } + } + + conversationViewModel!.IsShowingActionPopup = false; + } + private int CalculateUsagePercentage(int used, int total) { if (total == 0) return 0; diff --git a/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor b/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor index 847cb09..12c5d9c 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor +++ b/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor @@ -1,11 +1,11 @@ @inherits ComponentBase -
+
@ViewModel.Title -
+
@@ -16,9 +16,4 @@ [Parameter] public EventCallback OnShowMore { get; set; } [Parameter] public required ConversationViewModel ViewModel { get; set; } [Parameter] public bool IsSelected { get; set; } - - private void OnClicked() - { - OnSelect.InvokeAsync(ViewModel); - } -} \ No newline at end of file +} \ No newline at end of file diff --git a/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor.css b/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor.css index 3673f40..b710327 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor.css +++ b/LM-Kit-Maestro/UI/Razor/Components/ConversationListItem.razor.css @@ -12,10 +12,9 @@ #item-container:hover { background-color: var(--Surface2); - visibility: hidden; } - #item-container:has(:hover) #show-more-button { + #item-container:hover #show-more-button { visibility: visible; } @@ -23,9 +22,6 @@ visibility: visible; } -#show-more-button { - visibility: hidden; -} /* .mud-icon-size-small { font-size: 10px !important; diff --git a/LM-Kit-Maestro/UI/Razor/Components/Translation.razor b/LM-Kit-Maestro/UI/Razor/Components/Translation.razor index 65d939e..e53f444 100644 --- a/LM-Kit-Maestro/UI/Razor/Components/Translation.razor +++ b/LM-Kit-Maestro/UI/Razor/Components/Translation.razor @@ -66,7 +66,7 @@
-
+
diff --git a/LM-Kit-Maestro/wwwroot/css/lmkitmaestro.css b/LM-Kit-Maestro/wwwroot/css/lmkitmaestro.css index cd5da8f..757c9e3 100644 --- a/LM-Kit-Maestro/wwwroot/css/lmkitmaestro.css +++ b/LM-Kit-Maestro/wwwroot/css/lmkitmaestro.css @@ -242,6 +242,10 @@ body.windows .primary-button { display: inline-block; } -.hidden { +.hide { visibility: hidden; } + +.show{ + +} \ No newline at end of file