Repository navigation
Show a sign-in code as two steps, each with its own action - #177
Merged
Merged
Conversation
The prompted sign-in panel was a link, a code and a countdown in a column, and read as unfinished. It is now two numbered steps in the order they are used: 1. Open the sign-in page - the link, with an icon button that copies the code and then opens the page in a new tab. Copying comes first because a browser refuses a clipboard write once the new tab has focus. 2. Enter this code - shown large and spaced, with a copy button. A status line says what was just copied, or how long the code has left. The link and its button are offered only for an https address.
Review of PR #177: both buttons said "Code copied" before the clipboard write settled, so a refused or missing clipboard sent the operator to paste whatever they had copied before. Copy now reports the browser's answer: "copied" on success, and "could not be copied - type it from here" when the write is refused or the API is missing. The open button still starts the copy first and opens the page in the same click - a window opened after waiting is blocked as a pop-up - and reports the copy when it lands.
Second review of PR #177: - The mounted flag was cleared by the first unmount of React's development StrictMode cycle and never set again, so every copy result was dropped in the dev build. It is now set on every mount. - A copy failure never clears, and it was checked before expiry, so "type it from here" stayed on screen for a code that had run out. Expiry now wins.
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.
Why
The prompted subscription sign-in panel showed a link, a code and a countdown in a plain column and
read as unfinished. The operator also asked for a copy button beside the code, and a button beside the
link that copies the code and opens the page.
What changed
HarnessSignInCode: two numbered steps in the order they are used.page in a new tab (
noopener,noreferrer). Copy comes first: a browser refuses a clipboard writeonce the new tab has focus.
accepts only the vendor host).
WIDGETS.mdlists the new widget.Verification
dropping
noopenereach fail a test.