Skip to content

Feature/progress bar when uploading files - #4

Merged
DuncanDPS merged 2 commits into
masterfrom
feature/progressBarWhenUploadingFiles
Aug 18, 2026
Merged

Feature/progress bar when uploading files#4
DuncanDPS merged 2 commits into
masterfrom
feature/progressBarWhenUploadingFiles

Conversation

@DuncanDPS

Copy link
Copy Markdown
Owner

This pull request enhances the file upload experience in the application by implementing multi-file upload with progress tracking and updating the service layer to support progress callbacks. The UI now allows users to select multiple files, displays selected files, and shows a progress bar during uploads. The backend services are updated to report upload progress for each file.

User Interface Improvements

  • Updated SubirArchivo.razor to support selecting multiple files, display selected files and their sizes, and show a progress bar during uploads. The upload button is now disabled while uploading, and progress is updated in real-time.

Service Layer Enhancements

  • Modified IArchivoService and its implementation to accept a progress callback (Action<int> OnProgresoActualizado) in the SubirArchivoAsync method, enabling progress updates during file uploads. [1] [2]
  • Updated the chunked upload logic in ArchivoService to invoke the progress callback after each chunk, allowing the UI to reflect upload progress accurately.

Code Cleanup

  • Removed unused or commented-out code and regions to streamline the codebase.

Improved SubirArchivo.razor to allow multiple file selection and display upload progress. Updated SubirArchivoMetodo for multi-file handling, progress updates, and better error/UI state management. Refactored ArchivoService and IArchivoService to support progress callbacks, enabling real-time progress updates during chunked uploads.
Changed input handler to store selected files in archivosSeleccionados. Added UI to list selected files and enable upload button when files are chosen. Refactored SubirArchivos to upload all selected files with progress bar and disabled button during upload. Updated UI to reflect upload state and removed navigation to "/archivos" after upload.
Copilot AI lite review requested due to automatic review settings August 18, 2026 20:07
@DuncanDPS
DuncanDPS merged commit eb6ad75 into master Aug 18, 2026
2 checks passed
@DuncanDPS
DuncanDPS deleted the feature/progressBarWhenUploadingFiles branch August 18, 2026 20:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the FrontApp file upload UX by enabling multi-file selection and surfacing upload progress to the UI via a service-layer progress callback.

Changes:

  • Added multi-file selection UI with selected-file list, disabled upload button while uploading, and a progress bar in SubirArchivo.razor.
  • Extended IArchivoService.SubirArchivoAsync / ArchivoService.SubirArchivoAsync to accept a progress callback and report progress during chunked uploads.
  • Minor cleanup in upload-related code (with some leftover commented code that should be removed).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
FrontApp/Servicios/IArchivoService.cs Extends the upload API to accept a progress callback.
FrontApp/Servicios/ArchivoService.cs Reports per-chunk upload progress during chunked uploads.
FrontApp/Pages/SubirArchivo.razor Adds multi-file selection UX and a progress bar during uploads.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 12 to 16
private readonly HttpClient _httpClient;

//public Action<int>? OnProgresoActualizado;

public ArchivoService(HttpClient httpClient)
Comment on lines +86 to 92
// porcentaje de carga de chunks, para actualizar la barra de progreso
int porcentaje = (int)((chunkIndex + 1) * 100.0 / chunksTotales);
OnProgresoActualizado?.Invoke(porcentaje);

using var resp = await _httpClient.SendAsync(req, HttpCompletionOption.ResponseHeadersRead);
resp.EnsureSuccessStatusCode();
chunkIndex++;
Comment on lines 15 to +18
<label for="formFileMultiple" class="form-label">Seleccionar archivos:</label>
<InputFile class="form-control" OnChange="SubirArchivoMetodo" multiple/>
<!-- <InputFile class="form-control" OnChange="SubirArchivoMetodo" multiple /> -->
<InputFile class="form-control" OnChange="ArchivosSeleccionados" multiple />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants