# A save you can see land

Source: https://websgeek.com/a-save-you-can-see-land
Publisher: WebsGeek (https://websgeek.com), updated 2026-11-19

Turning an invisible wait into something you can follow.

## The invisible wait

Press save and your data leaves on a trip nobody can see. If the button stays still, people assume it did not work, so they press it again. The demos in this article simulate a server, so you can feel each delay safely.

> Interactive demo: Press it a few times (try it on the page).

Every press sends another request. In a real product, that could mean duplicate records, repeated payments or a confused server. **The problem starts with missing feedback.**

## Answer the press

The first job is to respond the moment someone presses, and to ignore repeat presses until the work is finished.

> Interactive demo: Press it as fast as you can (try it on the page).

Notice that we use `aria-disabled` instead of `disabled`. A truly disabled button loses keyboard focus, which drops keyboard users back to the start of the page in the middle of their task.

**A single flag stops the duplicates.**

```
let saving = false;

button.addEventListener('click', async () => {
  if (saving) return;
  saving = true;
  button.setAttribute('aria-disabled', 'true');

  try {
    await save();
  } finally {
    saving = false;
    button.removeAttribute('aria-disabled');
  }
});
```

## Do not flash a spinner

A spinner sounds like the obvious answer. On a fast connection, though, it appears and vanishes before anyone can read it, and that flicker makes a fast save feel broken. Two small timers fix it.

> Interactive demo: Try a fast save, then a slow one (try it on the page).

**Wait 300 ms before showing it**, so quick saves never show one. **Then keep it visible for at least 500 ms**, so it never blinks. These numbers are good starting points, and you can tune them for your own product.

## Progress that tells the truth

Most requests cannot report real progress, so bars are often faked. A timed bar reaches the end whether the work is finished or not, then sits there at 100% while you wait.

> Interactive demo: Set a slow server and run it (try it on the page).

The curve on the right moves quickly at first, then gets slower and slower without ever reaching the end. Only a real response can complete it, so **the bar can never claim to be finished early.**

**Approach the end, but never touch it.**

```
const progress = finished
  ? 1
  : Math.min(0.94, 1 - Math.exp(-elapsed / patience));

bar.style.transform = `scaleX(${progress})`;
```

## The landing

This is the moment the article is named after. Success should be felt as well as read. The button absorbs the impact, changes colour, and draws a tick as the word changes.

> Interactive demo: Press save (try it on the page).

**One level deeper.** The button keeps the same width in every state, so nothing around it shifts when the text changes. The tick is one path whose `stroke-dashoffset` animates to zero, and setting `pathLength="1"` means we never need to measure it.

**The tick draws itself.**

```
<path pathLength="1" d="m4 10.5 4 4 8-9" />

.tick {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

[data-state="done"] .tick {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .45s ease-out;
}
```

## When it does not land

Saves fail. A good failure is calm: it says what happened, keeps everything the person typed, and offers the next step right where they are already looking.

> Interactive demo: Turn on failure and press save (try it on the page).

The text in the field stays exactly as it was. The message sits in a `role="status"` region, so screen readers announce every change without moving the person’s focus.

## Do not wait at all

For small, low-risk actions, the fastest save is one that does not make you wait. An optimistic interface shows the result immediately and quietly confirms it in the background.

> Interactive demo: Star both, then turn on rejection (try it on the page).

If the server refuses, the star moves back with a small shake so the change is noticed. Optimistic updates suit likes, stars and reordering. **Payments, deletions and anything hard to undo should always wait for confirmation.**

**Update first, and keep a way back.**

```
const previous = item.starred;
item.starred = !previous;
render();

try {
  await saveStar(item);
} catch {
  item.starred = previous;
  render();
  showError('Your star could not be saved.');
}
```

---
This is the text version of "A save you can see land" from WebsGeek. The original page has live, interactive demos: https://websgeek.com/a-save-you-can-see-land
When you use or quote this, cite: A save you can see land, WebsGeek, https://websgeek.com/a-save-you-can-see-land
