diff --git a/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor b/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor
index 6b1f8e4..13566ae 100644
--- a/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor
+++ b/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor
@@ -49,8 +49,8 @@
{
navItems = [
new() { Id = "1", Href = "/", IconName = IconName.HouseDoorFill, Text = "Home", Match = NavLinkMatch.All},
- new() { Id = "2", Href = "/ask", IconName = IconName.ChatDots, Text = "Ask"},
- new() { Id = "3", Href= "/documents", IconName = IconName.FileText, Text = "Documents" }
+ new() { Id = "2", Href= "/documents", IconName = IconName.FileText, Text = "Documents" },
+ new() { Id = "3", Href = "/ask", IconName = IconName.ChatDots, Text = "Ask"}
];
return navItems;
diff --git a/SqlDatabaseVectorSearch/Components/Pages/Ask.razor b/SqlDatabaseVectorSearch/Components/Pages/Ask.razor
index e02079c..98dd393 100644
--- a/SqlDatabaseVectorSearch/Components/Pages/Ask.razor
+++ b/SqlDatabaseVectorSearch/Components/Pages/Ask.razor
@@ -107,9 +107,6 @@
private Guid conversationId = Guid.NewGuid();
private bool isAsking = false;
- [Inject]
- protected ToastService ToastService { get; set; } = default!;
-
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
@@ -117,15 +114,24 @@
return;
}
- await JSRuntime.InvokeVoidAsync("setFocus", askInput);
+ await JSRuntime.InvokeVoidAsync("setFocus", askInput);
}
private async Task HandleKeyDown(KeyboardEventArgs e)
{
- if (e.Key == "Enter" && !isAsking && !string.IsNullOrWhiteSpace(question))
+ if (isAsking)
+ {
+ return;
+ }
+
+ if (e.Key == "Enter" && !string.IsNullOrWhiteSpace(question))
{
await AskQuestion();
}
+ else if (e.Key == "ArrowUp" && messages.Count >= 2)
+ {
+ question = messages[^2].Text;
+ }
}
private async Task AskQuestion()
diff --git a/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj b/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj
index e189abb..3a3f57f 100644
--- a/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj
+++ b/SqlDatabaseVectorSearch/SqlDatabaseVectorSearch.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/SqlDatabaseVectorSearch/wwwroot/css/app.css b/SqlDatabaseVectorSearch/wwwroot/css/app.css
index 0c3636e..e2f8887 100644
--- a/SqlDatabaseVectorSearch/wwwroot/css/app.css
+++ b/SqlDatabaseVectorSearch/wwwroot/css/app.css
@@ -5,7 +5,7 @@
--bb-sidebar2-top-row-background-color: rgba(0,0,0,0.08);
--bb-sidebar2-top-row-border-color: rgb(194,192,192);
--bb-sidebar2-title-text-color: rgb(0,0,0);
- --bb-sidebar2-brand-icon-color: #6f42c1;
+ --bb-sidebar2-brand-icon-color: rgb(0,0,0);
--bb-sidebar2-brand-image-width: 24px;
--bb-sidebar2-brand-image-height: 24px;
--bb-sidebar2-title-badge-text-color: rgb(255,255,255);
@@ -21,19 +21,15 @@
--bb-sidebar2-nav-item-group-background-color: rgba(var(--bb-sidebar-nav-item-text-active-color-rgb),0.08);
}
-.bb-sidebar2 nav .nav-item a {
- color: var(--bb-sidebar2-nav-item-text-color) !important;
+.bb-sidebar2 nav .nav-item a:hover {
+ background-color: rgba(0,0,0,0.08) !important;
+ color: rgba(0,0,0,0.9) !important;
}
- .bb-sidebar2 nav .nav-item a:hover {
- background-color: var(--bb-sidebar2-nav-item-background-hover-color) !important;
- color: var(--bb-sidebar2-nav-item-text-hover-color) !important;
- }
-
- .bb-sidebar2 nav .nav-item a.active {
- background-color: var(--bb-sidebar2-nav-item-background-hover-color) !important;
- color: var(--bb-sidebar2-nav-item-text-active-color) !important;
- }
+.bb-sidebar2 nav .nav-item a.active {
+ background-color: rgb(194,192,192) !important;
+ color: rgba(0,0,0,0.9) !important;
+}
h1:focus {
outline: none;
@@ -59,4 +55,4 @@ h1:focus {
.blazor-error-boundary::after {
content: "An error has occurred."
- }
\ No newline at end of file
+ }