From 1975d6318988aedd2f2f6aeddfe6b80487866566 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Wed, 11 Jun 2025 17:47:44 +0200 Subject: [PATCH] Improve layout and readability in Documents.razor - Wrapped checkbox input in a div for better alignment. - Changed documents initialization from an empty array to a list. - Updated document addition code for improved readability. - Modified ConfirmDialogOptions and ToastMessage initializations to use object initializer syntax. - Translated comment in DocxContentDecoder.cs from Italian to English. --- .../Components/Pages/Documents.razor | 36 ++++++++++--------- .../ContentDecoders/DocxContentDecoder.cs | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor index c756bab..af67098 100644 --- a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor +++ b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor @@ -76,7 +76,9 @@ else { - +
+ +
@document.Id @document.Name @@ -107,7 +109,7 @@ else private bool isLoading = true; private IList documents = []; - private UploadDocument Model { get; set; } = new(); + private UploadDocument Model { get; set; } = new(); [Inject] protected ToastService ToastService { get; set; } = default!; @@ -138,9 +140,9 @@ else foreach (var dbDocument in dbDocuments) { documents.Add(new SelectableDocument(dbDocument.Id, dbDocument.Name, dbDocument.CreationDate, dbDocument.ChunkCount) - { - LocalCreationDateString = await GetLocalDateTimeStringAsync(dbDocument.CreationDate) - }); + { + LocalCreationDateString = await GetLocalDateTimeStringAsync(dbDocument.CreationDate) + }); } } finally @@ -193,12 +195,12 @@ else var selectedDocumentIds = documents?.Where(d => d.IsSelected).Select(d => d.Id) ?? []; var options = new ConfirmDialogOptions - { - YesButtonText = "Yes", - YesButtonColor = ButtonColor.Danger, - NoButtonText = "No", - NoButtonColor = ButtonColor.Secondary - }; + { + YesButtonText = "Yes", + YesButtonColor = ButtonColor.Danger, + NoButtonText = "No", + NoButtonColor = ButtonColor.Secondary + }; var confirmation = await dialog.ShowAsync( title: "Delete the selected documents?", @@ -236,12 +238,12 @@ else private async Task CreateToastMessageAsync(ToastType toastType, string title, string message) { var toastMessage = new ToastMessage - { - Type = toastType, - Title = title, - HelpText = await GetLocalDateTimeStringAsync(DateTimeOffset.UtcNow), - Message = message - }; + { + Type = toastType, + Title = title, + HelpText = await GetLocalDateTimeStringAsync(DateTimeOffset.UtcNow), + Message = message + }; return toastMessage; } diff --git a/SqlDatabaseVectorSearch/ContentDecoders/DocxContentDecoder.cs b/SqlDatabaseVectorSearch/ContentDecoders/DocxContentDecoder.cs index 3aa160b..bdb934c 100644 --- a/SqlDatabaseVectorSearch/ContentDecoders/DocxContentDecoder.cs +++ b/SqlDatabaseVectorSearch/ContentDecoders/DocxContentDecoder.cs @@ -36,7 +36,7 @@ public class DocxContentDecoder(IServiceProvider serviceProvider) : IContentDeco pageBuilder.AppendLine(paragraph.InnerText); } - // Dopo aver processato tutti i paragrafi, aggiungi l'ultima pagina (anche se vuota) + // After processing all paragraphs, add the last page (even if empty). pages.Add(pageBuilder.ToString()); var chunks = new List();