Skip to content

Debugging v1beta #37

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

Merged
merged 3 commits into from
May 1, 2025
Merged

Debugging v1beta #37

merged 3 commits into from
May 1, 2025

Conversation

dgomie
Copy link
Owner

@dgomie dgomie commented May 1, 2025

No description provided.

@dgomie dgomie requested a review from Copilot May 1, 2025 05:50
@dgomie dgomie self-assigned this May 1, 2025
Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
legionoftones ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 5:50am

Copy link
Contributor

@Copilot Copilot AI left a 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 enhances username validation for both the Signup and ProfileSettings components.

  • Updated both components to validate usernames against a stricter regex ensuring 3-20 characters with allowed symbols.
  • Adjusted error handling and button labeling in Signup and reorganized error message rendering in ProfileSettings.

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/components/signup/Signup.js Added a new username validation function and integrated it into form checks; updated button label for consistency
src/components/profileSettings/ProfileSettings.js Replaced basic username length check with regex-based validation and repositioned error message rendering
Files not reviewed (2)
  • src/app/profile/profile.module.css: Language not supported
  • src/components/profileSettings/ProfileSettings.module.css: Language not supported

Comment on lines +26 to +29
const isUsernameValid = (username) => {
const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/;
return usernameRegex.test(username);
};
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The username validation function is duplicated across components. Consider extracting it into a shared utility module to reduce redundancy.

Suggested change
const isUsernameValid = (username) => {
const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/;
return usernameRegex.test(username);
};
import { isUsernameValid } from '../../utils/validation';

Copilot uses AI. Check for mistakes.

@@ -23,16 +23,25 @@ export const ProfileSettings = ({ currentUser }) => {
}));
};

const isUsernameValid = (username) => {
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The username validation function is duplicated across components. Consider extracting it into a shared utility module to reduce redundancy.

Copilot uses AI. Check for mistakes.

@dgomie dgomie merged commit 18663e4 into main May 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant