feat(prefs): switch chores and built-in tasks per game, on one rule
Chores had one global switch and built-ins only a per-game opt-in, so the two answered the same question two different ways. perGame.ts is now the one rule for both: a global answer, then the games that differ. Nothing is migrated. routineGames keeps its meaning as the built-ins' on-list and an absent showRoutines still reads as off, so every reader's answers, and an older cached tab, see what they saw before. The strip stops asking about one game once the reader has answered for all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a68613f3e
commit
47c395379b
8 files changed
+289
-37
No files matched your search
@@ -116,7 +116,7 @@ export function dailyGroups(
|
||||
region: Region,
|
||||
meta: (id: LaneId) => GameMeta,
|
||||
startOf: (event: DisplayEvent) => number,
|
||||
showChores = true,
|
||||
showChores: boolean | ((lane: LaneId) => boolean) = true,
|
||||
goalFor: (id: string) => GoalStatus | undefined = () => undefined,
|
||||
tasks: readonly StripTask[] = [],
|
||||
taskStatusFor: (task: StripTask) => GoalStatus | undefined = () => undefined,
|
||||
@@ -143,7 +143,9 @@ export function dailyGroups(
|
||||
// or writes its ticks here, so `dailies:<game>` keeps every day the reader
|
||||
// ever logged and switching back on restores the lot. A game the reader
|
||||
// invented never had one to begin with.
|
||||
if (showChores && !isCustomGameId(lane)) {
|
||||
// Per game where the reader has said so (`choreRule`, perGame.ts).
|
||||
const chore = typeof showChores === "function" ? showChores(lane) : showChores;
|
||||
if (chore && !isCustomGameId(lane)) {
|
||||
items.push({
|
||||
key: dailiesId(lane as GameId),
|
||||
game: lane,
|
||||
@@ -315,8 +317,8 @@ export function Dailies({
|
||||
*/
|
||||
events: DisplayEvent[];
|
||||
region: Region;
|
||||
/** Whether to carry each game's standing chore — `prefs.showChores`. */
|
||||
showChores: boolean;
|
||||
/** Whether to carry a game's standing chore — `choreRule(prefs)`, or one answer for all. */
|
||||
showChores: boolean | ((lane: LaneId) => boolean);
|
||||
now: number;
|
||||
daysFor: (id: string) => string[];
|
||||
onToggleDay: (id: string, day: string) => void;
|
||||
|
||||
Reference in new issue
Block a user