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]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ddd9673f86
commit
50c6e91b00
@@ -0,0 +1,35 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import {
|
||||
retainBackups,
|
||||
type BackupSnapshot,
|
||||
} from "../src/client/state/reader/backups.ts";
|
||||
const now = Date.parse("2026-10-16T12:00:00Z"),
|
||||
day = 86400000;
|
||||
test("400 days fold to seven daily, four weekly and six monthly real snapshots", () => {
|
||||
const values: BackupSnapshot[] = Array.from({ length: 400 }, (_, i) => ({
|
||||
id: String(i),
|
||||
at: new Date(now - i * day).toISOString(),
|
||||
payload: { day: i },
|
||||
}));
|
||||
const kept = retainBackups(values, now);
|
||||
expect(kept).toHaveLength(17);
|
||||
expect(kept.slice(0, 7).map((v) => v.id)).toEqual([
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
]);
|
||||
expect(new Set(kept.map((v) => v.id)).size).toBe(17);
|
||||
});
|
||||
test("latest per bucket wins, future and ancient snapshots are excluded", () => {
|
||||
const values = [
|
||||
{ id: "old", at: "2026-10-16T01:00:00Z", payload: {} },
|
||||
{ id: "new", at: "2026-10-16T10:00:00Z", payload: {} },
|
||||
{ id: "future", at: "2027-01-01T00:00:00Z", payload: {} },
|
||||
{ id: "ancient", at: "2024-01-01T00:00:00Z", payload: {} },
|
||||
];
|
||||
expect(retainBackups(values, now).map((v) => v.id)).toEqual(["new"]);
|
||||
});
|
||||
Reference in New Issue
Block a user