From f8a48930f3cd4251a87916821b9cc0a0e7a34dbb Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Thu, 3 Jul 2025 11:54:16 +0200 Subject: [PATCH] Enhance UI and improve code documentation Updated button styles in Documents.razor for better appearance and usability. Improved the document table layout for responsiveness, integrating checkboxes into rows. Corrected comments in VectorSearchService.cs for clarity. Added new styles for content-type badges in app.css. --- .../Components/Pages/Documents.razor | 66 ++++++++++--------- .../Services/VectorSearchService.cs | 2 +- SqlDatabaseVectorSearch/wwwroot/css/app.css | 6 ++ 3 files changed, 43 insertions(+), 31 deletions(-) diff --git a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor index af67098..eec9704 100644 --- a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor +++ b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor @@ -41,7 +41,7 @@
- +
@@ -60,40 +60,46 @@ else Available documents - - - - - - - - - - - - - @foreach (var document in documents) - { +
+
IDNameContent typeNumber of chunksCreation date
+ - - - - - - + + + + + + - } - -
-
- -
-
@document.Id@document.Name@document.ContentType@document.ChunkCount@document.LocalCreationDateStringIDNameContent typeChunksCreated
- + + + @foreach (var document in documents) + { + + +
+ +
+ + @document.Id + @document.Name + + + @document.ContentType + + + @document.ChunkCount + @document.LocalCreationDateString + + } + + + +
-
diff --git a/SqlDatabaseVectorSearch/Services/VectorSearchService.cs b/SqlDatabaseVectorSearch/Services/VectorSearchService.cs index 75f7c45..18bfa3e 100644 --- a/SqlDatabaseVectorSearch/Services/VectorSearchService.cs +++ b/SqlDatabaseVectorSearch/Services/VectorSearchService.cs @@ -88,7 +88,7 @@ public partial class VectorSearchService(IServiceProvider serviceProvider, Appli var (fullAnswer, tokenUsage) = await chatService.AskQuestionAsync(question.ConversationId, chunks, reformulatedQuestion.Text!, cancellationToken); - // Extract citations from the answer + // Extract citations from the answer. var (answer, citations) = ExtractCitations(fullAnswer); return new(question.Text, reformulatedQuestion.Text!, answer, StreamState.End, new(reformulatedQuestion.TokenUsage, embeddingTokenCount, tokenUsage), citations); diff --git a/SqlDatabaseVectorSearch/wwwroot/css/app.css b/SqlDatabaseVectorSearch/wwwroot/css/app.css index 3d4dd04..3c0b751 100644 --- a/SqlDatabaseVectorSearch/wwwroot/css/app.css +++ b/SqlDatabaseVectorSearch/wwwroot/css/app.css @@ -63,6 +63,12 @@ h1:focus { content: "An error has occurred." } +.content-type-badge { + background-color: #e5e7eb !important; + color: #495057 !important; + border: 1px solid #d1d5db !important; +} + .citation-box { width: fit-content; max-width: 100%;