mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Refactor navigation and update styles and dependencies
- Rearranged navigation items in `MainLayout.razor`. - Removed `ToastService` injection and modified key handling in `Ask.razor`. - Downgraded `Microsoft.SemanticKernel` version in project file. - Updated CSS styles for sidebar brand icon and navigation item states. - Fixed error message content in `.blazor-error-boundary` class.
This commit is contained in:
@@ -49,8 +49,8 @@
|
|||||||
{
|
{
|
||||||
navItems = [
|
navItems = [
|
||||||
new() { Id = "1", Href = "/", IconName = IconName.HouseDoorFill, Text = "Home", Match = NavLinkMatch.All},
|
new() { Id = "1", Href = "/", IconName = IconName.HouseDoorFill, Text = "Home", Match = NavLinkMatch.All},
|
||||||
new() { Id = "2", Href = "/ask", IconName = IconName.ChatDots, Text = "Ask"},
|
new() { Id = "2", Href= "/documents", IconName = IconName.FileText, Text = "Documents" },
|
||||||
new() { Id = "3", Href= "/documents", IconName = IconName.FileText, Text = "Documents" }
|
new() { Id = "3", Href = "/ask", IconName = IconName.ChatDots, Text = "Ask"}
|
||||||
];
|
];
|
||||||
|
|
||||||
return navItems;
|
return navItems;
|
||||||
|
|||||||
@@ -107,9 +107,6 @@
|
|||||||
private Guid conversationId = Guid.NewGuid();
|
private Guid conversationId = Guid.NewGuid();
|
||||||
private bool isAsking = false;
|
private bool isAsking = false;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected ToastService ToastService { get; set; } = default!;
|
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
if (!firstRender)
|
if (!firstRender)
|
||||||
@@ -117,15 +114,24 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await JSRuntime.InvokeVoidAsync("setFocus", askInput);
|
await JSRuntime.InvokeVoidAsync("setFocus", askInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
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();
|
await AskQuestion();
|
||||||
}
|
}
|
||||||
|
else if (e.Key == "ArrowUp" && messages.Count >= 2)
|
||||||
|
{
|
||||||
|
question = messages[^2].Text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AskQuestion()
|
private async Task AskQuestion()
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.1" />
|
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.1" />
|
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.1" />
|
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.SemanticKernel" Version="1.38.0" />
|
<PackageReference Include="Microsoft.SemanticKernel" Version="1.37.0" />
|
||||||
<PackageReference Include="MimeMapping" Version="3.1.0" />
|
<PackageReference Include="MimeMapping" Version="3.1.0" />
|
||||||
<PackageReference Include="MinimalHelpers.OpenApi" Version="2.1.4" />
|
<PackageReference Include="MinimalHelpers.OpenApi" Version="2.1.4" />
|
||||||
<PackageReference Include="PdfPig" Version="0.1.9" />
|
<PackageReference Include="PdfPig" Version="0.1.9" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
--bb-sidebar2-top-row-background-color: rgba(0,0,0,0.08);
|
--bb-sidebar2-top-row-background-color: rgba(0,0,0,0.08);
|
||||||
--bb-sidebar2-top-row-border-color: rgb(194,192,192);
|
--bb-sidebar2-top-row-border-color: rgb(194,192,192);
|
||||||
--bb-sidebar2-title-text-color: rgb(0,0,0);
|
--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-width: 24px;
|
||||||
--bb-sidebar2-brand-image-height: 24px;
|
--bb-sidebar2-brand-image-height: 24px;
|
||||||
--bb-sidebar2-title-badge-text-color: rgb(255,255,255);
|
--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-item-group-background-color: rgba(var(--bb-sidebar-nav-item-text-active-color-rgb),0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bb-sidebar2 nav .nav-item a {
|
.bb-sidebar2 nav .nav-item a:hover {
|
||||||
color: var(--bb-sidebar2-nav-item-text-color) !important;
|
background-color: rgba(0,0,0,0.08) !important;
|
||||||
|
color: rgba(0,0,0,0.9) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bb-sidebar2 nav .nav-item a:hover {
|
.bb-sidebar2 nav .nav-item a.active {
|
||||||
background-color: var(--bb-sidebar2-nav-item-background-hover-color) !important;
|
background-color: rgb(194,192,192) !important;
|
||||||
color: var(--bb-sidebar2-nav-item-text-hover-color) !important;
|
color: rgba(0,0,0,0.9) !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;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1:focus {
|
h1:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
@@ -59,4 +55,4 @@ h1:focus {
|
|||||||
|
|
||||||
.blazor-error-boundary::after {
|
.blazor-error-boundary::after {
|
||||||
content: "An error has occurred."
|
content: "An error has occurred."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user