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:
Marco Minerva
2025-02-21 14:13:25 +01:00
parent ae88408823
commit 08ebc517c8
4 changed files with 23 additions and 21 deletions
@@ -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)
@@ -122,10 +119,19 @@
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 -9
View File
@@ -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,18 +21,14 @@
--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 {
color: var(--bb-sidebar2-nav-item-text-color) !important;
}
.bb-sidebar2 nav .nav-item a:hover { .bb-sidebar2 nav .nav-item a:hover {
background-color: var(--bb-sidebar2-nav-item-background-hover-color) !important; background-color: rgba(0,0,0,0.08) !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 { .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-active-color) !important; color: rgba(0,0,0,0.9) !important;
} }
h1:focus { h1:focus {