You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default cell type switches from pixel to py when creating the fallback cell. Confirm this aligns with product expectations and does not break existing notebooks or parsing/rendering logic that assumes pixel as default.
Password validation now relies on a helper that checks for specials [!@#$%^&*]. Ensure this set matches backend rules and consider unicode or additional symbols if required to prevent mismatch between client and server validations.
required:
"Password is required",validate: (value)=>{construles=regPasswordRules(value);if(!rules.length)return"Minimum 8 characters";if(!rules.upper)return"At least one uppercase letter";if(!rules.lower)return"At least one lowercase letter";if(!rules.special)return"At least one special character";returntrue;
regPasswordRules is recreated each render and regexes run on every keystroke in validation. Consider memoizing or inlining minimal checks, and ensure the tooltip or other consumers use the same logic to avoid drift.
Avoid calling .length on possibly undefined values. Provide a default empty string to prevent runtime errors during initial render or when the field is cleared.
Why: Wrapping the password with a nullish coalescing default avoids runtime errors if value is undefined, aligning with the new function signature; it’s a solid defensive improvement with moderate impact.
Medium
Normalize validator input safely
Ensure value is a string to avoid passing null/undefined to the validator. Normalize the input to an empty string before validation to prevent crashes on empty or uninitialized values.
validate: (value) => {
- const rules = regPasswordRules(value);+ const rules = regPasswordRules(value ?? "");
if (!rules.length) return "Minimum 8 characters";
if (!rules.upper) return "At least one uppercase letter";
if (!rules.lower) return "At least one lowercase letter";
if (!rules.special) return "At least one special character";
return true;
},
Suggestion importance[1-10]: 7
__
Why: Normalizing value with ?? "" in the validator prevents passing undefined to regPasswordRules and improves robustness without altering behavior, offering a practical, low-risk enhancement.
Medium
Guard against breaking type change
Verify that the consumer logic expects the updated type value. If existing code still branches on "pixel", this change will break default cell creation. Consider keeping compatibility by mapping or falling back when the type is unrecognized.
Why: The suggestion correctly flags a potentially breaking change from type: "pixel" to type: "py". It’s contextually relevant but advisory (verification/todo) rather than a concrete fix, so impact is moderate.
Guard against non-string value in validation to prevent runtime errors when the field is undefined or not yet controlled. Coerce to string before checks to ensure regex and length tests are safe.
-control={- registerControl-}+control={registerControl}
rules={{
- required:- "Password is required",- validate: (value) => {- const rules = regPasswordRules(value);- if (- !rules.length- )- return "Minimum 8 characters";- if (- !rules.upper- )- return "At least one uppercase letter";- if (- !rules.lower- )- return "At least one lowercase letter";- if (- !rules.special- )- return "At least one special character";- return true;- },+ required: "Password is required",+ validate: (value) => {+ const pwd = typeof value === "string" ? value : "";+ const rules = regPasswordRules(pwd);+ if (!rules.length) return "Minimum 8 characters";+ if (!rules.upper) return "At least one uppercase letter";+ if (!rules.lower) return "At least one lowercase letter";+ if (!rules.special) return "At least one special character";+ return true;+ },
}}
Suggestion importance[1-10]: 7
__
Why: Adding a type guard for value improves robustness against undefined/non-string inputs and prevents regex/length runtime errors; relevant and accurate to the new validation logic.
Medium
Use canonical engine identifier
Verify that the engine type string matches accepted values; changing from "pixel" to "py" can break creation if "py" is unrecognized. If the system expects "python", use that canonical identifier to avoid runtime errors.
Why: The suggestion raises a valid concern but lacks evidence from the diff that "python" is the correct canonical type; it's speculative and proposes a change that may be incorrect.
Low
General
Remove unused watched value
Remove the unused regPassword to avoid stale reads and unnecessary re-renders. Keeping only the pure function regPasswordRules prevents potential runtime issues when regPassword is undefined during initial render.
Why: regPassword is no longer used after introducing regPasswordRules(value) and can be removed to avoid unnecessary watches; straightforward cleanup with low risk.
Ensure the type value matches the accepted enum/string literals used elsewhere (previously "pixel"). If downstream logic still expects "pixel", this change could break default cell creation. Either map "py" to the correct internal type or keep the original value to avoid runtime errors.
Why: If other parts of the app still expect type: "pixel", changing to "py" could break default cell behavior. The suggestion is context-aware and could prevent runtime issues, though it depends on broader app expectations.
Medium
Normalize password input
Guard against undefined by normalizing password to a string; some form libraries can pass undefined initially. Without this, calling .length or .test could throw at runtime. Default to an empty string to keep validation stable.
Why: Guarding against non-string values in regPasswordRules improves robustness and avoids potential runtime errors, especially during initial render. It's a reasonable defensive improvement with moderate impact.
Low
General
Trim input before checks
Trim whitespace before validation to prevent passwords that only meet rules via leading/trailing spaces. This avoids users bypassing length checks with spaces and keeps validation consistent with server-side norms.
validate: (value) => {
- const rules = regPasswordRules(value);- if (!rules.length)- return "Minimum 8 characters";- if (!rules.upper)- return "At least one uppercase letter";- if (!rules.lower)- return "At least one lowercase letter";- if (!rules.special)- return "At least one special character";+ const v = (typeof value === "string" ? value : "").trim();+ const rules = regPasswordRules(v);+ if (!rules.length) return "Minimum 8 characters";+ if (!rules.upper) return "At least one uppercase letter";+ if (!rules.lower) return "At least one lowercase letter";+ if (!rules.special) return "At least one special character";
return true;
},
Suggestion importance[1-10]: 6
__
Why: Trimming the password before validation prevents bypassing length checks with whitespace and aligns with common server-side validation, offering a sensible, low-risk enhancement.
User is able to see the python as default option in the cell and after deleting the cell, it remains python as default.
Password inline error is resolved for matched password check and creating native user successfully.
video attached for better reference
CC- @rameshpaulraj@Pranchaudhari
Refined password validation logic for registration.
Fixed
Default notebook cell language set to Python after cell deletion.
to commit the new content to the CHANGELOG.md file, please type:
'/update_changelog --pr_update_changelog.push_changelog_changes=true'
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
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.
This PR contains the following changes
--> Regarding 1563 - Made the default language as Python when the user delete the cell
--> Regarding 1666 - Updated the validation state functionality