Phase 4, part 5: the dashboard's helpers, metric stores, types and the view that picks a page. Stacked on #129, so merge that first.
Tests came first: the helpers, the history store (one-minute cache, no duplicate fetches, old numbers kept on error or refresh) and the live store (debounce, the stream address, reconnecting, closing when the tab is hidden). All of them pass on the old code too. Then the rewrite, keeping exports, storage and behavior.
Removed because nothing used them: cardValue, computeDelta, sparklineData and SPARKLINE_BUCKET_COUNT. The live store had a five-retry limit that never took effect, since it has always kept retrying. I kept the behavior, dropped the limit and removed its message, which could never show.
After this PR: 86.2%, 10,481 upstream lines left in 36 files, 23 dual headers. Tests: 800 → 850.
Visual check: see #126. It covered all six phase 4 PRs and found no change in the UI.
Typecheck, lint, i18n:check, tests, build and notice check pass locally. No new strings; one string is removed (dashboard.liveMetricsDisconnected).
Phase 4, part 5: the dashboard's helpers, metric stores, types and the view that picks a page. Stacked on #129, so merge that first.
Tests came first: the helpers, the history store (one-minute cache, no duplicate fetches, old numbers kept on error or refresh) and the live store (debounce, the stream address, reconnecting, closing when the tab is hidden). All of them pass on the old code too. Then the rewrite, keeping exports, storage and behavior.
Removed because nothing used them: `cardValue`, `computeDelta`, `sparklineData` and `SPARKLINE_BUCKET_COUNT`. The live store had a five-retry limit that never took effect, since it has always kept retrying. I kept the behavior, dropped the limit and removed its message, which could never show.
After this PR: 86.2%, 10,481 upstream lines left in 36 files, 23 dual headers. Tests: 800 → 850.
**Visual check:** see #126. It covered all six phase 4 PRs and found no change in the UI.
Typecheck, lint, i18n:check, tests, build and notice check pass locally. No new strings; one string is removed (`dashboard.liveMetricsDisconnected`).
The trace's logic is now plain, tested code: trace.ts pairs each step's
start with its outcome, groups steps by delivery attempt, names and
describes them, and holds the trace's states as a reducer; stream.ts runs
the token and the event stream. The page only draws them, unchanged.
Two fixes on the way: "Started Ns ago" counts from the trace's own start
(it carried on from the previous trace before), and cancelling while the
token is still on its way no longer opens the stream afterwards.
Its rules are now plain, tested code in wizard.ts: which fields each step
shows, which are required, where the server's refusal lands, and what the
finish screen lists. The wizard itself is rewritten on top of them, with
the same steps, look and update.
Its rules are now plain, tested code in actions.ts: grouping actions by
label, what creating one sends (no server results, no untouched secrets),
reading the answer, and which options are required. The page is
rewritten on top of them, with the same look and flow. An action without
options now shows its label while it runs, not its internal name.
The formatting rules (ids in the server's base 32, durations, offsets,
event icons, the trace summary) are in format.ts, and the live stream's
token, reconnects and event buffer in live.ts, all with tests; the
normalizer and types are rewritten with a test too. The three components
are rewritten on top, with the same look.
One fix: stopping live tracing while a reconnect was pending could reopen
the stream two seconds later. Stopping now stops it for good.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Phase 4, part 5: the dashboard's helpers, metric stores, types and the view that picks a page. Stacked on #129, so merge that first.
Tests came first: the helpers, the history store (one-minute cache, no duplicate fetches, old numbers kept on error or refresh) and the live store (debounce, the stream address, reconnecting, closing when the tab is hidden). All of them pass on the old code too. Then the rewrite, keeping exports, storage and behavior.
Removed because nothing used them:
cardValue,computeDelta,sparklineDataandSPARKLINE_BUCKET_COUNT. The live store had a five-retry limit that never took effect, since it has always kept retrying. I kept the behavior, dropped the limit and removed its message, which could never show.After this PR: 86.2%, 10,481 upstream lines left in 36 files, 23 dual headers. Tests: 800 → 850.
Visual check: see #126. It covered all six phase 4 PRs and found no change in the UI.
Typecheck, lint, i18n:check, tests, build and notice check pass locally. No new strings; one string is removed (
dashboard.liveMetricsDisconnected).