-
Notifications
You must be signed in to change notification settings - Fork 25
feat: improve visual representation on file name input errors #876
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
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.
Pull Request Overview
This pull request updates the visual representation of file name input errors by replacing the deprecated checkSpaceNameModalInput validation with the new isSpaceNameValid validation and enhancing error message handling across components. Key changes include:
- Replacing checkSpaceNameModalInput with isSpaceNameValid in various actions and components.
- Updating tests to remove deprecated validation usage and add coverage for the new validation logic.
- Enhancing the OcTextInput component to display error messages with a debounced update.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/support/api/graph/userManagement.ts | Changed mutable variable declaration to const. |
| packages/web-pkg/tests/unit/composables/spaces/useSpaceHelpers.spec.ts | Removed tests for checkSpaceNameModalInput. |
| packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsEditReadmeContent.spec.ts | Removed checkSpaceNameModalInput mock. |
| packages/web-pkg/tests/unit/composables/actions/helpers/useIsResourceNameValid.spec.ts | Added tests for new isSpaceNameValid logic. |
| packages/web-pkg/src/composables/spaces/useSpaceHelpers.ts | Removed checkSpaceNameModalInput from the exported API. |
| packages/web-pkg/src/composables/actions/spaces/useSpaceActionsRename.ts | Replaced checkSpaceNameModalInput with an inline validation callback using isSpaceNameValid. |
| packages/web-pkg/src/composables/actions/helpers/useIsResourceNameValid.ts | Added new implementation for isSpaceNameValid. |
| packages/web-pkg/src/composables/actions/files/useFileActionsCreateSpaceFromResource.ts | Updated inline onInput callback to use isSpaceNameValid. |
| packages/web-pkg/src/components/AppBar/CreateSpace.vue | Replaced checkSpaceNameModalInput with isSpaceNameValid in the input callback. |
| packages/design-system/src/components/OcTextInput/OcTextInput.vue | Enhanced error message display with a debounced update via lodash-es. |
Comments suppressed due to low confidence (2)
packages/web-pkg/tests/unit/composables/spaces/useSpaceHelpers.spec.ts:4
- The tests for checkSpaceNameModalInput have been removed. Please ensure that the new isSpaceNameValid validation logic is adequately covered in the unit test suite.
describe('useSpaceHelpers', () => {
packages/design-system/src/components/OcTextInput/OcTextInput.vue:234
- [nitpick] Introducing a debounced update for error messages can improve UX, but please confirm that the 800ms delay fits the design requirements across different user interactions.
const displayedErrorMessage = ref<string | undefined>(errorMessage)
packages/design-system/src/components/OcTextInput/OcTextInput.vue
Outdated
Show resolved
Hide resolved
|
@kulmann Big Improvement! Before this change with email validation, we needed to blur (unfocus) the input field, now we validate after 1000ms after the user stopped typing and validate then =) |
packages/design-system/src/components/OcTextInput/OcTextInput.spec.ts
Outdated
Show resolved
Hide resolved
kulmann
left a comment
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.
Awesome improvement 😍
One weird thing I found, maybe for a followup: When I create a folder, the error messages from validation are nicely debounced now, but the submit button of the modal still immediately disables/enables based on the validation. 😅 So if I type multiple words as folder name, separated by blanks, each blank will immediately disable the submit button. Does it make sense to debounce the disabled state of the button as well?
I get your point, but to be honest, I would leave everything as it is. |
Description
Related Issue
How Has This Been Tested?
Types of changes