feat(web): add file extension validation to file browser modal - #5524
Draft
eduardomozart wants to merge 2 commits into
Draft
feat(web): add file extension validation to file browser modal#5524eduardomozart wants to merge 2 commits into
eduardomozart wants to merge 2 commits into
Conversation
|
Member
|
Is this only for the cover browse button or all? Because all except the cover image one need to accept any extension. |
Contributor
Author
The validation is strictly applied only to the cover image button. Here is how the logic works:
So all other fields will continue to accept any extension perfectly fine, exactly as they did before. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds frontend file extension validation to the shared "Select File" file browser modal in the Sunshine Web UI.
Previously, the file browser would accept any selected file (e.g.
.md) without providing any feedback, even when opening the modal to select an application cover image.This change ensures the file extension is validated directly in the modal right when the user clicks "Select", aligning the frontend behavior with the existing backend enforcement in
validate_app_image_path(inprocess.cpp).Screenshot
Updated
fileBrowserConfirmto validate the selected file against the accepted extensions and display an error message inside the modal if it fails.Gravacao.de.Tela.2026-08-18.as.16.13.48.mov
Updated the
savemethod to validate manually typed image paths, displaying the new error banner and preventing the API request if the extension is invalid.Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.