fix(series): clearer step layout, sorted class list and autosave

The series page is split into numbered steps; classes are a sorted list
with the tick on the left and All/None, new series start with none, and
every change is saved straight away so ticks are no longer lost. Also
gives primary/danger buttons white text in the light theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-10-11 18:28:05 +02:00
parent ec200aef2b
commit 581ec2c781
12 changed files with 172 additions and 46 deletions

View File

@@ -164,6 +164,20 @@ async function captureShot(name, { setup }) {
}
const shots = {
series: {
async setup({ evaluate, navigate, scrollTo }) {
// A series over two of four classes (added out of name order on purpose: the page sorts them).
await navigate("dashboard", "#view");
await evaluate(`(async () => {
const { state } = await (await fetch("/api/state")).json();
state.classes.push({ id: "shot_rookie", name: "Rookie" }, { id: "shot_4wd", name: "4WD Buggy" }, { id: "shot_nitro", name: "1/8 Nitro" });
state.series = [{ id: "shot_series", name: "Winter Championship 2026/2027", classIds: ["shot_class", "shot_rookie"], eventIds: ["shot_event"], scoring: "club", club: "JMK RB", countMode: "best", countValue: 9 }];
await fetch("/api/state", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(state) });
})()`);
await navigate("series", "#seriesForm");
await scrollTo(process.env.SHOT_SCROLL || "#seriesForm", process.env.SHOT_SCROLL ? "center" : "start");
},
},
guide: {
async setup({ navigate }) {
await navigate("guide", ".guide-list");