feat: let the reader mark an event as repeating daily

Dailiness was read off the source's wording alone, which is wrong in both
directions: a grind that resets every day but whose page never prints
"daily" got no checklist, and a banner whose blurb mentions "daily login
rewards" got one nobody could dismiss.

The reader's answer now wins. The control sits exactly where the
checklist goes — the one place the answer visibly matters — so marking an
event and ticking today off are the same gesture in the same place.

An override is stored only when it disagrees with detection. Recording
agreement would freeze today's guess into the reader's own data, so a
later parser improvement could never reach that event.

Marked events also join today's dailies at the top of the page, beside
the per-game chores: at 23:50 a login campaign and a commission run are
the same job, and ticking one should not mean opening a sheet to find its
checklist.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Lucas Winther
2026-08-15 22:14:37 +02:00
co-authored by Claude Opus 5
parent 6177633abc
commit 7f384eb9db
9 changed files with 293 additions and 69 deletions
+30
View File
@@ -76,6 +76,36 @@ export function dailiesId(game: GameId): string {
return `dailies:${game}`;
}
/**
* Whether to treat an event as repeating, given what the reader said about it.
*
* Detection reads the source's wording, which is right most of the time and
* wrong in both directions: a grind event whose page never prints the word
* "daily" still wants a checklist, and a banner whose blurb mentions "daily
* login rewards" does not. The reader's own answer is the better evidence, so
* it wins outright — `undefined` means they have not said, so detection stands.
*/
export function resolveDaily(
event: DailyCandidate,
override: boolean | undefined,
): boolean {
return override ?? isDaily(event);
}
/**
* What to store when the reader asks for `desired`.
*
* Agreeing with detection stores nothing: an override that merely repeats what
* the parser already worked out would freeze today's guess into the reader's
* data, so a later parser improvement could never reach that event.
*/
export function dailyOverride(
desired: boolean,
detected: boolean,
): boolean | undefined {
return desired === detected ? undefined : desired;
}
/** Offset from UTC midnight to this region's reset instant. */
function shift(region: Region): number {
return REGION_RESET_UTC_OFFSET[region] * HOUR - RESET_HOUR_LOCAL * HOUR;