feat: ask which games you play on first run
A calendar full of games you don't play is worse than an empty one — it buries the thing you came for. Nothing is preselected; the button stays disabled until a game is picked, which is clearer than guessing and hoping the reader notices. The choice is stored as hiddenGames, the inverse, so a game added later shows up by default rather than staying invisible. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e0ba53f369
commit
107179acfa
@@ -5,6 +5,7 @@ import { EventDetail } from "./components/EventDetail.tsx";
|
||||
import { EventRow, type RowEvent } from "./components/EventRow.tsx";
|
||||
import { NextUp } from "./components/NextUp.tsx";
|
||||
import { Timeline } from "./components/Timeline.tsx";
|
||||
import { Welcome } from "./components/Welcome.tsx";
|
||||
import { useCompletions } from "./state/useCompletions.ts";
|
||||
import { usePrefs } from "./state/usePrefs.ts";
|
||||
import { clockFor, DAY, endingSoonestFirst, formatRemaining } from "../shared/time.ts";
|
||||
@@ -91,6 +92,25 @@ export function App() {
|
||||
);
|
||||
}
|
||||
|
||||
// First run: ask which games before showing a calendar full of ones they
|
||||
// don't play. Stored as hiddenGames (the inverse) so a game added later shows
|
||||
// up by default rather than staying invisible.
|
||||
if (!prefs.onboarded) {
|
||||
return (
|
||||
<Shell>
|
||||
<Welcome
|
||||
available={games}
|
||||
onConfirm={(chosen) =>
|
||||
update({
|
||||
onboarded: true,
|
||||
hiddenGames: games.filter((g) => !chosen.includes(g)),
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Shell>
|
||||
);
|
||||
}
|
||||
|
||||
const staleSources = state.feed.sources.filter(
|
||||
(s) => s.lastSuccessAt === null || now - Date.parse(s.lastSuccessAt) > 2 * DAY,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user