diff --git a/CLAUDE.md b/CLAUDE.md index 60668a4..2cd493f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,7 +86,7 @@ src/client/ React app, service worker, manifest lens.ts — who sees which rows (focus, outstanding, next-to-expire); pure scripts/ build-feed.ts, parse-fixture.ts (offline), refresh-sources.ts (fetches) serve.ts static server + /api/health -test/ 400 tests +test/ 401 tests fixtures// raw HTML + .expected.json per source — pinned, kept forever snapshots/ current page per source, rewritten by refresh — see its README ``` diff --git a/src/client/components/CustomForms.tsx b/src/client/components/CustomForms.tsx index 11a4cce..c6b1700 100644 --- a/src/client/components/CustomForms.tsx +++ b/src/client/components/CustomForms.tsx @@ -141,8 +141,16 @@ export function EventForm({ const start = fields(initial?.startsAt ?? null); const end = fields(initial?.endsAt ?? null); + // The reader's own games first, and so the default too. Someone filling this + // in by hand is usually doing it *because* the game isn't tracked; making + // them scroll past nine that are gets the common case backwards. Stable + // within each group, so the tracked ones keep their feed order. + const ordered = [...lanes].sort( + (a, b) => Number(isCustomGameId(b)) - Number(isCustomGameId(a)), + ); + const [game, setGame] = useState( - initial?.game ?? lanes[0] ?? Object.keys(customGames)[0] ?? "", + initial?.game ?? ordered[0] ?? Object.keys(customGames)[0] ?? "", ); const [title, setTitle] = useState(initial?.title ?? ""); const [type, setType] = useState(initial?.type ?? "other"); @@ -198,7 +206,7 @@ export function EventForm({ onChange={(e) => setGame(e.target.value)} className={inputClass()} > - {lanes.map((id) => ( + {ordered.map((id) => (