refactor: delete the section hint nothing could reach

The "Running now" header had a hint reading "next after this ends in …", and the
commit before this one fixed a real defect in the string it produced — an
unannounced end became the word "ended". Both were beside the point: the branch
cannot render at all.

`Section` shows `action ?? hint`. The hint needed a second live row to have
anything to say, and two live rows are two visible rows, which is exactly the
condition that puts the sort control in the same slot. So the action was present
whenever the hint was, and won every time.

What it would have said is already on the page. The headline panel's "Then" list
names the deadlines behind the closest one and counts each of them down, which is
the same answer with more room. So the hint slot goes, `followingDeadlineMs` goes
with it as its only caller, and `Section` is left with the one control slot it
actually uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Lucas Winther
2026-08-20 06:39:37 +02:00
co-authored by Claude Opus 5
parent 026b1315d3
commit 0b5aa12173
3 changed files with 11 additions and 78 deletions
-25
View File
@@ -71,31 +71,6 @@ export function firstToExpire<T extends Row>(rows: readonly T[]): T | null {
return nextToExpire(rows, 1)[0] ?? null;
}
/**
* How long the deadline *behind* the closest one has left, or null when there
* is not a second dated deadline to report.
*
* The "Running now" header uses this to say what falls due after the row at the
* top. It asked the list for `rows[1]` before, which was wrong twice over and
* in the two ways this module exists to prevent.
*
* The list arrives sorted by whatever mode the reader chose, so under "doing
* first" `rows[1]` is the second thing they are partway through — the same
* mistake `firstToExpire` was written to stop the headline making, one row
* further down. And an unannounced end has no time remaining at all, so the
* old `?? 0` handed `formatRemaining` a zero and the header read "next after
* this ends in ended": the `endsAt: null` rule turned into a claim that
* something expired, which is exactly backwards.
*
* So it reads the second *dated* deadline and returns null rather than a
* stand-in, and the caller omits the line when there is nothing to say.
*/
export function followingDeadlineMs<T extends Row>(
rows: readonly T[],
): number | null {
return nextToExpire(rows, 2)[1]?.clock.msRemaining ?? null;
}
/**
* The focused game, if it is still a game the reader can see.
*