Skip to content

feat(onboarding): restrict display name to ASCII letters, digits, and spaces - #933

Merged
bmc08gt merged 1 commit into
mainfrom
feat/onboarding-display-name-ascii
Sep 30, 2026
Merged

bmc08gt merged 1 commit into
mainfrom
feat/onboarding-display-name-ascii

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

During onboarding, the display name is now accepted only if, after trimming, it is 1–64 characters of A-Z, a-z, 0-9, or a space (U+0020). Any other name makes validatedDisplayName nil, so Next stays disabled, as it already does for an empty name. ProfileCreationState and the other name screens keep the existing rule.

  • DisplayNameValidator gets init(asciiOnly: Bool = false). init() behaves as before.
  • OnboardingNameViewModel uses DisplayNameValidator(asciiOnly: true). remainingCharacters still counts trimmed scalars, which for ASCII equals characters.

Android applies the same rule in code-payments/code-android-app#1641.

DisplayNameValidatorTests adds ASCII-only cases: accepted, trimmed, and double-space names; rejected accents, punctuation, emoji, tab, NBSP, all-space, and 65-letter names; and "José" still accepted by the default validator. ./Scripts/test.sh FlipcashCoreTests/DisplayNameValidatorTests: 10 passed.

… spaces

Add an opt-in asciiOnly mode to DisplayNameValidator and enable it for the
onboarding name step only. The default validator is unchanged.
@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@bmc08gt
bmc08gt merged commit 6297da0 into main Sep 30, 2026
1 check failed
@bmc08gt
bmc08gt deleted the feat/onboarding-display-name-ascii branch October 5, 2026 15:16
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