Skip to content
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

Don't require users to type in a slug on WorkspaceCreateForm #4686

Open
mikerkelly opened this issue Oct 16, 2024 · 0 comments
Open

Don't require users to type in a slug on WorkspaceCreateForm #4686

mikerkelly opened this issue Oct 16, 2024 · 0 comments
Labels
deck-scrubbing Tech debt or other between-initiative tidy-up work frontend

Comments

@mikerkelly
Copy link
Contributor

mikerkelly commented Oct 16, 2024

The WorkspaceCreateForm (/{project_name}/new-workspace/) has a field, name, which must be a valid slug (a short label suitable for use in a URL, containing only letters, numbers, underscores or hyphens). If the user does not enter a valid slug, the validation fails server-side and the form reloads, which is slow (see #4685). It's not so-reasonable to require a human to type out a slug, or to require two trips to the form if they make a mistake. The UX here could be improved. #4682 added some help_text explaining the requirement, but this seems unsatisfactory.

Suggestion: Apply django.utils.text.slugify in clean_name() or wherever, to convert what the user entered to a valid slug. Presumably the issue is usually they have used spaces in the name, which is easily fixed while maintaining their intent. We already lower-case the name.

Alternatively/additionally the client-side JavaScript could prevent entering non-slug characters by adding an onkeypress event listener.

Or maybe name should be free human-readable text and the slug should be separate.

@lucyb lucyb added the deck-scrubbing Tech debt or other between-initiative tidy-up work label Oct 22, 2024
@mikerkelly mikerkelly changed the title Improve WorkspaceCreateForm name field UX Don't require users to type in a slug on WorkspaceCreateForm Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deck-scrubbing Tech debt or other between-initiative tidy-up work frontend
Projects
None yet
Development

No branches or pull requests

2 participants