New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PowerRename] Random string values to file names #32836
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
@microsoft-github-policy-service agree |
I think "rstringchar" should be "rstringalpha". |
Hmm, right. In POSIX that implies uppercase letters as well, and the solution does not do that. But a character can indeed be numbers as well by definition. Now that I think about it, should rstring (the basic one) actually be called rstringalnum, and add uppercase letters to there and to rstringalpha? And call rstringnum rstringdigit. That would be in line with POSIX altogether. Before:
After:
e: updated, looks a lot cleaner and opens up one more use case (upper- and lowercase letters mixed) |
I can imagine that users need to decide if upper, lower or mixed case. Does a simple drop down setting in the ux makes sense? |
@@ -363,4 +363,25 @@ | |||
<data name="RenameParts_ExtensionOnly.Content" xml:space="preserve"> | |||
<value>Extension only</value> | |||
</data> | |||
</root> | |||
<data name="RandomizerCheatSheet_Alnum" xml:space="preserve"> | |||
<value>Random string with uppercase letters, lowercase letters and 0-9 digits, customized length.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be as clear as possible it should contain the lengt the example defines.
"costumized length": Is there a default length? Otherwise it should not use the word customized.
My suggestion: "with a length of 9"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Changing established phrases is out of scoope. Lets go with "customized length" for now.
We can create an issue for improving the help texts in a second step. I am sure there will be discussions about the best phrasing.
Summary of the Pull Request
This pull request introduces random string replacement to PowerRename. With the random button toggled on, user can use these values in the "Replace with" input to generate random values to file names:
${rstringalnum=9}
- Random string with uppercase letters, lowercase letters and 0-9 digits, customized length.${rstringalpha=13}
- Random string with uppercase letters and lowercase letters, customized length.${rstringdigit=36}
- Random string with 0-9 digits, customized length.${ruuidv4}
- Random UUID according to v4 specification.PR Checklist
Detailed Description of the Pull Request / Additional comments
I think this covers most use cases, as uppercase/lowercase is controlled by existing functionality, and curly brackets flavor of UUID can be added manually by user in the "Replace with" input if needed (all tested and working)
Enumerating and random strings toggle each other on/off, similar to uppercase/lowercase/etc. Unfortunately right now I don't have the time (or the knowledge) to look in to how to make them work together
Other UUID versions, like UUIDv5, can be added later. But in a sense UUIDv5 is no longer "random", so it might be better to do it in another issue, even probably in another subheading in the PowerRename tool tip. Just to be super clear to the user that it is not random
Tweaked the texts a little in the UI, in my opinion a little more clearer now, let me know if they make sense (my reasoning: when you click on enumerating icon, you are not actually just enumerating items like it used to be [0, 1 ... etc], you are also enabling the enumeration feature)
Combined with the date feature (f.e.
$YYYY
), it only works when added to the middle of values or end of the file name. There is an issue about this already: Power Rename Enumerate not working with dates and/or regex groups #28428, enumerator feat works in a similar way, so maybe an unified solution is possible (outside of this scope)Validation Steps Performed