Carta Operum

Journal ◆ Money

Sizes, extras and a running total

A dish sheet whose price never disagrees with the cart.

A burger has a size, three kinds of cheese, a side and a note for the kitchen, and every one of them moves the price. The dish sheet in Galley shows a running total on its button, and the rule I care about is that this number is the number the cart will show.

To keep them identical there is one function that prices a dish from its base, its chosen size and its extras, and both the sheet and the cart call it. The sheet holds a selection, not a price, so there is nothing to fall out of step: change the size and the total is computed again from scratch. The server prices the same selection once more at checkout, and the two must agree or the order is refused.

Extras come in kinds: pick exactly one size, pick up to two sauces, pick any number of toppings. Encoding those limits in the data and not in the screen lets the sheet disable the choices that are not allowed, instead of scolding after a tap. The details are small. They separate an order screen that feels fast from one that feels fiddly.