File input: Users cannot add or replace files after initial upload in interaction dialog
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Context
From review feedback on #14882.
## Problem
In the `InteractionsInputDialog.razor`, the file upload browse button (`FluentButton`) is only rendered when there are no uploaded files. Once a file is successfully uploaded, the button is removed from the DOM and replaced with the file list display.
Because `FluentInputFile` triggers the file picker via `AnchorId` pointing at the button, once the button is gone:
- Users cannot add more files (for multi-file inputs)
- Users cannot replace an incorrect file selection
- The only option is to cancel the entire dialog and start over
Additionally, the button/anchor ID is derived from `_elementRefs[localItem]?.Id`, which can be null early in rendering, producing an ID like `"-FileUploadButton"`. With multiple file inputs, this risks duplicate IDs and incorrect label/anchor associations.
## Expected behavior
- The browse button should remain visible alongside the uploaded file list so users can add/replace files
- Use a deterministic ID based on the input name (or similar stable key) rather than element ref IDs that may be null
## References
- https://github.com/microsoft/aspire/pull/14882#discussion_r3532761368
- https://github.com/microsoft/aspire/pull/14882#discussion_r3532791653
- https://github.com/microsoft/aspire/pull/14882#discussion_r3532761388
Contributor guide
Research direction
Start in InteractionsInputDialog.razor by tracing the conditional rendering around the FluentButton and the FluentInputFile AnchorId, then inspect how localItem and input names are available for a stable ID. Done means the browse button remains beside uploaded files, supports adding or replacing selections, and produces unique anchor IDs for multiple inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100