Repository navigation
feat(client): one code field for a 6- to 12-digit sign-in code (wiki-v2 #815) - #88
Merged
Merged
Conversation
docmost#815) The emailed code moves from 6 to 8 digits one release after this ships. The 6-cell PinInput was hard-coded to 6, could not take a pasted "1234 5678", and 8 cells overflow a 360 px phone. It is now ONE text field: - inputMode numeric, autocomplete one-time-code, a visible label; - 6 to 12 digits once spaces and hyphens are stripped; submit from the sixth digit; - a paste or autofill of a whole code submits once; typing never does; - its error is the field's own, announced (role="alert"); - a 60 s resend countdown, the Junk/Clutter hint after a send, and an honest 429 ("Too many requests. Wait a few minutes, then try again.", naming Retry-After when the response carries one) on both the request and the verify. The rule lives in features/public/otp-code.ts (the console keeps its own copy: the fork cannot import super-repo code). All files are fork-owned (features/public/**, pages/public/**): no upstream seam. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct after a 429 (wiki-v2 docmost#815 review) Review round 1 of wiki-v2 PR 820 / docmost PR 88: - The copy leads with the code ("Email me a sign-in code", "enter the code below"): PR B makes the email code-only, and the page must stay true before and after it. The link-incomplete notice no longer says "6-digit". - requestEmail takes onRetryAfter, so a 429 that names its wait holds "Resend email" that long (useResendCooldown.start(seconds)), as the console already does. - After a verify error the remaining text is selected, so a pasted fresh code replaces a code kept after a 429 instead of appending to it. - Tests: the bridge-failure branch (a toast, the code kept, no field alert), the selection after a 429, the Retry-After hold, and onRetryAfter in the hook. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The wiki sign-in page's code entry is now ONE text field instead of a 6-cell PinInput. This is PR C of https://github.com/cccvu/wiki-v2/issues/815 (wiki-v2 issue 815): the emailed code moves from 6 to 8 digits one release AFTER this ships. It is paired with a super-repo PR (console + e2e + gitlink), https://github.com/cccvu/wiki-v2/pull/820.
Why. The PinInput was hard-coded to 6 (
length={6},otp.length < 6). It could not take a pasted1234 5678, and 8 cells overflow a 360 px phone.The field (
pages/public/passwordless-login.tsx)inputMode="numeric",autoComplete="one-time-code", the visible label "One-time code". Plain text, nevertype="number", which drops a leading zero and refuses the space.insertFromPaste,insertReplacementText, …) or a jump of more than one character. The same code is not auto-submitted twice.role="alert",aria-invalid), so it is announced: the bad-code message moved there from a toast. WCAG 2.2 SC 3.3.8: paste and autofill both work.Retry-Afterwhen the response has one. On verify, a 429 keeps the code (it may still be good). On request (use-passwordless.ts), a 429 no longer reads as "we couldn't send".One rule per tree.
features/public/otp-code.tsholds normalize/validate/bulk-entry/429 text;hooks/use-resend-cooldown.tsis the deadline-based countdown. The console keeps its own copy (services/admin-ui/src/otp-code.ts), since the fork cannot import super-repo code.Upstream boundary. Every file is fork-owned (
features/public/**,pages/public/**, both excluded prefixes). No upstream seam, noUPSTREAM_MODIFICATIONS.mdentry.scripts/check-upstream-boundary.shpasses.Tests
passwordless-login.test.tsx: 26 pass (11 kept + 15 new), including a paste of1234 5678, a 6-digit paste, an autofill with no input type, auto-submit once, typing never auto-submits, the hyphen strip, the malformed-code alert, the bad-code alert, the 429 with and withoutRetry-After, the Junk hint, and the countdown (fake timers).otp-code.test.ts(new) and three 429 cases inuse-passwordless.test.tsx.pnpm --filter client test: 990 run, 988 pass. The 2 failures also fail onwiki-v2without this change:use-user-role.test.tsx(native mode, on Node 26 locally), and thedate-localescan, a 6.5 s timeout under full-suite load that passes when run alone.tsc --noEmitclean, eslint clean on the touched files, and theBUNDLE_BUDGET_STRICT=1production build passes.🤖 Generated with Claude Code