Repository navigation
Name fields stop at 50 characters; one custom-pronoun parser for browser and server - #838
TheAnswerManIsHere wants to merge 3 commits into
Conversation
…save (#719) David, 2026-11-02: "It simply shouldn't allow them to type more than 50 characters. Make it clear that there's a length limit... Don't throw errors, simply don't allow the bad behavior." useNameField cuts typed or pasted input at 50 grapheme clusters, shows a running count from 40, says when it is at the limit, and says when the rest of a paste wasn't added. decisions.md and the plan record the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMMrrrX1dR5EdX15XJxkAZ
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5b5cb827a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // The field stops at the limit (David, 2026-11-02): characters past it | ||
| // are not taken, typed or pasted, so a name can never be too long to | ||
| // save, and the hint says why the typing stopped. | ||
| const next = truncateGraphemes(filtered, PERSONAL_NAME_MAX_GRAPHEMES); |
There was a problem hiding this comment.
Preserve existing suffixes when refusing overflowing edits
When a name already contains 50 characters and the user inserts a character at the beginning or middle, truncating the entire updated value accepts the insertion and deletes an existing character from the end. For example, inserting B before a 50-character name ending in Z removes that Z, rather than refusing the extra character. Pasting into the middle can similarly remove an existing surname suffix. Limit the inserted text to the available capacity, accounting for any selection being replaced, rather than truncating unrelated existing text.
Useful? React with 👍 / 👎.
David, 2026-11-02: "Shouldn't they match?" They should: splitCustomPronounSet in lib/api-zod is now the only parser of the six-part format. The browser's parseCustom wraps it (it accepted any marker and extra parts before), render-fact's resolveMap renders through the server resolver's parseCustomPronounSet (a malformed pipe string is they/them on both sides), and the server validator checks the shape with it. Reverses the PR #832 decision that kept a separate client parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMMrrrX1dR5EdX15XJxkAZ
…commendation) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMMrrrX1dR5EdX15XJxkAZ
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Workstream: #719
What & why
Two changes David asked for on 2026-11-02, after Phase 2 merged.
1. Name fields stop at 50 characters. "When a user is typing in a name and they exceed 50 characters, the input form shouldn't throw an error on save. It simply shouldn't allow them to type more than 50 characters. Make it clear that there's a length limit and they can't use such a long name. Don't throw errors, simply don't allow the bad behavior."
Every name field (the welcome sheet, the name tag, sign-up, Profile, onboarding, the meme builder's subject, the share recipient and the admin user forms) goes through one hook,
useNameField. That hook now:2. One custom-pronoun parser. "I'm not sure why you're allowing the browser's signed-out custom pronoun parser to have different logic from the server. Shouldn't they match?"
splitCustomPronounSet(lib/api-zod) is now the only parser of the six-part format: exactly six parts, the sixthsorp. Four places use it:parseCustom, which used to accept any marker and extra parts;resolveMap, through the server resolver'sparseCustomPronounSet, so a malformed pipe string is they/them on both sides;This reverses a PR #832 decision taken on my recommendation, and it is recorded in
decisions.md.Approved-plan oracle
Oracle source: Issue #719 (David's words above, 2026-11-02), amending
docs/plans/PLAN_IDENTITY_FLOW.md(now sha256ee0b814a360b9eb9ec77f9202f6ec813636c4adc5f4c820eefb9ea28c8d3e3d0).Product intent:
Must not change:
serializeCustom, always six parts withsorp) still parses and renders the same.Settled decisions:
decisions.md, 2026-11-02, and the plan's How it behaves while typing line).decisions.md, 2026-11-02).Decisions taken on my recommendation
- 10threshold inuse-name-field.tsx.maxLength.maxLengthcounts UTF-16 units, which would disagree with the server's count for accented letters typed as two code points. Undo: n/a. This is how the shared rule counts.Latitude granted to me: none.
Verification
npx vitest run(frontend): 99 files, 1021 tests passed. New and updated cases:parseCustomrefuses a non-s/pmarker and extra parts, as the server does.pnpm run typecheck: clean.Post-merge verification (live environment)
none needed
UAT
The name fields stop at 50 characters instead of erroring at save, and custom pronouns are read one way everywhere. The behaviour is pinned by tests; one step is David's feel check.
Setup
None. The machine steps run in CI, and the human step needs only a browser on the Repl.
Steps
1. A long name stops at the limit and says so
Do: In the welcome sheet on the Repl, type a long name until it stops, then paste a very long one.
Expect: Typing stops at 50 characters with a count shown as you near it and a line naming the limit. The paste lands cut to 50, with a line saying the rest wasn't added. No error appears when you save.
Lane: human
Judgement: Whether the count and the wording make the limit clear without feeling like an error is a feel only David can judge.
2. The field enforces the limit for typing and pasting
Do: Run the name-field tests.
Expect: A 60-character paste lands as 50; a 51st typed character is not taken; the count shows at 42 and not at 20.
Lane: ci
Check:
artifacts/overhype-me/src/hooks/use-name-field.test.tsx3. The browser parses custom pronoun sets exactly as the server does
Do: Run the browser pronoun tests.
Expect: A non-
s/pmarker or extra parts are refused, and an editor-produced set round-trips.Lane: ci
Check:
artifacts/overhype-me/src/lib/pronouns.test.tsRegression
R1. Disallowed characters are still refused with their hint
Do: Run the name-field tests.
Expect: An emoji is refused with the "English letters, numbers…" hint.
Lane: ci
Check:
artifacts/overhype-me/src/hooks/use-name-field.test.tsxR2. Custom pronoun sets still render their own forms on the server
Do: Run the resolver and renderer suites.
Expect: The five forms and both verb markers render as before.
Lane: ci
Check:
artifacts/api-server/src/__tests__/resolvedIdentityForms.test.tsNot bugs
🤖 Generated with Claude Code
https://claude.ai/code/session_01UMMrrrX1dR5EdX15XJxkAZ