fix(frontend): allow dashes and underscores in folder names - #1003
Open
omlahore wants to merge 1 commit into
Open
fix(frontend): allow dashes and underscores in folder names#1003omlahore wants to merge 1 commit into
omlahore wants to merge 1 commit into
Conversation
The Create a Folder dialog filtered keystrokes through an alphanumeric-only regex while the API applies no character restriction, so the console could not create folders it already displays. Also removes the shadowed duplicate of the pattern inside handleUpdateName.
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.
Fixes #988.
The problem
NewFolderMenufilters keystrokes through/^[a-zA-Z0-9]*$/, so-and_cannot be typed into the folder name field. The character is dropped with no error and no hint.Nothing else in the stack applies that rule.
normalize_path_stringdoes no character validation, andcreate_environment_folder_structurecallsget_or_create(name=segment, ...)with whatever segment it is given, sophase secrets create KEY --path /user-servicecreates the folder that the dialog refuses to name. The console then renders, expands and syncs that folder normally. The UI is showing valid state its own primary control cannot produce.The change
Widen the pattern to
/^[a-zA-Z0-9_-]*$/, and delete the shadowed duplicate declared insidehandleUpdateName(the outer one at the top of the component was dead).This is the same change as #364, which @nimish-ks opened in September 2024 and closed unmerged in December 2025 with no comment or review. Since it was the maintainer's own branch and nothing was said against it, I have read that as stale-cleanup rather than a rejection. If the alphanumeric-only rule is in fact deliberate, close this and I will send the alternative instead: keep the restriction but show validation text, so the character can be typed and visibly rejected rather than swallowed.
Scope
One file, five lines. I deliberately did not widen this any further:
.,/) are still dropped silently./genuinely must not be accepted here since it would change the path structure, but the silent-swallow behaviour for the rest is the second half of Folder dialog silently drops hyphens, so the console cannot create folders it already displays #988 and is a separate UI decision.Verification
tsc --noEmitclean,jest17 suites / 385 tests passing locally.