Diamant

Needs you

  • Inbox
  • Decisions
  • Plans
  • Code

Pipeline

  • Activity
  • Graph
Sign in
Code/

Support selecting multiple files in the upload dialog

Brain review
Azure DevOpsai/work-packet-c93ad41c29-attempt-1daytona
  1. Human review

Implement multi-file upload support only in the ITP-Public-Facing-Interface upload feature, starting with inspection because codegraph context is unavailable. Update the upload dialog template and component to allow selecting multiple files, keep and display the selected file list, and submit all selected files using the existing upload flow where possible. Extend upload.spec.ts with focused tests for multi-selection, file list rendering, and multi-file submission behavior. Keep repository and file surface minimal and verify whether any downstream service/API contract or payload shape assumptions still enforce single-file uploads before finalizing implementation details.

medium risk

Code changes and PR creation are dashboard-gated, so a human must confirm the proposed file surface and implementation direction before sandbox work begins.SocratiCode/codegraph context failed due to a dirty local clone, so the plan is based on work packet metadata rather than fresh structural code intelligence and should be validated by inspection in the sandbox.The work item says the frontend task was already marked Done in org context, which may indicate existing partial implementation, branch drift, or duplicate changes that require human confirmation before coding.Multi-file upload may depend on backend/API payload expectations not visible in the provided context; a human should review whether repeated file fields or multiple requests are the correct contract.Changing upload UX can affect validation, accessibility, and user messaging, which should be reviewed for product intent before implementation is approved.

Expected files

  • frontend/src/app/features/upload/upload.html
  • frontend/src/app/features/upload/upload.ts
  • frontend/src/app/features/upload/upload.spec.ts
  • Implementation steps

    • 1.Inspect frontend/src/app/features/upload/upload.ts to identify the current single-file state model, file input change handler, submission method, validation rules, and any assumptions that only one File is stored or uploaded.
    • 2.Inspect frontend/src/app/features/upload/upload.html to confirm how the file input is declared, where the selected filename is shown today, and the smallest template change needed to enable the native multiple file picker and render a list of selected files.
    • 3.Inspect upload.spec.ts to understand the current test harness, mocking strategy, and assertions around file selection and submit behavior so new tests follow existing conventions.
    • 4.Trace the upload component’s dependencies used during submission, especially any upload service or FormData creation logic referenced from upload.ts, to determine whether multi-file submission can reuse the same endpoint contract or requires repeated invocation per file. If this dependency lives outside upload.ts, inspect it but avoid expanding the planned edit surface unless a hard blocker is found.
    • 5.Refactor the component state in upload.ts from a single selected file value to a collection representation such as File[] or FileList-derived array, preserving compatibility with existing validation and UI state handling.
    • 6.Update the file-selection handler in upload.ts so it reads all files from the input event, normalizes them into the chosen collection type, handles zero-file reselection cleanly, and replaces the prior single-file state rather than appending unexpectedly unless existing UX clearly indicates additive behavior.
    • 7.Adjust any computed display helpers or derived state in upload.ts so the component can expose selected file names/count to the template and can determine whether submission should be enabled when one or more files are selected.
    • 8.Update submission logic in upload.ts to submit all selected files. Prefer the smallest safe change: either append multiple files into the existing request payload if the backend contract supports repeated file fields, or iterate over files using the existing single-file upload call if that is how the current service is structured. Preserve current success/error handling semantics as much as possible.
    • 9.Update upload.html to add the multiple attribute to the file input and replace any single filename display with a simple selected-files list, while preserving existing accessibility text, form wiring, and styling hooks where possible.
    • 10.Add or update empty-state messaging in the template only if needed so the UI behaves predictably when no files are selected.
    • 11.Extend upload.spec.ts with tests covering: selecting multiple files updates component state; the template renders all selected filenames; submit is enabled/allowed when multiple files are selected; and the submit path sends all selected files according to the actual implementation strategy discovered during inspection.
    • 12.Add at least one regression test confirming existing single-file behavior still works under the new multi-file-capable code path.
    • 13.Run targeted frontend tests for the upload feature and, if failures reveal hidden coupling, inspect only the immediate upload-related dependency files necessary to resolve them before proposing any broader edits.

    Test plan

    • ·Review current upload component tests to mirror existing setup and mocking patterns before adding new cases.
    • ·Execute the upload feature unit tests, preferably the focused spec file for upload.spec.ts.
    • ·Verify a test case that simulates a change event with multiple File objects and asserts component state contains all files.
    • ·Verify a rendering test that checks all selected file names are displayed in the dialog/template.
    • ·Verify a submission test that asserts all selected files are passed into FormData or all expected service calls are made, depending on the discovered implementation.
    • ·Verify a regression test for a single selected file still succeeds.
    • ·If practical in the existing test framework, verify zero selected files keeps submission blocked or no-op according to current behavior.

    Repositories

    • ·ITP-Public-Facing-Interface