Repository navigation
Conversation
Add validation to the Co-Authors input field to display error messages in two scenarios: - When a user attempts to add their own account (preventing self-assignment). - When a user tries to add a co-author that has already been added (preventing silent failures on duplicates). This provides clear visual feedback and prevents logical redundancies. Fixes desktop#21736
Contributor
|
Thanks for your pull request! Unfortunately, it doesn't meet the minimum requirements for review:
Please update your PR to address the above. Requirements:
This PR will be automatically closed in 7 days if these requirements are not met. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add validation to the Co-Authors input field to display error messages in two scenarios:
This provides clear visual feedback and prevents logical redundancies.
Closes #21736
Description
This PR introduces explicit validation for the Co-Authors input field to prevent logical redundancies and improve UX by eliminating silent failures.
Currently, the app allows users to add their own account as a co-author, and silently ignores attempts to add duplicate co-authors without any visual feedback. While the raw Git CLI permits these, GitHub Desktop as a GUI should provide clearer guardrails.
Changes made:
Self-assignment prevention: Added validation to check if the entered handle matches the currently logged-in user. If it does, the UI now explicitly prevents the addition and displays an error state (warning message). (
app\src\ui\autocompletion\user-autocompletion-provider.tsx,app\src\ui\lib\author-input\author-input.tsx)Duplicate prevention feedback: Modified the logic so that when a user attempts to add an already existing co-author, the action is no longer silently ignored. Instead, it triggers an error state to clearly inform the user why the action was rejected. (
app\src\ui\lib\author-input\author-input.tsx)This provides users with immediate, clear visual feedback and prevents unnecessary confusion.
Screenshots
Before
UX.non-sense.in.Co-Authors.Before.mp4
After
UX.non-sense.in.Co-Authors.After.mp4
Release notes
Notes: Added validation and error feedback when attempting to add yourself or a duplicate user as a co-author.