295 — tp overview refreshes itself in the background (#295)
Why
The board is left open in a tab all day, and it shows the forges as they were when the tab was last loaded. Agents move stories on in the meantime (offered, landed, called), so what the page says needs the human is stale until they think to reload it, and "needs you" is the one thing the page is for.
A reload is also slow: each load reads every forge afresh, and the browser waits on it. A page that reloaded itself that way would spend part of every half minute waiting.
What changes
tp overview, the page: it refreshes itself. 30 seconds after it was last brought up to date it asks for the overview again, and the board and the count above it are replaced only once the new ones have arrived. Until then the page stays as it was, and can be read, scrolled and used.- The page says when what it shows was read.
- A refresh that fails leaves the page as it was; the page says so, and tries again 30 seconds on.
docs/overview.md: "the page does not refresh itself" goes.
Acceptance
The page, open in a browser, last brought up to date at T:
| Time | The refresh asked for at T+30s | The page |
|---|---|---|
| before T+30s | not yet asked for | as read at T; says it was read at T |
| after T+30s | still being read | unchanged: the board of T, in place, usable |
| after T+30s | arrived at T2, the forges changed since T | the board and the count as read at T2; says it was read at T2; the next refresh asked for at T2+30s |
| after T+30s | arrived at T2, nothing changed | the same board; says it was read at T2; the next asked for at T2+30s |
| after T+30s | failed: tp overview stopped, or it answered with an error |
the board of T, unchanged; says the refresh failed and when; the next asked for 30 seconds after the failure |
| after a failure | the next one arrives | as the third row; the failure no longer shown |
Across a refresh:
| What | Outcome |
|---|---|
| how far the page is scrolled | kept |
| the buttons of the new board ("accept", "to idea", "interview") | work as on a page loaded afresh |
| a refresh still being read when the next falls due | no second one is asked for; one at a time for a page |
| a forge that cannot be read | shown as a page loaded afresh shows it; that is an arrival, not a failure |
A load of the page by hand (reload, or the return from a button) reads the forges afresh as now, and its 30 seconds start from then.
Out of scope
- Choosing the interval, or turning the refresh off.
- Pausing while the tab is hidden: a tab left open reads the forges every 30 seconds whether or not it is looked at.
- One read shared by several tabs: each open page asks for its own.
- Pushing changes from the forge (webhooks): the page asks.
- Marking what changed between one refresh and the next.
- Holding a refresh back while a button is being pressed.
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