UX guides

Recurring UX decisions settled once, with the test to apply and the cases that look like exceptions. First guide: banner or toast?

docs/ux-guides.md · Decisions that come up again and again, written down once

Decisions that come up again and again, written down once so a page does not have to re-argue them. Each guide names the rule, the test to apply, and the cases that look like exceptions but are not. Where a guide trades against a principle in DESIGN.md, it says which one and why.

A guide earns its place when the same question has been answered twice by hand. Add one here, and name it in the pull request.


Banner or toast?

The rule: a toast reports what you just did; a banner reports what is true about the thing you are looking at.

A toast is an answer to an action. Someone pressed a button, the system did the thing, and the toast confirms it and gets out of the way. It is transient because the information is transient: once you have read "Report requested", it has done its whole job.

A banner is a statement about the record or the page. It was not caused by the person reading it, it is still true while they read it, and it stays true after they look away. It sits in the page because it belongs to the page.

The test

Ask "did this person's last click cause this?"

  • Yes → toast. Saved, reordered, enabled, requested, sent, deleted.
  • No → banner. A sync failed overnight. The bank opened a dispute. This account has convenience fees on, so here is the next step.

Then ask "is it still true in five minutes?"

  • No → toast. It described an event.
  • Yes → banner. It describes a state, and a state that disappears after five seconds is a state nobody can act on.

Both questions should agree. When they disagree, the second one wins: something durable belongs in the page even if a click revealed it.

Worked examples from this prototype

SurfaceWhichWhy
"Payment type order saved" after a dragToastThe drag caused it; a minute later it is just how the list is
"Credit Card enabled" after a toggleToastSame — the toggle is the question, the toast is the answer
"Report requested. It will be emailed…"ToastA deliberate request, confirmed and done. It used to be an in-page banner, which left a permanent green box sitting under a form you were finished with
"Refund failed" on a paymentBannerNobody clicked to cause it, and the customer is still owed until a refund goes through. Retry refund sits beside it, and the banner goes once a later refund for the same order is pending or succeeded (2026-10-13)
"Accounting sync failed" on a paymentBannerNobody clicked to cause it, and it stays failed until someone fixes it. The fix (Retry sync) belongs beside the explanation
"This payment is disputed"BannerA fact about the record, arriving from outside
"Skipped for accounting sync"BannerA state of the record, with the action that leaves that state
"3 of your customers have a debit card on file" (Convenience Fee)BannerNobody clicked to cause it, and it stays true until those cards change. It replaced the "Next: Choose which customers pay" banner (2026-11-09), whose job the who-pays card now does: featured while nobody pays
"Convenience fees are off. We're removing the fee from open orders now."BannerTurning fees off started it, but it describes work still going on, then its outcome — and a failure has to stay put with Contact support beside it. The second question wins
"Convenience fees on for 3 customers", from the customer pickerToast, with UndoThe click caused it and the count on the page already shows it; the toast is there for the Undo (P4)
A rail value saved through InlineEdit, a copy from CopyValueNeither — a tick in placeThe click caused it, so by the test it is a toast; but the new value is already on screen where the person was looking, and the act is too small for a panel. InlineEdit's glyph slot shows a green circle-check for 2s; CopyValue turns the whole button status-success-bg with a check for 2s (the workshop's Copy Button, 2026-10-08). Either way an aria-live line says it aloud. Three edits down a rail would otherwise stack three "Saved" toasts over the rail itself (2026-10-07)
Form validation ("Enter a fee percentage…")Neither, in generalErrors belong against the field that is wrong. A banner is for a form-wide failure with no single field to blame

Consequences

  • A toast must never be the only place something is said. It disappears, and it may be missed entirely — off-screen, on a slow read, in a screen reader that is mid-sentence. The page must already show the new truth: the row has moved, the switch is on. The toast is confirmation, never the record.
  • Never toast an error the person cannot act on from the toast. An error that needs a decision needs somewhere to stand still. Toast "Could not save" only when the state is unchanged and retrying is the whole of the remedy.
  • A destructive action gets a toast with Undo, and the 10-second window that comes with it (P4, Recovery Over Prevention). See the Toast entry.
  • One toast per action. Three saves in a row are three toasts; a bulk action on forty rows is one.
  • Banners stack by urgency, and each says one thing. When more than one is true of a record, they stack in a fixed order: money owed back to a customer first (one banner per failed refund), then the books (accounting sync failed), then a dispute, then a state that only informs (skipped for accounting sync). Each carries one fact and at most one action, its fix. The payment page is the case (payment-detail.tsx). Anything that is not wrong or pending belongs in the record, not in another banner.

