`checks.yml` runs `npm run format:check` for both projects and both were failing. - frontend/src/lib/ui-store.ts is mine, unformatted since the round-1 upload-queue badge fix — the same miss as the rustfmt one: I gated on svelte-check and eslint but never on format:check. - e2e/loadtest/* and e2e/shots.mjs have been unformatted since7758270and are unrelated to the audit work. Fixed here because they block the same gate and the fix is mechanical; no behaviour change in either project. Still red and deliberately NOT fixed here: `npm run lint` in the frontend reports `svelte/prefer-svelte-reactivity` on routes/diashow/+page.svelte:208 (a mutable `Set` where the rule wants `SvelteSet`), pre-existing since5009590. That one is a real reactivity change in code I have no test coverage for, so it belongs in its own change rather than smuggled into a formatting commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
25 lines
944 B
TypeScript
25 lines
944 B
TypeScript
import { writable, derived } from 'svelte/store';
|
|
import { queueItems } from './upload-queue';
|
|
|
|
// Controls BottomNav visibility. Upload page sets this false on mount and restores on destroy.
|
|
export const showBottomNav = writable(true);
|
|
|
|
// Controls the UploadSheet overlay. FAB sets true; sheet sets false.
|
|
export const uploadSheetOpen = writable(false);
|
|
|
|
// Count of items still needing attention — shown as FAB badge. Includes the terminal
|
|
// states on purpose: counting only pending/uploading meant a rejected upload decremented
|
|
// the badge exactly as if it had succeeded, so the failure was indistinguishable from a
|
|
// completed upload. 'blocked' and 'error' stay counted until the user clears or retries them.
|
|
export const uploadBadgeCount = derived(
|
|
queueItems,
|
|
($items) =>
|
|
$items.filter(
|
|
(i) =>
|
|
i.status === 'pending' ||
|
|
i.status === 'uploading' ||
|
|
i.status === 'error' ||
|
|
i.status === 'blocked'
|
|
).length
|
|
);
|