TT-7132 Fix variable shadowing in nameInUse callback in ProjectsScreen#245
Merged
sarahentzel merged 2 commits intodevelopfrom Apr 8, 2026
Merged
Conversation
…tion - Trimmed whitespace from team and project names before validation to prevent duplicates. - Updated nameInUse function to handle empty strings and ensure consistent comparison. - Enhanced helper text and disabled state logic based on trimmed name values in TeamDialog and ProjectDialog components.
dcc85a3 to
b86c231
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Improves team/project name validation in dialogs by trimming whitespace before duplicate checks and commit, reducing accidental duplicates caused by leading/trailing spaces.
Changes:
- Normalize (trim) team and project names before validation and when committing changes.
- Update duplicate-name checks (
nameInUse) to be more consistent with trimmed comparisons and empty input handling. - Adjust helper text and primary action disabled-state logic to use trimmed values.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/renderer/src/routes/ProjectsScreen.tsx | Trims project name before duplicate detection in the add-project flow. |
| src/renderer/src/components/Team/TeamDialog.tsx | Trims team name on commit; updates duplicate check and button/helper logic to use trimmed values. |
| src/renderer/src/components/Team/ProjectDialog/ProjectDialog.tsx | Trims project name on commit; disables primary action based on trimmed name and trimmed duplicate check. |
| src/renderer/src/components/Team/AddCard.tsx | Updates duplicate check to compare trimmed project names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oid variable shadowing Agent-Logs-Url: https://github.com/sillsdev/apm/sessions/d2c2f767-0ee1-4b29-9d7c-694ec74a689f Co-authored-by: gtryus <2340803+gtryus@users.noreply.github.com>
Copilot
AI
changed the title
TT-7132 name handling in Team and Project dialogs for improved validation
TT-7132 Fix variable shadowing in ProjectsScreen nameInUse callback
Apr 8, 2026
Copilot
AI
changed the title
TT-7132 Fix variable shadowing in ProjectsScreen nameInUse callback
TT-7132 Fix variable shadowing in nameInUse callback in ProjectsScreen
Apr 8, 2026
sarahentzel
approved these changes
Apr 8, 2026
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.
The local
tvariable inside thenameInUsecallback shadowed the outert = cardStringslocalization variable, making the code ambiguous and error-prone.ProjectsScreen.tsx: Renamed trimmed-name local fromt→trimmedNameinnameInUse