Skip to content

fix(onboarding): accept periods in person names and surface pre-fill validation errors - #10170

Open
Emreceyhnn wants to merge 2 commits into
makeplane:previewfrom
Emreceyhnn:fix/onboarding-gitlab-name-with-period
Open

Emreceyhnn wants to merge 2 commits into
makeplane:previewfrom
Emreceyhnn:fix/onboarding-gitlab-name-with-period

Conversation

@Emreceyhnn

@Emreceyhnn Emreceyhnn commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Fixes #10164

When signing in with GitLab, the onboarding Create your profile step pre-fills the Name field with the GitLab account name — often username-shaped with a period (e.g. john.doe). validatePersonName rejected periods, and because the form uses mode: "onChange", react-hook-form marked the pre-filled field invalid without populating errors. The result: Continue stays disabled with no visible error, and users have to guess that the period was the problem.

Root cause

  • PERSON_NAME_REGEX (packages/utils/src/validation.ts) did not allow periods.
  • Onboarding forms never re-validated pre-filled values, so the error message never appeared until the user edited the field.

Changes

  1. packages/utils/src/validation.ts — PERSON_NAME_REGEX now allows periods (/^[\p{L}\s'.-]+$/u). Periods are legitimate in real names (J. R. R. Tolkien) and are not an injection-risk character. All XSS/SQL/template-injection characters are still blocked by hasInjectionRiskChars.
  2. apps/web/components/onboarding/steps/profile/root.tsx and apps/web/components/onboarding/profile-setup.tsx — run trigger(["first_name", "last_name"]) on mount so any invalid pre-filled value surfaces its validation message immediately, instead of leaving the user stuck on a disabled Continue.

Testing

  • Regex unit-checked against: John, O'Brien, Jean-Paul, J. R. R. Tolkien, john.doe, 李明, José (all valid); John<script>, a|b, x#y (all rejected).
  • Full UI/local typecheck could not be run here (no deps installed in this environment); changes are minimal and follow existing codebase patterns.

Happy to adjust wording or add the validation-message behavior to other forms if the maintainers prefer.

Summary by CodeRabbit

  • Bug Fixes
    • Validation results for pre-filled first and last names now appear without requiring users to edit the fields.
    • Names containing periods are now accepted, and the related validation message and example reflect this format.

…validation errors

Fixes makeplane#10164

GitLab sign-in pre-fills the onboarding profile Name field with the
GitLab account name, which is often username-shaped and contains a
period (e.g. john.doe). validatePersonName rejected periods, and because
the form uses mode:"onChange", react-hook-form marked the prefilled
field invalid without populating errors — leaving users stuck on a
disabled Continue with no explanation.

Changes:
- PERSON_NAME_REGEX now allows periods (J. R. R. Tolkien, john.doe).
  Periods are a legitimate character in names and not an
  injection-risk character; XSS/SQL risk characters are still blocked
  by hasInjectionRiskChars.
- Onboarding profile forms (steps/profile/root.tsx and
  onboarding/profile-setup.tsx) now run trigger on first_name/last_name
  on mount, so any invalid pre-filled value shows its validation
  message immediately instead of silently disabling Continue.
@CLAassistant

CLAassistant commented Nov 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3cb6c45e-1e0a-46f6-aad9-2cd1e2e85e9f
Commits

Reviewing files that changed from the base of the PR and between ed6eb75 and 07a2a42.

Files selected for processing: 1
  • apps/web/components/onboarding/profile-setup.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The shared person-name validator now accepts periods. Both onboarding profile forms trigger validation for prefilled first and last names when a user is present.

Changes: Onboarding name validation

Layer / File(s) Summary
Allow periods in person names
packages/utils/src/validation.ts
PERSON_NAME_REGEX and the validation message allow periods. The example includes a name with initials.
Validate prefilled onboarding names
apps/web/components/onboarding/profile-setup.tsx, apps/web/components/onboarding/steps/profile/root.tsx
Both forms trigger validation for first_name and last_name when a user is present and either name changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: dheeru0198

Merge Risk: Minimal · up to 07a2a

Names containing periods are accepted, and onboarding now requests validation of prefilled names. No actionable merge-blocking issue remains identified; normal checks should complete before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the two main changes: periods are now accepted in person names, and pre-fill validation errors are surfaced. Both match the diff, which changes PERSON_NAME_REGEX and adds trigger calls…
Description check Passed The description covers the core of the template. It explains the problem and root cause, lists the changes to validation.ts and the two onboarding components, and gives test notes. It links the issue …
Linked Issues check Passed Issue #10164 requires two behaviors. First, names with periods must be accepted. Second, an invalid pre-filled name must show its validation message at once. At the reviewed head, `packages/utils/src/…
Out of Scope Changes check Passed All three changed files implement #10164. validation.ts changes the person-name regex and its error text to accept periods. Both onboarding profile forms add the same mount-time validation for pre-f…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the two main changes: periods are now accepted in person names, and pre-fill validation errors are surfaced. Both match the diff, which changes PERSON_NAME_REGEX and adds trigger calls on mount in the two onboarding profile components. The title is long at 86 characters, but it stays specific and accurate.

Full details: Description check

Explanation

The description covers the core of the template. It explains the problem and root cause, lists the changes to validation.ts and the two onboarding components, and gives test notes. It links the issue with 'Fixes #10164'. The template's 'Type of Change' checkboxes are not marked, and the 'Screenshots and Media' section is missing. The 'References' section is filled only in the form of 'Fixes #10164'. These are non-critical gaps, so the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #10164 requires two behaviors. First, names with periods must be accepted. Second, an invalid pre-filled name must show its validation message at once. At the reviewed head, packages/utils/src/validation.ts sets PERSON_NAME_REGEX to /^[\p{L}\s'.-]+$/u. validatePersonName still calls hasInjectionRiskChars, which blocks &lt;&gt;'"{}[]*^!#%. So john.doe and J. R. R. Tolkien pass, and John&lt;script&gt; fails. Second, apps/web/components/onboarding/steps/profile/root.tsx and apps/web/components/onboarding/profile-setup.tsx both import useEffect from React. Both call trigger(["first_name", "last_name"]) in an effect when user exists. The effect depends on user?.first_name and user?.last_name. This fixes the prior FAIL, which came from a missing useEffect import in profile-setup.tsx. Note: the PR testing note lists O'Brien as valid. The unchanged hasInjectionRiskChars pattern still rejects '. This note is inaccurate, but the behavior is pre-existing and is not part of #10164. No automated UI test is requested by the issue. Build or typecheck was not run in this review, so compile success rests on source reading.

Full details: Out of Scope Changes check

Explanation

All three changed files implement #10164. validation.ts changes the person-name regex and its error text to accept periods. Both onboarding profile forms add the same mount-time validation for pre-filled names. The profile-setup.tsx change applies the same fix to a second onboarding profile form. The issue scope covers onboarding profile name entry, so this change is related. No unrelated behavior change was found in the reviewed diff summary. The injection-risk checks and other validators are unchanged.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

@Emreceyhnn

Copy link
Copy Markdown
Author

Hi maintainers — the onboarding name/period fixes are in and the useEffect import flagged in earlier review is already resolved in the current head. Ready for review — happy to adjust per feedback. Thanks!

@Emreceyhnn

Emreceyhnn commented Nov 4, 2026 •

Copy link
Copy Markdown
Author

✅ CLA has been signed, CodeRabbit review is complete, and all checks have passed. The PR is ready to be merged. Please take a look when a maintainer is ready to merge — thanks!

This branch has not been deployed

No deployments
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.

[bug]: Onboarding blocks GitLab users whose name contains a period, with no error shown

2 participants