Repository navigation
Full-screen two-step item form, with real fields for every type - #15
Merged
Merged
Conversation
…tities and documents The form had been a 380px rail since it held four fields. It now holds seven types, three of which have a dozen fields each, and the save button had drifted permanently below the fold. It opens full screen and asks in two steps: what are you saving, then the form for that. Each type gets the fields it actually needs rather than a login's fields with the wrong labels on them. Cards get the part with real logic. The issuer is read from the number's prefix, the Luhn checksum is verified as you type, and the number is grouped as it is printed — including Amex's 4-6-5, because regrouping it into fours makes it harder to check against the card in your hand. A mistyped digit is otherwise discovered at a checkout months later, with no way to tell whether the card changed or the typing did. Expiry treats a card as valid through the end of its month, which is a fencepost worth getting right: the naive comparison writes off up to thirty days of a perfectly good card. Documents record what a document is and where it is kept, and say plainly that the file itself is not stored. Keeping a scan of a passport in a browser extension is a worse idea than it first sounds. The masked field is now labelled for the type that owns it — "Key or token", "Private key", "Security code (CVV)" — because calling a card's CVV a password made every form read as a login wearing a costume. Three things the change broke, all found by the tests rather than in use: - Every end-to-end helper filled the form without choosing a type, so the title field no longer existed when they reached for it. They now make the same choice a person does. - The API key spec filled a field called "Password", which that type no longer has. - Save was offered on the chooser, where pressing it could only produce a validation error. 936 unit tests, 43 end-to-end.
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.
The form had been a 380px rail since it held four fields. It now holds seven types, three with a dozen fields each, and the save button had drifted permanently below the fold.
Full screen, two steps: what are you saving? then the form for that type. Each type gets the fields it needs rather than a login's fields with the wrong labels on them.
Cards carry the real logic. The issuer is read from the number's prefix, the Luhn checksum is verified as you type, and the number is grouped as printed — including Amex's 4-6-5, because regrouping into fours makes it harder to check against the card in your hand. A mistyped digit is otherwise found at a checkout months later. Expiry treats a card as valid through the end of its month, a fencepost that otherwise writes off up to thirty days of a good card.
Documents record what a document is and where it is kept, and say plainly that the file is not stored — a scan of a passport in a browser extension is a worse idea than it sounds.
The masked field is labelled for its type — "Key or token", "Private key", "Security code (CVV)" — because calling a CVV a password made every form read as a login in costume.
Three things this broke, all caught by tests: every e2e helper filled the form without choosing a type; the API key spec filled a field that type no longer has; and Save was offered on the chooser where it could only produce a validation error.
936 unit tests, 43 end-to-end.