From d7d1a3436e85323e21f82e4efcb160793185bc6f Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 2 Dec 2026 23:36:48 -0600 Subject: [PATCH 1/3] wip(v2.9273): Check my connection, the kernel and the timings (not yet wired) Co-Authored-By: Claude Fable 5.2 --- src/hooks/useBidsPageData.ts | 9 +- src/lib/bids/bidListSelect.ts | 10 ++ src/lib/connectionCheck.test.ts | 115 ++++++++++++++++++++ src/lib/connectionCheck.ts | 180 ++++++++++++++++++++++++++++++++ src/lib/connectionCheckIo.ts | 111 ++++++++++++++++++++ 5 files changed, 417 insertions(+), 8 deletions(-) create mode 100644 src/lib/bids/bidListSelect.ts create mode 100644 src/lib/connectionCheck.test.ts create mode 100644 src/lib/connectionCheck.ts create mode 100644 src/lib/connectionCheckIo.ts diff --git a/src/hooks/useBidsPageData.ts b/src/hooks/useBidsPageData.ts index 46616451e4..719d1ba4a7 100644 --- a/src/hooks/useBidsPageData.ts +++ b/src/hooks/useBidsPageData.ts @@ -9,6 +9,7 @@ * stood in the page so they run in the order they ran. The page keeps the trade that is * picked, its loading and error lines, and the role load's own effect. */ +import { BID_LIST_SELECT } from '../lib/bids/bidListSelect' import { useEffect, useRef, useState, type Dispatch, type SetStateAction } from 'react' import { supabase } from '../lib/supabase' import { loadBidEntryRecency } from '../lib/bids/bidEntryRecency' @@ -22,14 +23,6 @@ import type { Bid } from '../types/bids' import type { Database } from '../types/database' import { withSupabaseRetry } from '../utils/errorHandling' -/** - * The board's bid row with its joins. Typed as a plain string: the literal grew past what - * supabase-js's select parser will walk ("Type instantiation is excessively deep", TS2589, on - * CI's tsc once `development:development_id(id, name)` joined it); the rows are cast to `Raw` - * below either way. - */ -const BID_LIST_SELECT: string = - '*, customers(*), bids_gc_builders(*), estimator:users!bids_estimator_id_fkey(id, name, email), account_manager:users!bids_account_manager_id_fkey(id, name, email), service_type:service_types(id, name, color), development:development_id(id, name)' type GcBuilder = Database['public']['Tables']['bids_gc_builders']['Row'] type Customer = Database['public']['Tables']['customers']['Row'] diff --git a/src/lib/bids/bidListSelect.ts b/src/lib/bids/bidListSelect.ts new file mode 100644 index 0000000000..377b956483 --- /dev/null +++ b/src/lib/bids/bidListSelect.ts @@ -0,0 +1,10 @@ +/** + * The Bids page's list read: every bid with its customer, its builder, its people, its service type and its + * development. It lives here, under the hook that sends it, so the connection check (`connectionCheckIo.ts`) can time + * the very same read (v2.9273). + * + * Typed as a plain string: the literal grew past what supabase-js's select parser will walk ("Type instantiation is + * excessively deep", TS2589, once `development:development_id(id, name)` joined it). The hook casts the rows either way. + */ +export const BID_LIST_SELECT: string = + '*, customers(*), bids_gc_builders(*), estimator:users!bids_estimator_id_fkey(id, name, email), account_manager:users!bids_account_manager_id_fkey(id, name, email), service_type:service_types(id, name, color), development:development_id(id, name)' diff --git a/src/lib/connectionCheck.test.ts b/src/lib/connectionCheck.test.ts new file mode 100644 index 0000000000..c397f22864 --- /dev/null +++ b/src/lib/connectionCheck.test.ts @@ -0,0 +1,115 @@ +import { describe, expect, it } from 'vitest' +import { + checkVerdict, + factLines, + lineReportWords, + lineSlowestWords, + lineSpeed, + lineTimeWords, + progressWords, + reportText, + secondsWords, + speedOf, + summarizeTries, + type CheckFacts, + type CheckLine, +} from './connectionCheck' + +const line = (key: CheckLine['key'], ...tries: Array): CheckLine => ({ key, tries }) +const fast = (key: CheckLine['key']) => line(key, 200, 300, 250) + +describe('connectionCheck: a try in words', () => { + it('names fast, slow, very slow and no answer at the lines the sheet set', () => { + expect(speedOf(999)).toBe('fast') + expect(speedOf(1000)).toBe('slow') + expect(speedOf(3000)).toBe('slow') + expect(speedOf(3001)).toBe('very_slow') + expect(speedOf(null)).toBe('none') + }) + + it('reads a time in tenths of a second, never 0.0 s', () => { + expect(secondsWords(312)).toBe('0.3 s') + expect(secondsWords(4210)).toBe('4.2 s') + expect(secondsWords(12)).toBe('0.1 s') + }) +}) + +describe('connectionCheck: three tries', () => { + it('takes the middle try and the slowest', () => { + expect(summarizeTries([900, 200, 400])).toEqual({ middle: 400, slowest: 900 }) + }) + + it('counts a try that did not answer as the slowest', () => { + expect(summarizeTries([300, null, 200])).toEqual({ middle: 300, slowest: null }) + expect(summarizeTries([null, null, 200])).toEqual({ middle: null, slowest: null }) + expect(summarizeTries([])).toEqual({ middle: null, slowest: null }) + }) + + it('writes the line the report carries', () => { + expect(lineReportWords(line('site', 300, 500, 250))).toBe('The site: 0.3 s · fast · slowest try 0.5 s') + expect(lineReportWords(line('bidBoard', 4200, 3900, 5100))).toBe("The Bid Board's read: 4.2 s · very slow · slowest try 5.1 s") + expect(lineReportWords(line('api', null, null, null))).toBe('The API: did not answer') + expect(lineSlowestWords(line('api', 200, null, 300))).toBe('one try did not answer') + expect(lineTimeWords(line('api', 200, null, 300))).toBe('0.3 s') + expect(lineSpeed(line('smallRead', 1500, 1200, 2000))).toBe('slow') + }) +}) + +describe('connectionCheck: the verdict', () => { + it('says so when everything answered fast', () => { + expect(checkVerdict([fast('site'), fast('api'), fast('smallRead'), fast('bidBoard')])).toEqual({ kind: 'all_fast', words: 'Everything answered fast from here.' }) + }) + + it('names the connection when the site itself is slow, whatever the reads did', () => { + const v = checkVerdict([line('site', 4200, 4100, 4300), fast('api'), line('smallRead', 5000, 5000, 5000), fast('bidBoard')]) + expect(v).toEqual({ kind: 'connection', words: 'Your connection is slow. The site itself took 4.2 s to answer.' }) + }) + + it('names the connection when the server did not answer', () => { + expect(checkVerdict([fast('site'), line('api', null, null, null)]).words).toBe('Your connection is slow. The server the app talks to did not answer.') + }) + + it("names the app's own reads when the road is fast and a read is slow", () => { + const v = checkVerdict([fast('site'), fast('api'), fast('smallRead'), line('bidBoard', 2400, 2600, 2500)]) + expect(v).toEqual({ kind: 'app_reads', words: "Your connection is fine. The app's own reads are slow. Send this report to the office." }) + }) + + it('reads a role with no Bid Board line from the three lines it has', () => { + expect(checkVerdict([fast('site'), fast('api'), fast('smallRead')]).kind).toBe('all_fast') + }) +}) + +describe('connectionCheck: the report', () => { + const facts: CheckFacts = { browser: 'Mozilla/5.0 (Sample)', build: 'v2.9273', connection: '4g', when: 'Thu, Dec 3, 9:14 AM CST', role: 'estimator' } + + it('is plain lines with the verdict on top and no person in it', () => { + expect(reportText([fast('site'), fast('api'), fast('smallRead'), line('bidBoard', 2400, 2600, 2500)], facts)).toBe( + [ + 'PipeTooling connection check', + "Your connection is fine. The app's own reads are slow. Send this report to the office.", + '', + 'The site: 0.3 s · fast · slowest try 0.3 s', + 'The API: 0.3 s · fast · slowest try 0.3 s', + 'A small read: 0.3 s · fast · slowest try 0.3 s', + "The Bid Board's read: 2.5 s · slow · slowest try 2.6 s", + 'Each line is the middle of 3 tries.', + '', + 'Build: v2.9273', + 'Role: estimator', + 'Connection: 4g', + 'Checked: Thu, Dec 3, 9:14 AM CST', + 'Browser: Mozilla/5.0 (Sample)', + ].join('\n'), + ) + }) + + it('says what it does not know instead of leaving a blank', () => { + const lines = factLines({ browser: '', build: null, connection: null, when: 'now', role: null }) + expect(lines.map((l) => l.value)).toEqual(['not known', 'not known', 'the browser does not say', 'now', 'not known']) + }) + + it('counts the lines while it runs', () => { + expect(progressWords('api', ['site', 'api', 'smallRead'])).toBe('Checking the API, 2 of 3…') + expect(progressWords('bidBoard', ['site', 'api', 'smallRead', 'bidBoard'])).toBe("Checking the Bid Board's read, 4 of 4…") + }) +}) diff --git a/src/lib/connectionCheck.ts b/src/lib/connectionCheck.ts new file mode 100644 index 0000000000..4cd556919b --- /dev/null +++ b/src/lib/connectionCheck.ts @@ -0,0 +1,180 @@ +/** + * Check my connection (v2.9273): the words and the sums behind the press at Settings → Advanced. + * + * A slow report used to arrive as "the app is slow" and nothing else. The press times four things from the person's + * own browser, three tries each, and says in one sentence whether the slow part is their connection or the app's own + * reads. The report is plain lines the person copies and pastes where they choose. Nothing is kept and nothing is + * sent: this file is pure, and `connectionCheckIo.ts` only reads. + * + * The report names no person: times, the browser, the build, the role and the hour. + */ + +/** The four things timed, in the order they run and draw. */ +export const CHECK_LINE_KEYS = ['site', 'api', 'smallRead', 'bidBoard'] as const +export type CheckLineKey = (typeof CHECK_LINE_KEYS)[number] + +/** Tries for each line. The middle one is the line's time, so one stray slow try does not name the verdict. */ +export const CHECK_TRIES = 3 +/** No try waits longer than this. A try that has not landed by then reads *did not answer*. */ +export const CHECK_TRY_TIMEOUT_MS = 10_000 +/** Under this a try is fast. */ +export const FAST_UNDER_MS = 1_000 +/** Over this a try is very slow. Between the two it is slow. */ +export const VERY_SLOW_OVER_MS = 3_000 + +export type CheckSpeed = 'fast' | 'slow' | 'very_slow' | 'none' + +/** One line's tries, in the order they ran. `null` is a try that did not answer in time, or failed. */ +export interface CheckLine { + key: CheckLineKey + tries: ReadonlyArray +} + +export const CHECK_LINE_LABELS: Record = { + site: 'The site', + api: 'The API', + smallRead: 'A small read', + bidBoard: "The Bid Board's read", +} + +/** What each line is, for the person who has never seen the word API. */ +export const CHECK_LINE_HINTS: Record = { + site: 'One small file from the site.', + api: 'The server the app talks to, with no data read.', + smallRead: 'Your own account row, read from the database.', + bidBoard: 'The same list of bids the Bid Board reads.', +} + +export const CHECK_SPEED_WORDS: Record = { + fast: 'fast', + slow: 'slow', + very_slow: 'very slow', + none: 'did not answer', +} + +export const CHECK_PRESS_LABEL = 'Check my connection' +export const CHECK_AGAIN_LABEL = 'Check again' +export const CHECK_COPY_LABEL = 'Copy the report' +export const CHECK_COPIED_WORDS = 'Copied. Paste it in a message to the office.' +export const CHECK_COPY_FAILED_WORDS = 'Could not copy. Select the lines below and copy them by hand.' +export const CHECK_LEAD_WORDS = 'Is the app slow for you? This times the site and the app from your browser. It takes under a minute, changes nothing and sends nothing.' +export const CHECK_REPORT_TITLE = 'PipeTooling connection check' + +export function speedOf(ms: number | null): CheckSpeed { + if (ms == null) return 'none' + if (ms < FAST_UNDER_MS) return 'fast' + if (ms <= VERY_SLOW_OVER_MS) return 'slow' + return 'very_slow' +} + +/** "0.3 s". Tenths of a second, because nobody feels a millisecond. Under a tenth still reads 0.1 s, never 0.0 s. */ +export function secondsWords(ms: number): string { + const tenths = Math.max(1, Math.round(ms / 100)) + return `${(tenths / 10).toFixed(1)} s` +} + +/** + * A line's middle try and its slowest. A try that did not answer counts as slower than any that did, so two of + * three unanswered tries make the middle one unanswered too, and one unanswered try makes the slowest unanswered. + */ +export function summarizeTries(tries: ReadonlyArray): { middle: number | null; slowest: number | null } { + if (tries.length === 0) return { middle: null, slowest: null } + const sorted = [...tries].sort((a, b) => (a ?? Infinity) - (b ?? Infinity)) + return { middle: sorted[Math.floor((sorted.length - 1) / 2)] ?? null, slowest: sorted[sorted.length - 1] ?? null } +} + +export function lineSpeed(line: CheckLine): CheckSpeed { + return speedOf(summarizeTries(line.tries).middle) +} + +/** The value a line draws: "0.3 s", or the words for no answer. */ +export function lineTimeWords(line: CheckLine): string { + const { middle } = summarizeTries(line.tries) + return middle == null ? CHECK_SPEED_WORDS.none : secondsWords(middle) +} + +/** "slowest try 0.5 s", or that a try did not answer. */ +export function lineSlowestWords(line: CheckLine): string { + const { slowest } = summarizeTries(line.tries) + return slowest == null ? 'one try did not answer' : `slowest try ${secondsWords(slowest)}` +} + +/** One line of the copied report: "The site: 0.3 s · fast · slowest try 0.5 s". */ +export function lineReportWords(line: CheckLine): string { + const speed = lineSpeed(line) + const head = `${CHECK_LINE_LABELS[line.key]}: ${lineTimeWords(line)}` + if (speed === 'none') return head + return `${head} · ${CHECK_SPEED_WORDS[speed]} · ${lineSlowestWords(line)}` +} + +export type CheckVerdictKind = 'all_fast' | 'connection' | 'app_reads' + +export interface CheckVerdict { + kind: CheckVerdictKind + words: string +} + +/** + * The one sentence on top. The site and the API touch no table of ours, so when either is slow the cause is the road + * between the person and the servers. When both are fast and a read is slow, the road is fine and the reads are ours. + */ +export function checkVerdict(lines: ReadonlyArray): CheckVerdict { + const slow = (key: CheckLineKey) => { + const line = lines.find((l) => l.key === key) + return line != null && lineSpeed(line) !== 'fast' ? line : null + } + const road = slow('site') ?? slow('api') + if (road) { + const what = road.key === 'site' ? 'The site itself' : 'The server the app talks to' + const { middle } = summarizeTries(road.tries) + const tail = middle == null ? `${what} did not answer.` : `${what} took ${secondsWords(middle)} to answer.` + return { kind: 'connection', words: `Your connection is slow. ${tail}` } + } + if (slow('smallRead') ?? slow('bidBoard')) { + return { kind: 'app_reads', words: "Your connection is fine. The app's own reads are slow. Send this report to the office." } + } + return { kind: 'all_fast', words: 'Everything answered fast from here.' } +} + +/** What the report says about where it was run. No name, no email, no job, no figure. */ +export interface CheckFacts { + /** The browser and device, as the browser names itself. */ + browser: string + /** The build the tab is running, or null when the build carries none. */ + build: string | null + /** The connection kind where the browser gives one ("4g", "wifi"). */ + connection: string | null + /** The hour with its zone, already in words. */ + when: string + role: string | null +} + +export function factLines(facts: CheckFacts): Array<{ label: string; value: string }> { + return [ + { label: 'Build', value: facts.build ?? 'not known' }, + { label: 'Role', value: facts.role ?? 'not known' }, + { label: 'Connection', value: facts.connection ?? 'the browser does not say' }, + { label: 'Checked', value: facts.when }, + { label: 'Browser', value: facts.browser || 'not known' }, + ] +} + +/** The plain lines **Copy the report** puts on the clipboard. */ +export function reportText(lines: ReadonlyArray, facts: CheckFacts): string { + return [ + CHECK_REPORT_TITLE, + checkVerdict(lines).words, + '', + ...lines.map(lineReportWords), + `Each line is the middle of ${CHECK_TRIES} tries.`, + '', + ...factLines(facts).map((f) => `${f.label}: ${f.value}`), + ].join('\n') +} + +/** "Checking the site, 1 of 4…" while the tries run. */ +export function progressWords(key: CheckLineKey, keys: ReadonlyArray): string { + const at = keys.indexOf(key) + 1 + const label = CHECK_LINE_LABELS[key] + return `Checking ${label.charAt(0).toLowerCase()}${label.slice(1)}, ${at} of ${keys.length}…` +} diff --git a/src/lib/connectionCheckIo.ts b/src/lib/connectionCheckIo.ts new file mode 100644 index 0000000000..87a9f40ff8 --- /dev/null +++ b/src/lib/connectionCheckIo.ts @@ -0,0 +1,111 @@ +/** + * Check my connection (v2.9273): the four timings themselves. Reads only. Nothing is written, kept or sent. + * + * The lines run one after another, and so do a line's tries, so none of them waits behind another of ours. + */ +import { APP_VERSION } from './appVersion' +import { BID_LIST_SELECT } from './bids/bidListSelect' +import { CHECK_TRIES, CHECK_TRY_TIMEOUT_MS, type CheckFacts, type CheckLine, type CheckLineKey } from './connectionCheck' +import { supabase } from './supabase' + +type TryRun = (signal: AbortSignal, attempt: number) => Promise + +/** One try: how long `run` took to land, or null when it failed or had not landed in `timeoutMs`. */ +export async function timeTry(run: (signal: AbortSignal) => Promise, timeoutMs: number = CHECK_TRY_TIMEOUT_MS, clock: () => number = () => performance.now()): Promise { + const ctl = new AbortController() + let timer: ReturnType | undefined + const started = clock() + try { + const landed = await Promise.race([ + run(ctl.signal), + new Promise((resolve) => { + timer = setTimeout(() => { + ctl.abort() + resolve(false) + }, timeoutMs) + }), + ]) + return landed ? Math.max(0, clock() - started) : null + } catch { + return null + } finally { + if (timer != null) clearTimeout(timer) + } +} + +/** The site: one small file, with an address no cache has seen. */ +const siteTry: TryRun = async (signal, attempt) => { + const res = await fetch(`/favicon.svg?check=${Date.now()}-${attempt}`, { cache: 'no-store', signal }) + if (!res.ok) return false + await res.arrayBuffer() + return true +} + +/** The API: its health address, which reads no table. */ +const apiTry: TryRun = async (signal) => { + const res = await fetch(`${import.meta.env.VITE_SUPABASE_URL}/auth/v1/health`, { headers: { apikey: import.meta.env.VITE_SUPABASE_ANON_KEY }, cache: 'no-store', signal }) + if (!res.ok) return false + await res.arrayBuffer() + return true +} + +/** A small read: the person's own account row. */ +function smallReadTry(userId: string): TryRun { + return async (signal) => { + const { error } = await supabase.from('users').select('id').eq('id', userId).limit(1).abortSignal(signal) + return !error + } +} + +/** The Bid Board's read: the same list the board asks for. Its rows are thrown away. */ +const bidBoardTry: TryRun = async (signal) => { + const { error } = await supabase.from('bids').select(BID_LIST_SELECT).is('adopted_into_bid_id', null).order('bid_due_date', { ascending: false, nullsFirst: true }).abortSignal(signal) + return !error +} + +export interface ConnectionCheckArgs { + userId: string + /** False for a role that cannot open Bids: the line is left out. */ + withBidBoard: boolean + /** Called as each line starts. */ + onStart?: (key: CheckLineKey, keys: ReadonlyArray) => void + /** Called as each line lands, with every line so far. */ + onLine?: (lines: ReadonlyArray) => void + /** False once the caller has gone: the run stops before its next try. */ + alive?: () => boolean +} + +export function checkLineKeysFor(withBidBoard: boolean): CheckLineKey[] { + return withBidBoard ? ['site', 'api', 'smallRead', 'bidBoard'] : ['site', 'api', 'smallRead'] +} + +export async function runConnectionCheck(args: ConnectionCheckArgs): Promise { + const runs: Record = { site: siteTry, api: apiTry, smallRead: smallReadTry(args.userId), bidBoard: bidBoardTry } + const keys = checkLineKeysFor(args.withBidBoard) + const alive = args.alive ?? (() => true) + const lines: CheckLine[] = [] + for (const key of keys) { + if (!alive()) break + args.onStart?.(key, keys) + const tries: Array = [] + for (let attempt = 0; attempt < CHECK_TRIES; attempt++) { + if (!alive()) break + tries.push(await timeTry((signal) => runs[key](signal, attempt))) + } + lines.push({ key, tries }) + args.onLine?.([...lines]) + } + return lines +} + +/** Where and when the check ran, as the browser tells it. */ +export function checkFactsNow(role: string | null): CheckFacts { + const nav = typeof navigator === 'undefined' ? null : (navigator as Navigator & { connection?: { effectiveType?: string } }) + return { + browser: nav?.userAgent ?? '', + build: APP_VERSION, + connection: nav?.connection?.effectiveType ?? null, + when: new Date().toLocaleString(undefined, { weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZoneName: 'short' }), + role, + } +} From b69826c5db977de8f5b9ac54656228404d3abbf2 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 2 Dec 2026 23:39:28 -0600 Subject: [PATCH 2/3] wip(v2.9273): Check my connection, the card, the guide and the release note (near tests pass; typecheck and lint not yet run) Co-Authored-By: Claude Fable 5.2 --- docs/recent-features/v2.9273.md | 28 +++ public/fix-cache.html | 1 + .../ConnectionCheckCard.render.test.tsx | 85 ++++++++ .../settings/ConnectionCheckCard.tsx | 193 ++++++++++++++++++ .../settings/SettingsAdvancedTab.tsx | 16 +- .../help/fix-the-app-when-it-wont-load.md | 1 + .../know-what-to-do-when-the-app-is-slow.md | 34 ++- src/content/releaseNotes/v2.9273.ts | 15 ++ src/lib/settingsDeepLink.ts | 1 + src/lib/settingsSearch.ts | 1 + src/pages/Settings.tsx | 2 + 11 files changed, 372 insertions(+), 5 deletions(-) create mode 100644 docs/recent-features/v2.9273.md create mode 100644 src/components/settings/ConnectionCheckCard.render.test.tsx create mode 100644 src/components/settings/ConnectionCheckCard.tsx create mode 100644 src/content/releaseNotes/v2.9273.ts diff --git a/docs/recent-features/v2.9273.md b/docs/recent-features/v2.9273.md new file mode 100644 index 0000000000..8d33072a55 --- /dev/null +++ b/docs/recent-features/v2.9273.md @@ -0,0 +1,28 @@ +# v2.9273 — Settings: check your connection when the app is slow (2026-12-03) + +A teammate reported the live app as nearly too slow to use, worst on the Bid Board, and the report came with no numbers. The Fix app page measured nothing: it is a static page that clears the cached files. The owner asked for a tool a person can run to measure their own connection. Client only. No migration, no function change, nothing kept, nothing owed on prod. + +## What changed + +- **Check my connection**, in the *Fix app* box at Settings → Advanced ([`ConnectionCheckCard.tsx`](../../src/components/settings/ConnectionCheckCard.tsx)). One press times four things, three tries each, one after another, no try waiting past 10 seconds: + - the site: one small file with an address no cache has seen; + - the API: the auth health address, which reads no table; + - a small read: the person's own `users` row; + - the Bid Board's read: the Bids page's own list read, its rows thrown away. A role that cannot open Bids (`canOpenBids`) is not shown this line. +- **The words** are the kernel [`connectionCheck.ts`](../../src/lib/connectionCheck.ts): a line's time is the middle of its tries (`summarizeTries`), under 1 s reads *fast*, 1 to 3 s *slow*, over 3 s *very slow*, none in 10 s *did not answer* (`speedOf`). One sentence on top (`checkVerdict`) names the person's connection when the site or the API is slow, the app's own reads when both are fast and a read is slow, and says so when everything was fast. +- **Copy the report** puts plain lines on the clipboard (`reportText`): the verdict, the lines, the build, the role, the connection kind where the browser gives one, the hour with its zone and the browser's own name. No name, email, job or figure. Where the clipboard is refused the lines are shown in a box to copy by hand. +- **The timings** are [`connectionCheckIo.ts`](../../src/lib/connectionCheckIo.ts) (`timeTry`, `runConnectionCheck`). They only read. +- The Bids list select moved from `useBidsPageData.ts` to [`lib/bids/bidListSelect.ts`](../../src/lib/bids/bidListSelect.ts), so the check times the very read the board sends and a lower layer reads nothing from a hook. +- The static Fix page (`public/fix-cache.html`) gained one line that points a slow, not stuck, person to the press. Settings search finds *Check my connection*, and `#settings-connection-check` opens the folded Advanced group. + +## Who can press it + +Every role that has Settings → Advanced. Helpers and subcontractors do not (the gate in `Settings.tsx` is unchanged). + +## Guides + +*know what to do when the app is slow* has a new section, **Check your connection**. *fix the app when it won't load* links to it. + +## Tests + +`src/lib/connectionCheck.test.ts` (the speeds, the middle try, the verdict, the report), `src/components/settings/ConnectionCheckCard.render.test.tsx` (the press, the lines, the copy). diff --git a/public/fix-cache.html b/public/fix-cache.html index 24cda0fcd0..0724e25aff 100644 --- a/public/fix-cache.html +++ b/public/fix-cache.html @@ -19,6 +19,7 @@

Fix PipeTooling

If the app shows a white screen after an update, this will clear cached files and reset storage so the app can load correctly.

+

Is the app slow, not stuck? Sign in, open Settings, then Advanced, and press Check my connection. It times the app from your device.