Files
gacha-event-tracker/src/client/state/reader/clock.ts
T
Lucas WintherandClaude Opus 5.5 50c6e91b00 feat: the redesigned Event Clock
The new reader app replaces the old UI: Checklist with a rail (focus
pills, Next to expire, today's dailies, pinned routines), Timeline in a
new and a classic look, Routines, Archive and a Settings area, in a
Structured (default) and a Relaxed interface. It follows the approved
Round 6 B and Round 7 mockups, corrected screen by screen with the owner.

Reader data moves to a v2 store (gacha-tracker:v2:*). Existing v1 data
is migrated on first load, a recovery copy is written first, and the v1
keys are never removed, so a rollback finds them unchanged. Redeem codes
for Genshin arrive as their own feed.

Also: live's urgency ramp, editable per theme; completion and
section-complete fireworks; a returning-user tour; the design mockups,
specs, plans, reviews and handoff record.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:55:16 +02:00

34 lines
967 B
TypeScript

export {
appendClockRevision,
resolveReaderClock,
readerDayKey,
readerClockFor,
} from "../../../shared/readerClock.ts";
import { appendClockRevision } from "../../../shared/readerClock.ts";
import { resetHourFor, serverOffsetUtc } from "../../../shared/time.ts";
import type { ReaderState } from "./schema.ts";
export function refreshAutomaticClocks(
state: ReaderState,
at: string,
): ReaderState {
let next = state;
for (const a of Object.values(state.accounts)) {
const latest = a.clocks.at(-1)!;
if (a.retiredAt || latest.reset !== null) continue;
if (
latest.automaticBase.offsetUtc === serverOffsetUtc(a.region, a.game) &&
latest.automaticBase.hour === resetHourFor(a.region, a.game)
)
continue;
const account = appendClockRevision(
a,
null,
a.region,
at,
`automatic-${at}`,
);
next = { ...next, accounts: { ...next.accounts, [a.id]: account } };
}
return next;
}