-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add action for opening settings directory in file explorer #17690
base: main
Are you sure you want to change the base?
Add action for opening settings directory in file explorer #17690
Conversation
directory and copy settings file path to clipboard)
Sorry for the delay! We've been understaffed this week 🙂 |
No worries, no rush on my end. |
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.
Apart from the .c_str()
call the PR seems fine to me. I'll approve in advance because it'll have to wait for a 2nd approval anyway.
However, I'm not quite sure if we should introduce the 2 additional options just yet.
openFolder(CascadiaSettings::SettingsDirectory()); | ||
break; | ||
case SettingsTarget::Clipboard: | ||
copyToClipboard(CascadiaSettings::SettingsPath().c_str()); |
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.
The .c_str()
is unnecessary, if not detrimental, because constructing a string-view from a nullptr is UB.
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.
Updated. (Sorry, I should have thought that through)
Let me know if I should remove the other 2 actions. Fwiw, the send input one is what I have found most useful, I don't think I have ever actually used the other 2 outside of testing. But that is probably just because of my personal workflows.
_copyToClipboard when copying settings file path to clipboard
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.
Thanks for being so patient with us. Sorry it's taken us a long time to get to it.
Got a chance to discuss this with the team. We're interested in being able to open the settings directory, but not the sendInput
or clipboard
ones as they may be too niche.
pair_type{ "sendInput", ValueType::SendInput }, | ||
pair_type{ "clipboard", ValueType::Clipboard }, |
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.
Discussed this as a team. I see value in opening the directory, but sendInput
and clipboard
might be too niche. We'd prefer that you back out those two values please.
pair_type{ "settingsFile", ValueType::SettingsFile }, | ||
pair_type{ "defaultsFile", ValueType::DefaultsFile }, | ||
pair_type{ "allFiles", ValueType::AllFiles }, | ||
pair_type{ "settingsUI", ValueType::SettingsUI }, | ||
pair_type{ "fileExplorer", ValueType::FileExplorer }, |
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.
pair_type{ "fileExplorer", ValueType::FileExplorer }, | |
pair_type{ "directory", ValueType::Directory }, |
I think this would be cleaner
{ "command": { "action": "openSettings", "target": "sendInput" }, "id": "Terminal.SendInputSettingsFile" }, | ||
{ "command": { "action": "openSettings", "target": "fileExplorer" }, "id": "Terminal.FileExplorerSettingsFile" }, | ||
{ "command": { "action": "openSettings", "target": "clipboard" }, "id": "Terminal.ClipboardSettingsFile" }, |
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.
{ "command": { "action": "openSettings", "target": "sendInput" }, "id": "Terminal.SendInputSettingsFile" }, | |
{ "command": { "action": "openSettings", "target": "fileExplorer" }, "id": "Terminal.FileExplorerSettingsFile" }, | |
{ "command": { "action": "openSettings", "target": "clipboard" }, "id": "Terminal.ClipboardSettingsFile" }, | |
{ "command": { "action": "openSettings", "target": "directory" }, "id": "Terminal.OpenSettingsDirectory" }, |
<value>Send the settings file path as input to the terminal</value> | ||
</data> | ||
<data name="SettingsFileOpenInExplorerCommandKey" xml:space="preserve"> | ||
<value>Open the settings file directory in File Explorer</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.
<value>Open the settings file directory in File Explorer</value> | |
<value>Open the settings file directory</value> |
Sounds good! updated. |
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.
Love it. Thank you!
Most of the logic is taken from the original PR (#15417) and adapted to work with the palette.
References and Relevant Issues
#12382