How Designers and Engineers Agree on When an Interaction Is Done

Write interaction behavior as sentences anyone can check, mark what must ship and what can be tuned, and automate the parts that break, with a template

The designer says the panel feels off. The engineer says it matches the file. Both are right, because the file never said what should happen when someone presses Escape, taps twice, or opens it on a slow connection. "Done" was never defined, so each of them defined it alone.

An interaction acceptance test is a sentence both people agree on before the work starts and can check when it ends. It takes ten minutes to write, and it replaces most of the comments on the pull request.

Write it as a situation, an action and a result

Take a filter panel on a page of orders. The mockup shows it open. These four lines describe how it behaves:

Filter panel

1. With the panel closed, pressing Filters opens it and moves focus
   to the first field.
2. With the panel open, pressing Escape closes it and returns focus
   to the Filters button.
3. With the panel halfway open, pressing Filters again reverses it
   from where it is. It does not jump.
4. On a slow connection, choosing a filter shows it as selected at
   once. If the request fails, it returns to its last state and
   says why.

Each line can be checked by someone who was not in the meeting. "Smooth", "snappy" and "delightful" cannot, so translate them. If smooth means it never jumps when interrupted, write that.

Decide who decides

Go through the lines together and mark each with one of three letters:

  • M, must. The change does not merge without it. Keyboard access and losing someone's data are always here.
  • T, tune. The behavior is agreed and the exact value is open. The designer adjusts it in the running build.
  • L, later. It has its own ticket, with a link. A later without a ticket is a no.

The T lines are where designers and engineers usually lose days, passing screenshots back and forth over 40 milliseconds. Put the value in one named place, such as a CSS variable, and let the designer change it directly.

Agree in the running build

Meet over a preview link as soon as the first version moves, even if it is ugly. Fifteen minutes, on a real phone and a laptop. One person performs the lines in order and the other says pass or fail. Anything new that comes up becomes a line with a letter, or it gets dropped.

This is also the moment to ask what a detail costs. An engineer may know that a small change to the animation saves two days. A designer may know that nobody will miss it. Neither can make that trade alone.

Automate the lines that will break again

Focus and keyboard behavior break quietly, months later, when someone changes something nearby. Those lines deserve a real test. This one covers line 2 with Playwright:

import { test, expect } from '@playwright/test'

test('Escape closes the filter panel and returns focus', async ({ page }) => {
  await page.goto('/orders')
  const button = page.getByRole('button', { name: 'Filters' })
  const panel = page.getByRole('dialog', { name: 'Filters' })

  await button.click()
  await expect(panel).toBeVisible()
  await page.keyboard.press('Escape')
  await expect(panel).toBeHidden()
  await expect(button).toBeFocused()
})

The test reads almost like the sentence, which is a good sign that the sentence was clear. Leave feel to people. No test will tell you that a spring is too soft.

A template for your next ticket

Interaction: [name]
Preview: [link]

[M] With ___, doing ___ results in ___.
[M] Using only the keyboard, ___.
[T] ___ takes about ___ ms. Variable: ___
[L] ___ (ticket: ___)

Checked on: [phone], [browser], reduced motion
Agreed by: [designer], [engineer]

Try it on one interaction this week, ideally one that has already bounced back twice. If you work alone, write it anyway. The designer you were on Monday and the engineer you are on Thursday disagree more than you would think.

The topic came from Design Engineering at Vercel, a free account of how one team moves between design and code, including when an animation is worth its cost.

More in Design engineering

← All guides