Provide more specific errors for incorrect Local path during creating a site - #901
Conversation
sejas
left a comment
There was a problem hiding this comment.
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.
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.
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.
| ); | ||
| } 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.
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 |
@sejas 👍 P.S. In my comment, I said "case sensitive" - my bad, I meant "case insensitive" ( |
wojtekn
left a comment
There was a problem hiding this comment.
Looks clear in both cases now.


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.