~/talk

Building Complex UI with State Machines

Talkat WhatTheStack 2024 Β· on Saturday, 2024-09-14Β· [frontend-architecture]
slides:none on file

Argues that finite state machines make interactive UI logic explicit by building a TypeScript combo box with search-as-you-type, spinner, keyboard and mouse selection and a debounce. Uses xstate, a vs code visual editor and XState primitives like guards, assign, fromCallback actors and invoke; the machine is ~200 lines, the simulator shows transitions work, adding a debounce state fixes excessive requests, and the result replaces tangled React hooks with a single declarative statechart.

AI-written summary Β· about

  1. 0:00Introduction to state machines
  2. 1:20State machine terminology
  3. 3:16Defining the UI requirements
  4. 4:53Visual state machine design
  5. 7:22Building the visual logic
  6. 14:21Implementing the machine code
  7. 20:05Simulator and UI integration
  8. 22:18React UI implementation
  9. 24:35Adding debounce logic
  10. 25:34Comparison with hooks
  11. 26:49Pros, cons and conclusion
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark β€” the status bar button does the same
← β†’
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter β€” or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.