Let a reader switch off the chores the app invented
Today's dailies carries two different things: each game's standing chore — "Commissions, resin", a fixed list nobody publishes — and any event with a checklist. The first is the app guessing at a routine the reader never asked for, and it was the only part of that strip with no way out. So the switch removes exactly that. Events keep their checklists whatever their source, including ones the reader added themselves and marked daily, which was the requirement most at risk of being filtered away by a switch aimed at something else. Nothing is discarded. The ticks live under `dailies:<game>` and nothing here reads or writes them, so switching back on restores every logged day and every streak — the same promise `detectDaily` already makes. Defaulted on, because everyone has these today and a setting that silently removes something on upgrade is worse than one nobody notices. Gating where the chore is built rather than where it is drawn means the counts follow for free: "N still waiting on you today" is derived from the items, and a game left with nothing contributes no group at all, so the strip's own empty guard drops it rather than leaving a heading with no rows. Named for what it removes. A switch called "dailies" would read as broken while the strip stayed on screen showing the reader's own events. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f324208457
commit
4277c28e50
@@ -85,6 +85,7 @@ export function dailyGroups(
|
||||
region: Region,
|
||||
meta: (id: LaneId) => GameMeta,
|
||||
startOf: (event: DisplayEvent) => number,
|
||||
showChores = true,
|
||||
): DailyGroup[] {
|
||||
// A lane can arrive through an event without being in `games` — an event on a
|
||||
// game the reader has since switched off, say — and dropping it here would
|
||||
@@ -102,7 +103,13 @@ export function dailyGroups(
|
||||
const today = dayKey(now, region, lane);
|
||||
const resetsIn = msUntilReset(now, region, lane);
|
||||
|
||||
if (!isCustomGameId(lane)) {
|
||||
// The standing chore is the app's own invention — no source publishes
|
||||
// "Commissions, resin" — so it is the one part of this strip a reader can
|
||||
// reasonably want gone. Switched off it is simply not built; nothing reads
|
||||
// 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)) {
|
||||
items.push({
|
||||
key: dailiesId(lane as GameId),
|
||||
game: lane,
|
||||
@@ -141,6 +148,7 @@ export function Dailies({
|
||||
now,
|
||||
daysFor,
|
||||
onToggleDay,
|
||||
showChores,
|
||||
}: {
|
||||
/** Every lane the reader is looking at, in their own order. */
|
||||
games: LaneId[];
|
||||
@@ -151,6 +159,8 @@ export function Dailies({
|
||||
*/
|
||||
events: DisplayEvent[];
|
||||
region: Region;
|
||||
/** Whether to carry each game's standing chore — `prefs.showChores`. */
|
||||
showChores: boolean;
|
||||
now: number;
|
||||
daysFor: (id: string) => string[];
|
||||
onToggleDay: (id: string, day: string) => void;
|
||||
@@ -176,6 +186,7 @@ export function Dailies({
|
||||
region,
|
||||
gameMeta,
|
||||
(event) => Date.parse(event.startsAt),
|
||||
showChores,
|
||||
);
|
||||
const items = groups.flatMap((group) => group.items);
|
||||
const total = items.length;
|
||||
|
||||
Reference in New Issue
Block a user