Skip to content

Conversation

@MapleSyrupy
Copy link
Collaborator

Teachers can no longer set grade to less than 1 or more than 13, and also cannot use special characters (or number) for names, unless its a dash.

@gemini-code-assist
Copy link

Summary of Changes

Hello @MapleSyrupy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances data integrity and user experience by introducing robust validation for student names and grades. It ensures that all student data adheres to predefined formats and ranges, both at the API level and directly within the user interface. This prevents invalid data from entering the system and provides immediate feedback to users. Additionally, a new Chips UI component has been integrated into the design system, and development dependencies have been updated.

Highlights

  • Stricter Data Validation: Implemented comprehensive validation for student names and grades, ensuring names only contain letters, spaces, and hyphens, and grades are between 1 and 12. This validation is applied both on the backend API and the frontend forms.
  • Client-Side Error Handling: Introduced client-side validation using Zod for student data input, with clear error messages displayed directly on the forms for a better user experience.
  • New UI Component: Added a new reusable Chips component to the design system, complete with Storybook stories for easy development and testing.
  • Dependency Update: The mustache package has been added as a new dependency.
  • Build Artifact Exclusion: Storybook build output (storybook-static) is now ignored in .gitignore to prevent unnecessary commits.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces input validation for student names and grades, both on the backend and client-side, which is a great improvement for data integrity. My review focuses on ensuring consistency and correctness of these new validation rules. I've found a few inconsistencies in the grade validation range between the implementation and the PR description. Additionally, there are some opportunities to improve error handling and feedback on the client-side for a better user experience. I've also pointed out a couple of minor issues in the React components and Storybook files.

clearTimeout(timeoutId);
}
};
}, [student, setBreadcrumbs, formError]);

Choose a reason for hiding this comment

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

medium

The dependency array for this useEffect includes student and setBreadcrumbs, which are not used inside the effect. This can cause the timeout to be reset unnecessarily. The effect should only run when formError changes.

Suggested change
}, [student, setBreadcrumbs, formError]);
}, [formError]);

first_name: data.get("firstName") as string,
last_name: data.get("lastName") as string,
email: (data.get("email") as string) || null,
grade: Number(data.get("grade")) || 0,

Choose a reason for hiding this comment

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

medium

The || 0 is redundant here. The zod schema validation on line 135 already ensures that grade is a number greater than or equal to 1. If the validation passes, Number(data.get("grade")) will be a valid number, so the fallback to 0 is unnecessary and could be confusing.

Suggested change
grade: Number(data.get("grade")) || 0,
grade: Number(data.get("grade")),

@MapleSyrupy MapleSyrupy linked an issue Nov 7, 2025 that may be closed by this pull request
@MapleSyrupy
Copy link
Collaborator Author

Error handling is a bit of a mess with this PR, but I don't think that is the main focus of the issue, so it's more of a stopgap measure.

MapleSyrupy and others added 3 commits November 6, 2025 16:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

Validation issue

3 participants