What this trades against

P1 (Ambient Awareness) wants state visible without being asked, which argues for banners everywhere. The cost of that is a page that is mostly notices, and notices people stop seeing. Splitting them keeps the page's banners rare enough to still mean something: if there is a banner, something is actually wrong or actually pending.


A table on a phone: scroll, stack or reflow?

The rule: below the width where a table stops fitting, a list of records stacks, a table of inputs reflows, and nothing a person needs scrolls sideways.

A sideways scroll inside a frame hides the columns on the right, and on these pages the right is where the amount, the status and the totals live. On a phone nobody scrolls a table sideways to find out whether a payment succeeded; they give up or open the record one by one, which is the "active checking" P1 says the page should have saved them.

The test

Ask "is each row a record you open, or a line you edit?"

  • A record → StackedList. The row says what the record is and what state it is in, and links to it; everything else is on the record. Transactions, Payouts, Credit Memos, a payout's transactions, a document's items, the settings lists.
  • A line you edit → Table reflow_below. The same markup regrouped, because a stacked copy would double every input. The credit memo form's line items.

Then ask "from which width does it stop fitting?" — that is the breakpoint. lg for a list that overflows a 768 tablet too, md for one that fits from 768.

What goes on the row

Line one is the record and its amount. Line two is who it belongs to and what, with the status at its end. Line three is quieter: the kind, the method, the date — and the second state (the sync) at its end. Then stop: a fourth line is a column that belongs on the record. While the list is in date order, the date leaves the rows for a day band.

What this is not

  • Not a card per record. One container with hairlines. A boxed card per record fits two to a screen and makes twenty-five containers of one list.
  • Not a label/value list per record ("Amount: $1,282.50", "Status: Succeeded"…). That is the table turned on its side: ten lines a record, the reading order of a form.
  • Not a reason to drop a capability. Selection, sorting, filtering and the row's actions are all still there — the bulk bar floats where the thumb is, the sort is in the toolbar, and an action lives on the record or, where there is no record page, in the row's menu (P9).

A setting's options: disabled, or hidden until it is on?

The rule: the choice is always on the page; what configures it appears once it is chosen.

A switch that turns a feature on is the feature. It is how someone finds out the feature exists, so it is never hidden. The fields under it — a rate, a compliance tick, a pair of dates — are what the feature needs once it is on. Until then they configure nothing, and drawn disabled beside the switch they read as a second, locked control, which raises "how do I turn this on?" when the answer is the switch right above.

The test

Ask "would a value in this field do anything right now?"

  • Yes → show it. If it cannot be changed, show it disabled with the reason.
  • No, not until a choice above it is made → show it with that choice: directly under the control that reveals it, indented to it, so it reads as that control's and appears where the person is already looking.

Then ask "is it an action?" A button is never configuration. One that cannot be pressed yet stays on the page, disabled, with the reason.

Worked examples from this prototype

SurfaceWhichWhy
Convenience Fee: the rate, the accounting item and the confirmations while fees are offShownA value there does something: Enable uses it. There is no switch any more (2026-11-09) — production replaced it with a setup form and an Enable button, so the page is setup until fees are on
Convenience Fee: Enable before all six confirmations are checkedDisabled, with the reasonAn action. "Check all six to continue." sits beside it in the footer, not only in a tooltip
Convenience Fee: every control, for someone who is not an adminDisabled, with the reasonProduction's rule: the page is the same for everyone, and "Only admins can edit this setting." is the tooltip on each control
Reports: Start date and End dateHidden until Date Range is CustomA named range (This Month, Last Quarter) already fixes the dates; two disabled fields beside it would ask for something the select has answered (2026-09-25)
Reports: Request Report while a Custom range is incompleteDisabled, with the reasonAn action. The missing date is a quiet requirement under its field, not an error, until it is a real mistake

What this trades against

P8 (Show Why, Not Just What) says to show actions disabled rather than hidden. It is about actions and features: "why can't I do this?" must be answerable on the page, and a feature must be findable in the wrong context. Hidden configuration costs neither. The switch and the Date Range select are always there and say what they do, and choosing one shows everything it needs, in place, at once. What is hidden is not something the person is blocked from but a field with no meaning yet. The cost is that what a feature will ask for (a custom range's two dates) is not visible until it is on.