299 — tp overview: a pressed button answers at once (#299)

Why

A press of "accept" or "to idea" looks as if nothing happens. The browser posts the form and waits, the page unchanged, while tp overview writes to the forge and then reads every forge afresh for the page it sends back; that is seconds with no sign the press was taken, and the button can be pressed again meanwhile.

Since story 295 the page already replaces its board in place. A press can use that: say at once that it was taken, and bring the board up to date when the forge has been written, without loading the page again.

What changes

  • tp overview, the page: a press of "accept" or "to idea" is sent in the background. The card says at once that it is being done, and its buttons cannot be pressed again. When the forge has been written the board is refreshed then, not at the next 30 seconds; a refusal is said on the page, the board left in place.
  • tp overview, the page: a press of "interview" says at once that the interview is being started; the browser is then sent to it as now.
  • docs/overview.md: what a press shows.

Acceptance

A press of "accept" or "to idea" on a card, the page's script running:

Time The press The page
at the press sent, not yet answered not loaded again: the board in place and scrolled as it was; the card says "accepting…" or "moving…"; none of the card's buttons can be pressed
later taken: the forge is written a refresh is asked for at once; until it arrives the card stays as at the press; when it arrives the board as then read, the card in its new column, the next refresh 30 seconds on
later refused (409: the story changed since the board was read, the forge would not write) the board in place; the page says "Not accepted: why" or "Not moved to an idea: why", as the refusal page does now; the card's buttons can be pressed again; a refresh is asked for at once, since the board is likely stale
later failed: tp overview stopped, or not this page's form (403) the board in place; the page says the press failed and when; the card's buttons can be pressed again

A press and the page's own refresh:

What Outcome
a refresh arrives while a press is not yet answered not shown: the card keeps saying the press is being done; the refresh the press ends with shows the board
a refresh falls due while a press is not yet answered not asked for; the press ends with one
a refresh is being read when the press is taken no second one beside it: one at a time, and one is asked for after the press was taken, so the board shown is of the forge as written
a second card pressed while the first is not yet answered each is sent and answered for itself; the refresh is asked for once none is unanswered
what the page says of a refusal or a failed press stays through the refresh the press ends with; gone when the next refresh after that arrives, about 30 seconds on, or at the next press

A press of "interview":

Time The page
at the press the card says "starting…"; none of its buttons can be pressed
started the browser is sent to the interview, as now
refused the "Not started: why" page, as now

Without the page's script (a form posted as a browser alone posts it): every button as now, the board or the refusal page loaded in answer.

Out of scope

  • Moving the card to its new column before the forge has been read again: the page shows what was read, never what it expects.
  • Undoing a press.
  • Starting an interview without leaving the board.
  • htmx, the library, as a decision of this story: the page already carries a script of its own that replaces the board, and the press is built into that unless the build finds a reason not to.

Decisions

none

Done when

  • tests express the acceptance table and pass
  • spec updated
  • ADR written if a fork was resolved
  • roadmap ticked and stamped; changelog entry
  • issue closed with a link to the release