From 7d413aa0b35e4b05e8f39eff595b2f800ab4ed6e Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Tue, 28 Jul 2026 15:23:19 +0200 Subject: [PATCH] Disable upload form during upload; update citation template The file upload form in Documents.razor is now wrapped in a
that disables all controls while uploading, using a new isUploading flag to manage state and UI updates. The upload button's loading state is also handled. In Program.cs, the citation template was revised to require supporting excerpts of about 20-30 words instead of 15-20 words. --- .../Components/Pages/Documents.razor | 63 +++++++++++-------- SqlDatabaseVectorSearch/Program.cs | 2 +- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor index 9750b68..1308ad1 100644 --- a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor +++ b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor @@ -17,35 +17,37 @@ -
-
-
- - - - - - +
+
+
+
+ + + + + + +
+
+
+
+ + + + + Document ID + + +
+ +
+
+
+ +
-
-
- - - - - Document ID - - -
- -
-
-
- -
-
-
+
@if (isLoading && documents.Count == 0) @@ -125,6 +127,7 @@ else private Button deleteButton = default!; private bool isLoading = true; + private bool isUploading; private IList documents = []; private UploadDocument Model { get; set; } = new(); @@ -178,6 +181,9 @@ else uploadButton.ShowLoading(); + isUploading = true; + await InvokeAsync(StateHasChanged); + var fileName = Model.File.Name; try @@ -205,6 +211,9 @@ else finally { uploadButton.HideLoading(); + + isUploading = false; + await InvokeAsync(StateHasChanged); } } diff --git a/SqlDatabaseVectorSearch/Program.cs b/SqlDatabaseVectorSearch/Program.cs index 62496d0..9f322e8 100644 --- a/SqlDatabaseVectorSearch/Program.cs +++ b/SqlDatabaseVectorSearch/Program.cs @@ -174,7 +174,7 @@ var textSearchOptions = new TextSearchProviderOptions() sb.AppendLine("- Do NOT add inline citations."); sb.AppendLine("- At the END of your answer, add a sources section that follows this template exactly, where the sources label and the page label are localized in the same language as the user's question:"); sb.AppendLine(" *localized-sources-label*"); - sb.AppendLine(" 1. **SourceName**, localized-page-label PageNumber: *supporting excerpt of about 15-20 words*"); + sb.AppendLine(" 1. **SourceName**, localized-page-label PageNumber: *supporting excerpt of about 20-30 words*"); sb.AppendLine("- Omit the page label and the page number when the page number is not available."); sb.AppendLine("- Do NOT use headings or links in the sources section."); sb.AppendLine("- Include ONLY sources you actually used. No duplicates.");