fix(settings): put Genshin TCG tracking in Setup

This commit is contained in:
Lucas Winther committed 2026-11-01 04:39:49 +01:00
1 parent 18b5bfa602
commit 2f690385f4
6 files changed
+33 -29

No files matched your search

+1 -1
View File
@@ -708,7 +708,7 @@ legend on the same baseline as "Next: …".
## Content tracking additions (2026-11-01) ## Content tracking additions (2026-11-01)
Genshin's About tab has an Event tracking group before Data sources. The native Genshin's Setup tab has an Event tracking group below What to track. The native
checkbox **Track TCG events** uses the existing settings row, with the copy checkbox **Track TCG events** uses the existing settings row, with the copy
“Show Genius Invokation TCG events in your lists and timeline.” The setting is “Show Genius Invokation TCG events in your lists and timeline.” The setting is
saved immediately; while saving it is disabled, and failure keeps the prior saved immediately; while saving it is disabled, and failure keeps the prior
+1 -1
View File
@@ -690,7 +690,7 @@ windows spec, without changing its source/date requirements. On transition,
existing event followers retain pass-family pins in enabled lanes; newly offered existing event followers retain pass-family pins in enabled lanes; newly offered
Miliastra remains hidden until enabled. Miliastra remains hidden until enabled.
Genshin → About → Event tracking provides **Track TCG events**, on by default, Genshin → Setup → Event tracking provides **Track TCG events**, on by default,
across that reader's Genshin servers. Off hides classified source TCG activities across that reader's Genshin servers. Off hides classified source TCG activities
from live lists, timeline, counts, next-deadline guidance and event-derived daily from live lists, timeline, counts, next-deadline guidance and event-derived daily
instructions. It preserves notes, completion and Archive history; turning it instructions. It preserves notes, completion and Archive history; turning it
@@ -55,7 +55,7 @@ Rebase account-scoped `fieldTimes` paths for classified IDs, preserving the late
**Interfaces:** Reader event rows use logical destination game and existing IDs. Shared category filtering excludes TCG when `prefs.genshinTcg === false`. Retain classified snapshots for migration and source-backed pass rows even when ordinary Events is off. Freshness/source lookup maps logical Miliastra to supplying Genshin sources. **Interfaces:** Reader event rows use logical destination game and existing IDs. Shared category filtering excludes TCG when `prefs.genshinTcg === false`. Retain classified snapshots for migration and source-backed pass rows even when ordinary Events is off. Freshness/source lookup maps logical Miliastra to supplying Genshin sources.
- [x] Add failing tests for lane independence, hidden-lane policy, cached snapshots, source attribution and unchanged Genshin rows. - [x] Add failing tests for lane independence, hidden-lane policy, cached snapshots, source attribution and unchanged Genshin rows.
- [x] Route row rendering and lane discovery; offer Miliastra independently without synthetic dailies; point to its settings from Genshin About. - [x] Route row rendering and lane discovery; offer Miliastra independently without synthetic dailies; point to its settings from Genshin Setup.
- [x] Run focused reader/view tests and typecheck. - [x] Run focused reader/view tests and typecheck.
### Task 4: Feed-backed battle-pass cycles ### Task 4: Feed-backed battle-pass cycles
@@ -72,7 +72,7 @@ Rebase account-scoped `fieldTimes` paths for classified IDs, preserving the late
**Files:** `src/client/components/redesign/GameSettings.tsx`, `src/client/state/reader/eventRows.ts`, `routines.ts`, `test/reader-tcg.test.tsx` (new). **Files:** `src/client/components/redesign/GameSettings.tsx`, `src/client/state/reader/eventRows.ts`, `routines.ts`, `test/reader-tcg.test.tsx` (new).
**Interfaces:** `prefs.genshinTcg` absent means true. Genshin About renders Track TCG events, supporting copy from spec, immediate save and failure rollback. All live surfaces use the shared reader classification predicate; history remains readable. **Interfaces:** `prefs.genshinTcg` absent means true. Genshin Setup renders Track TCG events, supporting copy from spec, immediate save and failure rollback. All live surfaces use the shared reader classification predicate; history remains readable.
- [x] Add failing tests for default/on/off/cached snapshot behavior, multiple accounts, saved-history preservation and rejected save. - [x] Add failing tests for default/on/off/cached snapshot behavior, multiple accounts, saved-history preservation and rejected save.
- [x] Implement existing-style accessible toggle and shared filtering; no ignored/completed writes. - [x] Implement existing-style accessible toggle and shared filtering; no ignored/completed writes.
@@ -24,7 +24,9 @@ To Temper pairs. ReaderApp already filters ended rows and reconciles previously
seen ones into Archive: old rows in the feed do not establish a display bug. seen ones into Archive: old rows in the feed do not establish a display bug.
The owner chose source-driven classification over a maintained title table, and The owner chose source-driven classification over a maintained title table, and
requested a show/track TCG toggle in Genshin's About tab. originally requested a show/track TCG toggle in Genshin's About tab, then
explicitly moved it to Setup after trying the release. The current location is
Setup, immediately below What to track.
## Approaches ## Approaches
@@ -42,7 +44,7 @@ title classifier or a replacement for source labels.
- Miliastra Wonderland is an independently selectable built-in lane. - Miliastra Wonderland is an independently selectable built-in lane.
- Source-dated battle passes are tracked through Cycles, once per pass window. - Source-dated battle passes are tracked through Cycles, once per pass window.
- Genshin's About tab controls whether its TCG events are tracked. - Genshin's Setup tab controls whether its TCG events are tracked.
- Notes, completion, ignores, daily logs, amounts, history and clock references - Notes, completion, ignores, daily logs, amounts, history and clock references
survive reclassification, import/restore and repeated application. survive reclassification, import/restore and repeated application.
- Keep IDs, source URLs, source IDs, dates, precision and the current matching - Keep IDs, source URLs, source IDs, dates, precision and the current matching
@@ -96,7 +98,7 @@ Like other newly added lanes, it arrives off for existing readers and is
available in setup for new readers. This lane setting takes precedence over available in setup for new readers. This lane setting takes precedence over
preserving a relocated pass's visibility: Silvery Moonlight Chronicle stays preserving a relocated pass's visibility: Silvery Moonlight Chronicle stays
hidden until Miliastra is enabled, with its follow/pin preferences and progress hidden until Miliastra is enabled, with its follow/pin preferences and progress
retained. Enabling the lane restores its eligible placements. Genshin's About tab includes a short pointer retained. Enabling the lane restores its eligible placements. Genshin's Setup tab includes a short pointer
to Miliastra's settings so the relocated activities are discoverable. to Miliastra's settings so the relocated activities are discoverable.
Reclassification resolves storage as well as presentation. Use a persisted Reclassification resolves storage as well as presentation. Use a persisted
@@ -149,7 +151,7 @@ routines. Hidden lanes remain hidden, including newly offered Miliastra. New
readers follow passes through Cycles. An account can follow passes with ordinary readers follow passes through Cycles. An account can follow passes with ordinary
Events turned off. Silvery Moonlight Chronicle is a pass under Miliastra. Events turned off. Silvery Moonlight Chronicle is a pass under Miliastra.
## Genshin About: TCG switch ## Genshin Setup: TCG switch
Use the existing settings control style, with label **Track TCG events** and Use the existing settings control style, with label **Track TCG events** and
supporting copy **Show Genius Invokation TCG events in your lists and timeline.** supporting copy **Show Genius Invokation TCG events in your lists and timeline.**
+19 -19
View File
@@ -217,25 +217,6 @@ export function GameSettings({
</div> </div>
)} )}
</div> </div>
{selected === "genshin" && (
<section className="grp">
<h3>Event tracking</h3>
<label className="trow">
<span>Track TCG events</span>
<input type="checkbox" checked={state.prefs.genshinTcg !== false} disabled={savingTcg}
onChange={async (e) => {
const value = e.target.checked;
setSavingTcg(true);
const result = await onAction({ type: "prefs", patch: { genshinTcg: value }, ...actionMeta() });
setSavingTcg(false);
setMessage(result.ok ? "" : "TCG tracking could not be saved. Your previous setting is kept.");
}} />
</label>
<p className="help">Show Genius Invokation TCG events in your lists and timeline.</p>
<p className="help">Miliastra Wonderland has its own game settings. Enable it in Your games to track its activities separately.</p>
{message && <p role="status">{message}</p>}
</section>
)}
<section className="grp"> <section className="grp">
<h3>Data sources</h3> <h3>Data sources</h3>
{sources.filter((s) => s.game === sourceGameFor(selected)).length === 0 ? ( {sources.filter((s) => s.game === sourceGameFor(selected)).length === 0 ? (
@@ -354,6 +335,25 @@ export function GameSettings({
</div> </div>
</section> </section>
)} )}
{selected === "genshin" && (
<section className="grp">
<h3>Event tracking</h3>
<label className="trow">
<span>Track TCG events</span>
<input type="checkbox" checked={state.prefs.genshinTcg !== false} disabled={savingTcg}
onChange={async (e) => {
const value = e.target.checked;
setSavingTcg(true);
const result = await onAction({ type: "prefs", patch: { genshinTcg: value }, ...actionMeta() });
setSavingTcg(false);
setMessage(result.ok ? "" : "TCG tracking could not be saved. Your previous setting is kept.");
}} />
</label>
<p className="help">Show Genius Invokation TCG events in your lists and timeline.</p>
<p className="help">Miliastra Wonderland has its own game settings. Enable it in Your games to track its activities separately.</p>
{message && <p role="status">{message}</p>}
</section>
)}
<section className="grp profile-servers"> <section className="grp profile-servers">
<h3> <h3>
Servers Servers
+4 -2
View File
@@ -19,8 +19,10 @@ test("TCG defaults on; off hides remembered events and dailies without changing
expect(s.data["account:one"]!.progress[event.id]).toHaveProperty("note", "keep"); expect(s.data["account:one"]!.progress[event.id]).toHaveProperty("note", "keep");
expect(s.seenEvents[pairKey("account:one", event.id)]).toBeDefined(); expect(s.seenEvents[pairKey("account:one", event.id)]).toBeDefined();
}); });
test("Genshin About offers the TCG tracking preference", () => { test("Genshin Setup offers the TCG tracking preference", () => {
const s = migrateLegacy({}, ["genshin"], at, () => "account:one"); const s = migrateLegacy({}, ["genshin"], at, () => "account:one");
const html = renderToStaticMarkup(<GameSettings state={s} sources={[]} initialGame="genshin" tab="about" now={Date.parse(at)} onAction={async () => ({ ok: true })} />); const html = renderToStaticMarkup(<GameSettings state={s} sources={[]} initialGame="genshin" tab="setup" now={Date.parse(at)} onAction={async () => ({ ok: true })} />);
expect(html).toContain("Track TCG events"); expect(html).toContain("Track TCG events");
const about = renderToStaticMarkup(<GameSettings state={s} sources={[]} initialGame="genshin" tab="about" now={Date.parse(at)} onAction={async () => ({ ok: true })} />);
expect(about).not.toContain("Track TCG events");
}); });