-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Display 'path' when creating a new file/folder #6545
Conversation
/** | ||
* The general `path` to be displayed in the dialog. | ||
*/ | ||
path: string; |
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.
Why do not we use path: Path
(where Path
is from @theia/core/core/lib/common/path
)? No need to clarify the property with the "The general path
" JSDoc which is not clear by the way.
This is a nice to have UI/UX feature 👍 Dropping the input dialogs and doing what VS Code does when creating a new file/folder would be better in the long run. |
This behaves differently on Windows. Based on the screenshot you have attached, I should see the full FS path, but I see a project relative path on Windows.
Also, it is not clear what |
Fixes #6544 - displays the parent `path` when attempting to create a new file (path in which the file is created at). - displays the parent `path` when attempting to create a new folder (path in which the folder is created at). - when the URI selection from the explorer is at the workspace root display the entire path. - when the URI selection from the explorer is not the workspace root, display the relative path (ex: packages/core/src/common). - introduces the `WorkspaceInputDialog` dialog. - introduces the `WorkspaceInputDialogProps` which has a new `parentUri` prop. Signed-off-by: vince-fugnitto <[email protected]>
b07e515
to
4d939de
Compare
@kittaakos thank you for the review, I adjusted the code and documentation (including the PR description) to be more explicit. Please let me know if you have additional feedback. |
I have tried it; it works as described 👍 Why do we distinguish between the root and other folders? I am wondering why don't we always show WS-root relative paths? Smells like a hack in the label provider. |
Right, I'm not doing any special logic with creating the label besides using the |
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.
I have verified it on Windows with the browser example; it works as expected 👍
Follow-up: #6549 |
Thank you for the review ! |
What it does
Fixes #6544
path
when attempting to create a new file (path in which the file is created at).path
when attempting to create a new folder (path in which the folder is created at).WorkspaceInputDialog
dialog.WorkspaceInputDialogProps
which has a newparentUri
propExample:
Workspace Root URI Selection
Non-workspace Root URI Selection
How to test
path
is correct when opening thenew file
dialog (verify multiple locations)path
corresponds to the URI selection present in the explorer.path
is correct when opening thenew folder
dialog (verify multiple locations)path
corresponds to the URI selection present in the explorer.Review checklist
Reminder for reviewers
Signed-off-by: vince-fugnitto [email protected]