-
Notifications
You must be signed in to change notification settings - Fork 23
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
Provide more specific errors for incorrect Local path during creating a site #901
base: trunk
Are you sure you want to change the base?
Conversation
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 confirm the PR updates the error message accordingly, but I wonder if having the expanded message is enough, and it wouldn't increase the complexity in our codebase.
My suggestion is to leave the long error message for both cases:
The directory is already associated with another site. Please choose a different "Site name" or adjust the "Local path"
errorPathIsNotAvailable = __( | ||
'This directory is already connected to another site in Studio.' |
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.
Case when the user enters a path so they are already modifying and seeing the output. 👍 We don't need much information.
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.
It leads to inconsistent flow:
- A user has the site FooBar in the directory of the same name
- The user tries to add a new site with the name 'FooBar' which leads to using a duplicate directory, seeing 'The directory is already associated with another Studio site. Please choose a different site name or a custom local path.' error.
- User clicks directory selector, and clicks 'FooBar' directory, and error changes to 'This directory is already connected to another site in Studio.'.
It would make sense to include instruction in this case, too:
The directory is already associated with another Studio site. Please choose a different custom local path.
src/hooks/use-add-site.ts
Outdated
); | ||
} else { | ||
errorPathIsNotAvailable = __( | ||
'The directory is already associated with another site. Please choose a different "Site name" or adjust the "Local path".' |
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 user modifies the name and the inferred path conflicts with another site. The users won't see this error until they expand the toggle.
@sejas @nightnei I would propose to:
So it could say:
Also, when testing that, I noticed another issue related to case insensitivity. If users create a site in a FooBar directory and then try to add a site using the FooBar name, they won't get a correct error message: ![]() ![]() |
@wojtekn it makes sense, but for the first case of We don't add a lot of lines of code and difficult conditions, everything looks simple regarding the code, so keeping 2 different errors will give more benefits for UI and no difficulties for codebase. WDYT? |
@wojtekn good catch 👍 Reproduced and fixed. |
@nightnei sounds reasonable, the text is clear.
I'm unsure if Studio should explicitly support a case-sensitive or case-insensitive system. Shouldn't it be agnostic and rely on whatever |
I vote in favor of making Studio case insensitive on both platforms. We shouldn't allow two folders have the same name regarding the case of the letters. So |
Related issues
Testing Instructions
"Site name" change
Adding new site with existing folder
4.1 more specific - menthion that the directory is already connected specifically tosome site in Studio
4.2 concise - user selected some directory to connect to Studio, we don't know was their intention to create new site or add some existing WP folder, so saying "empty directory to create site" looks confusing if they wonted to add existed WP site.