UI Questions Cheatsheet
The checklist a UI build is graded against — instances, state, HTML and forms, network, keyboard, edge cases, strings — as a question of its own, then one problem per section in the order you would run them.
What Do You Check Before Calling a UI Component Done?
Frontend · The review you run on your own build: instances, state, HTML, forms, network, keyboard, edge cases, strings.
Frontend · A tab UI packaged as an initializer — two independent instances from one function.
Frontend · Store only the leaves; every parent's checked and indeterminate state is derived from the leaves beneath it.
Multi-Step Form With a Shared Store
Frontend · Three steps, one reducer: data survives Back, each step validates before Next, and submitting locks the form.
Frontend · Native attributes carry the rules, one message per field is linked by aria-describedby, and the button locks while the request is out.
Frontend · Real radio inputs behind the stars: the form submits itself, the keyboard works, N instances are N names.
A Tooltip Library From data Attributes
Frontend · One tooltip node, delegated listeners, keyboard focus and Escape — in plain DOM, not a component.
Image Carousel With One Image Element
Frontend · Previous, next and page buttons that wrap around, any aspect ratio fitted to a fixed frame, and a single <img>.
Frontend · Three states the server confirms and one it hasn't: pending blocks a second click, failure shows its message, the label never changes.
Typeahead with Keyboard Navigation
Frontend · Debounce the query, abort the stale request, cache by query, wrap the arrow keys, wire the combobox.
Frontend · Three pieces of state — page, page size, sort — and rows derived from them in render.
Frontend · One state value, scrollTop; a spacer as tall as the whole list; and only the rows under the viewport in the DOM, keyed by id.
Frontend · A promise around a <link>, memoized by href, that forgets failures so a retry can work.
Frontend · HTTPS, CSP, cookie flags and escaping — each named with the attack it stops.