skip to content

A vet booking app's workshop shows components only under the default theme, and a partner clinic's theme shipped an unreadable booking-status chip. How should the workshop change, and how do you measure its coverage?

level: seniorimportance: should knowfreq 38%

answer

  1. one theme seen, others assumed
  2. switch through the real mechanism
  3. every example under every theme
  4. spec states versus examples
  5. presence is not correctness

basics

~20 s

Add a theme switcher that applies every shipped theme through the same mechanism apps use, render every example under each, and review a side-by-side view. Measure coverage as specified variants and states with examples, across themes.

solid answer

~50 s

The chip was never seen under the partner theme, so nobody noticed its *waitlisted* variant resolved to pale text on a pale fill. The workshop needs a **theme switcher** that applies each shipped theme through the **same mechanism consuming apps use** — not a workshop-only approximation — plus a side-by-side view of each example under every theme for review when components or theme values change. For **coverage**, count what actually protects users: exported components with at least one example, specified variants and states with an example, and examples that render under every shipped theme. A build check can fail when an exported component or a declared variant has no example, or when an example fails to render under a theme. These measure presence, not correctness: someone or some test still has to judge what the rendered chip looks like.

go deeper

for a junior

Recall that the workshop should let anyone switch every example to any shipped theme, and why seeing only the default is risky.

for a middle

Explain why theme switching must use the real theme mechanism, and how state coverage compares spec states with examples.

for a senior

Diagnose how the unreadable chip escaped, add build checks for missing examples and failed renders under each theme, and set up side-by-side review.

for a principal

Decide which coverage measures the library reports and enforces, and where workshop checks stop and the library's test layers take over.

## What went wrong A veterinary clinic booking app's library serves the main product and several partner clinics, each with its own theme. The workshop rendered every example under the **default theme only**. The booking-status chip's *waitlisted* variant looked fine there. Under one partner's theme, the role it used for text and the role it used for its fill resolved to two pale values, and the chip became unreadable. Nothing in the workshop could have shown it: the combination was never rendered. The gap is not in the chip. It is that the workshop presented one theme as if it were all of them. This pattern is common for a simple reason: the default theme is where designers and engineers spend their days, so it is the most polished and the most looked at. Secondary themes are applied by values alone and rarely viewed component by component, so their defects collect quietly until a partner's users find them. ## Theme switching done properly 1. **A global switcher.** One control changes the theme for every example, and the choice is part of the link, so *waitlisted chip, partner theme* can be shared. 2. **The real mechanism.** The workshop applies a theme exactly the way consuming apps do. A workshop-only approximation — hand-picked colors, a separate copy of the values — shows something users never get, which is worse than showing nothing. 3. **Every shipped theme.** The list comes from the system's own list of themes, so a new theme appears in the workshop automatically. 4. **A side-by-side view.** For review, each example rendered under every theme at once, so a reviewer scans one grid instead of switching back and forth. 5. **Other context axes.** The same switcher approach covers any other context the system supports — density, text size, reading direction — each owned and specified elsewhere, all rendered here. ## Measuring coverage | Measure | How it is counted | What a gap means | |---|---|---| | Component coverage | exported components with at least one example | a component nobody can see in isolation | | State coverage | specified variants and states with an example | an unseen state, likely untested | | Theme coverage | examples that render under every shipped theme | a theme where problems cannot be seen | | Fixture use | examples also rendered by tests | a state that is shown but never exercised | | Health | examples that render without error | a catalog that has started to rot | **State coverage** is the most revealing: it compares the spec's list of variants and states with the example list, so it finds exactly the kind of gap that let the chip ship. A raw count of examples per component says little; ten examples of the default state cover less than three well-chosen ones. ## Enforcing it - A **build check** fails when an exported component has no example, or when a variant the component declares has none. - Every example is **rendered under every shipped theme** in the build; one that throws or renders nothing fails. This proves that it renders, not that it looks right. - Changes to shared theme values trigger a review of the side-by-side view for the components they touch. - Examples have **owners**, the same as the components. ## What coverage cannot tell you - **Presence is not correctness.** A rendered, unreadable chip counts as covered. Judging it takes a person reviewing the grid or the library's test layers — visual comparisons across themes and automated contrast checks — which belong to the test strategy, not to the workshop. - **Specs can be incomplete.** State coverage is only as good as the state list it compares against. - **Real pages still differ.** The workshop shows components under each theme, not whole pages. ## On native mobile Native preview catalogs can render the same component under several themes side by side, and the same measures apply: specified states with a preview, previews under every shipped theme, and a build that fails when a declared variant has no preview.

  • Why is a workshop-only approximation of each theme dangerous?
    It shows what the workshop author thinks the theme looks like, not what users get. If the real theme mechanism resolves a role differently — a missing value, a different fallback — the workshop looks fine while production is broken. False confidence is worse than a visible gap, because nobody goes looking.
  • Your state coverage is 100% but a broken state still shipped. How can that happen?
    Coverage counts presence. The state had an example, but nobody looked at it under the affected theme, or no test checked what it rendered, or the spec itself missed the state. The fix is not a higher number but pairing the examples with review and the library's test layers.

saying these in an interview costs you the question

  • If a component looks right in the default theme, it looks right in all of them.
  • A workshop can approximate each theme with its own copy of the values.
  • More examples per component means better coverage.
  • 100% example coverage means every state is correct.
  • Theme review in the workshop is only needed when a new theme is added.