Nico-robot HF Staff commited on
Commit
8b13123
·
verified ·
1 Parent(s): 3b3adc6

Deploy 22aa090

Browse files
app/public/club.css CHANGED
@@ -625,14 +625,11 @@
625
  .challenge-note:nth-child(2n) { rotate: var(--rotate-1-0); }
626
 
627
  .challenge-note--race { --fx-shadow-color: var(--orange); }
628
- .challenge-note--challenge { --fx-shadow-color: var(--magenta); }
629
- /* The charter's shadow rule names the magenta/cyan pair, which covers two
630
- categories. The third takes yellow bec, which the charter already spends on
631
- stickers and bands. Recorded in the design doc as a deliberate extension. */
632
  .challenge-note--showcase { --fx-shadow-color: var(--yellow); }
633
 
634
- .challenge-note--planned { background: var(--warm-paper); color: var(--ink-70); }
635
-
636
  .challenge-link {
637
  display: block;
638
  flex: 1;
 
625
  .challenge-note:nth-child(2n) { rotate: var(--rotate-1-0); }
626
 
627
  .challenge-note--race { --fx-shadow-color: var(--orange); }
628
+ /* Yellow bec is outside the charter's magenta/cyan shadow pair; the charter
629
+ already spends it on stickers and bands. Recorded in the design doc as a
630
+ deliberate extension. */
 
631
  .challenge-note--showcase { --fx-shadow-color: var(--yellow); }
632
 
 
 
633
  .challenge-link {
634
  display: block;
635
  flex: 1;
app/public/race.css CHANGED
@@ -1269,12 +1269,7 @@ table.board .withdraw:focus-visible,
1269
  }
1270
  .rounds-on .challenge-note:nth-child(2n) { rotate: var(--rotate-1-0); }
1271
  .rounds-on .challenge-note--race { --fx-shadow-color: var(--orange); }
1272
- .rounds-on .challenge-note--challenge { --fx-shadow-color: var(--magenta); }
1273
  .rounds-on .challenge-note--showcase { --fx-shadow-color: var(--yellow); }
1274
- /* Cream, not warm paper: warm paper is the page's own ground now, and a
1275
- planned round on it would have been a floating border with nothing behind
1276
- it. Cream still reads a step back from the white sheets beside it. */
1277
- .rounds-on .challenge-note--planned { background: var(--cream); color: var(--ink-70); }
1278
  .rounds-on .challenge-link { display: block; flex: 1; color: inherit; text-decoration: none; }
1279
  .rounds-on .challenge-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
1280
  .rounds-on .challenge-art {
 
1269
  }
1270
  .rounds-on .challenge-note:nth-child(2n) { rotate: var(--rotate-1-0); }
1271
  .rounds-on .challenge-note--race { --fx-shadow-color: var(--orange); }
 
1272
  .rounds-on .challenge-note--showcase { --fx-shadow-color: var(--yellow); }
 
 
 
 
1273
  .rounds-on .challenge-link { display: block; flex: 1; color: inherit; text-decoration: none; }
1274
  .rounds-on .challenge-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
1275
  .rounds-on .challenge-art {
app/src/flyer.js CHANGED
@@ -7,7 +7,7 @@
7
  // how a view ends up dragging a whole other view's imports behind it.
8
 
9
  import { formatEventFacts, formatScore } from "./format.js";
10
- import { eventGuideHref, raceHref } from "./router.js";
11
  import { voteButton } from "./votebutton.js";
12
 
13
  function el(tag, className, text) {
@@ -17,15 +17,11 @@ function el(tag, className, text) {
17
  return node;
18
  }
19
 
20
- const CATEGORIES = new Set(["race", "challenge", "showcase"]);
21
 
22
  /** Who holds this event, at the size a person scans the wall by. */
23
- function leaderLine(event, planned, rows) {
24
  const line = el("p", "flyer-leader");
25
- if (planned) {
26
- line.append(el("span", "flyer-leader-name", "course not built yet"));
27
- return line;
28
- }
29
  const star = el("img", "challenge-star");
30
  star.src = "/star-yellow.webp";
31
  star.alt = "";
@@ -45,20 +41,18 @@ function leaderLine(event, planned, rows) {
45
 
46
  /** One event on the wall: its still, who holds it, and what it is. */
47
  export function flyer(event, rows) {
48
- const planned = event.status === "planned";
49
  const known = CATEGORIES.has(event.category);
50
  const classes = ["challenge-note", "fx-shadow-card"];
51
  // An unrecognised category keeps the neutral ink shadow the base rule sets,
52
  // rather than borrowing another category's colour.
53
  if (known) classes.push(`challenge-note--${event.category}`);
54
- if (planned) classes.push("challenge-note--planned");
55
  const note = el("article", classes.join(" "));
56
  note.append(el("span", "flyer-tape"));
57
- if (event.vote && !planned) {
58
  note.append(voteButton(event, { variant: "sticker" }));
59
  }
60
- const link = el(planned ? "div" : "a", "challenge-link");
61
- if (!planned) link.href = raceHref(event.id);
62
  const facts = formatEventFacts(event)
63
  .filter((fact) => fact.label !== "speed sweep")
64
  .map((fact) => fact.value)
@@ -67,14 +61,9 @@ export function flyer(event, rows) {
67
  if (known) link.append(el("span", "eyebrow", event.category.toUpperCase()));
68
  link.append(
69
  el("h4", "flyer-title", event.title),
70
- leaderLine(event, planned, rows),
71
  el("p", "challenge-facts", facts),
72
  );
73
  note.append(link);
74
- if (planned) {
75
- const preview = el("a", "help-link", "Preview the challenge ?");
76
- preview.href = eventGuideHref(event.id);
77
- note.append(preview);
78
- }
79
  return note;
80
  }
 
7
  // how a view ends up dragging a whole other view's imports behind it.
8
 
9
  import { formatEventFacts, formatScore } from "./format.js";
10
+ import { raceHref } from "./router.js";
11
  import { voteButton } from "./votebutton.js";
12
 
13
  function el(tag, className, text) {
 
17
  return node;
18
  }
19
 
20
+ const CATEGORIES = new Set(["race", "showcase"]);
21
 
22
  /** Who holds this event, at the size a person scans the wall by. */
23
+ function leaderLine(event, rows) {
24
  const line = el("p", "flyer-leader");
 
 
 
 
25
  const star = el("img", "challenge-star");
26
  star.src = "/star-yellow.webp";
27
  star.alt = "";
 
41
 
42
  /** One event on the wall: its still, who holds it, and what it is. */
43
  export function flyer(event, rows) {
 
44
  const known = CATEGORIES.has(event.category);
45
  const classes = ["challenge-note", "fx-shadow-card"];
46
  // An unrecognised category keeps the neutral ink shadow the base rule sets,
47
  // rather than borrowing another category's colour.
48
  if (known) classes.push(`challenge-note--${event.category}`);
 
49
  const note = el("article", classes.join(" "));
50
  note.append(el("span", "flyer-tape"));
51
+ if (event.vote) {
52
  note.append(voteButton(event, { variant: "sticker" }));
53
  }
54
+ const link = el("a", "challenge-link");
55
+ link.href = raceHref(event.id);
56
  const facts = formatEventFacts(event)
57
  .filter((fact) => fact.label !== "speed sweep")
58
  .map((fact) => fact.value)
 
61
  if (known) link.append(el("span", "eyebrow", event.category.toUpperCase()));
62
  link.append(
63
  el("h4", "flyer-title", event.title),
64
+ leaderLine(event, rows),
65
  el("p", "challenge-facts", facts),
66
  );
67
  note.append(link);
 
 
 
 
 
68
  return note;
69
  }
app/src/guides.js CHANGED
@@ -29,7 +29,7 @@ export function renderGuides(root, { guideId = "index", eventId, event, section
29
  const breadcrumbs = document.createElement("nav");
30
  breadcrumbs.className = "guide-breadcrumbs";
31
  breadcrumbs.setAttribute("aria-label", "Breadcrumb");
32
- breadcrumbs.append(event?.status === "open"
33
  ? link("← Back to challenge", raceHref(eventId))
34
  : link("← Back to challenges", menuHref));
35
  main.append(breadcrumbs);
 
29
  const breadcrumbs = document.createElement("nav");
30
  breadcrumbs.className = "guide-breadcrumbs";
31
  breadcrumbs.setAttribute("aria-label", "Breadcrumb");
32
+ breadcrumbs.append(event
33
  ? link("← Back to challenge", raceHref(eventId))
34
  : link("← Back to challenges", menuHref));
35
  main.append(breadcrumbs);
app/src/guides.test.js CHANGED
@@ -1,7 +1,6 @@
1
  import { afterEach, describe, expect, it } from "vitest";
2
  import { renderGuides } from "./guides.js";
3
  import { renderEntryPanel } from "./race.js";
4
- import { flyer } from "./flyer.js";
5
 
6
  afterEach(() => document.body.replaceChildren());
7
 
@@ -39,13 +38,10 @@ describe("public guides", () => {
39
  });
40
 
41
  it("keeps each challenge's help within its own context", () => {
42
- for (const id of ["sprint-2m", "roller-sprint-2m", "hill-climb-1m5", "swag-contest",
43
- "highest-jump", "roller-slide", "rough-ground", "hold-your-ground"]) {
44
- const planned = ["highest-jump", "roller-slide", "rough-ground", "hold-your-ground"].includes(id);
45
- const root = show(null, null, { id, status: planned ? "planned" : "open" });
46
  expect(root.querySelector("article h1").textContent).not.toBe("Guide not found");
47
- if (!planned) expect(root.querySelector(`a[href="#/e/${id}"]`)).not.toBeNull();
48
- else expect(root.querySelector('a[href^="#/e/"]')).toBeNull();
49
  const links = [...root.querySelectorAll("article a")].map(a => a.getAttribute("href"));
50
  expect(links.filter(href => href.startsWith("#/"))).toEqual(["#/guides/train-a-policy"]);
51
  }
@@ -76,13 +72,11 @@ describe("public guides", () => {
76
  expect(root.querySelector("#publish")).toBeNull();
77
  });
78
 
79
- it("gives planned cards a preview link without a race entry link", () => {
80
- const card = flyer({
81
- id: "highest-jump", title: "Highest Jump", status: "planned", category: "challenge",
82
- rig: "legs", length_m: 2, slope_deg: 0, seeds: 5, time_limit_s: 50,
83
- sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05, sweep_count: 21,
84
- }, []);
85
- expect(card.querySelector('a[href="#/e/highest-jump/guide"]')).not.toBeNull();
86
- expect(card.querySelector('a[href="#/e/highest-jump"]')).toBeNull();
87
  });
88
  });
 
1
  import { afterEach, describe, expect, it } from "vitest";
2
  import { renderGuides } from "./guides.js";
3
  import { renderEntryPanel } from "./race.js";
 
4
 
5
  afterEach(() => document.body.replaceChildren());
6
 
 
38
  });
39
 
40
  it("keeps each challenge's help within its own context", () => {
41
+ for (const id of ["sprint-2m", "roller-sprint-2m", "hill-climb-1m5", "swag-contest"]) {
42
+ const root = show(null, null, { id });
 
 
43
  expect(root.querySelector("article h1").textContent).not.toBe("Guide not found");
44
+ expect(root.querySelector(`a[href="#/e/${id}"]`)).not.toBeNull();
 
45
  const links = [...root.querySelectorAll("article a")].map(a => a.getAttribute("href"));
46
  expect(links.filter(href => href.startsWith("#/"))).toEqual(["#/guides/train-a-policy"]);
47
  }
 
72
  expect(root.querySelector("#publish")).toBeNull();
73
  });
74
 
75
+ it("sends a stale link to a removed challenge's guide back to the rounds", () => {
76
+ const root = document.createElement("div");
77
+ renderGuides(root, { eventId: "highest-jump", event: undefined });
78
+ expect(root.querySelector("article h1").textContent).toBe("Guide not found");
79
+ expect(root.querySelector('.guide-breadcrumbs a[href="#/"]')).not.toBeNull();
80
+ expect(root.querySelector('a[href^="#/e/"]')).toBeNull();
 
 
81
  });
82
  });
app/src/home.js CHANGED
@@ -274,13 +274,8 @@ export async function renderHome(root, state) {
274
  // with it.
275
  renderLive(frame.querySelector(".season-live-stage"), state, { framed: true }).catch(() => {});
276
 
277
- // Only an open event has a board worth asking for.
278
  const boards = await Promise.all(
279
- events.map((event) =>
280
- event.status === "planned"
281
- ? Promise.resolve({ rows: [] })
282
- : getLeaderboard(event.id).catch(() => ({ rows: [] })),
283
- ),
284
  );
285
  const rounds = el("section", "chapter chapter--wall fx-scanlines");
286
  const wall = el("div", "cabinets");
 
274
  // with it.
275
  renderLive(frame.querySelector(".season-live-stage"), state, { framed: true }).catch(() => {});
276
 
 
277
  const boards = await Promise.all(
278
+ events.map((event) => getLeaderboard(event.id).catch(() => ({ rows: [] }))),
 
 
 
 
279
  );
280
  const rounds = el("section", "chapter chapter--wall fx-scanlines");
281
  const wall = el("div", "cabinets");
app/src/home.page.test.js CHANGED
@@ -7,7 +7,7 @@ import { renderHome } from "./home.js";
7
 
8
  vi.mock("./api.js", () => ({
9
  getEvents: async () => [{
10
- id: "sprint-2m", title: "2 m Sprint", status: "open", category: "race", rig: "legs",
11
  length_m: 2, slope_deg: 0,
12
  sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05, sweep_count: 21,
13
  }],
 
7
 
8
  vi.mock("./api.js", () => ({
9
  getEvents: async () => [{
10
+ id: "sprint-2m", title: "2 m Sprint", category: "race", rig: "legs",
11
  length_m: 2, slope_deg: 0,
12
  sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05, sweep_count: 21,
13
  }],
app/src/home.test.js CHANGED
@@ -8,11 +8,10 @@ import {
8
  } from "./home.js";
9
 
10
  const open = {
11
- id: "sprint-2m", title: "2 m Sprint", status: "open", category: "race", rig: "legs",
12
  length_m: 2, slope_deg: 0,
13
  sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05, sweep_count: 21,
14
  };
15
- const planned = { ...open, id: "best-jump", title: "Best Jump", status: "planned", category: "challenge" };
16
  const held = [{ user: "cdeplanne", policy_name: "Walk rough", score: 9.456, seeds_finished: 5 }];
17
 
18
  describe("the masthead", () => {
@@ -286,21 +285,6 @@ describe("an open event's flyer", () => {
286
  });
287
  });
288
 
289
- describe("a planned event's flyer", () => {
290
- it("is on the wall but is not a link", () => {
291
- const el = flyer(planned, []);
292
- expect(el.querySelector("a.challenge-link")).toBeNull();
293
- expect(el.querySelector("div.challenge-link")).not.toBeNull();
294
- expect(el.classList.contains("challenge-note--planned")).toBe(true);
295
- });
296
-
297
- it("says why it cannot be entered and never invites one", () => {
298
- const el = flyer(planned, []);
299
- expect(el.textContent).toContain("course not built yet");
300
- expect(el.textContent).not.toContain("be the first");
301
- });
302
- });
303
-
304
  const voted = {
305
  ...open,
306
  id: "swag-contest",
@@ -326,11 +310,6 @@ describe("a votable flyer", () => {
326
  expect(note.querySelector(".flyer-leader").textContent).toContain("no votes yet");
327
  });
328
 
329
- it("hides the button on a planned round -- there is no booth to send anyone to yet", () => {
330
- const note = flyer({ ...voted, status: "planned" }, []);
331
- expect(note.querySelector(".vote-button")).toBeNull();
332
- });
333
-
334
  it("leaves a timed flyer alone", () => {
335
  const note = flyer(open, held);
336
  expect(note.querySelector(".vote-button")).toBeNull();
@@ -346,7 +325,6 @@ describe("the flyer's category", () => {
346
  it("colours the offset shadow by category", () => {
347
  const shadowOf = (category) => flyer({ ...open, category }, []).className;
348
  expect(shadowOf("race")).toContain("challenge-note--race");
349
- expect(shadowOf("challenge")).toContain("challenge-note--challenge");
350
  expect(shadowOf("showcase")).toContain("challenge-note--showcase");
351
  });
352
 
 
8
  } from "./home.js";
9
 
10
  const open = {
11
+ id: "sprint-2m", title: "2 m Sprint", category: "race", rig: "legs",
12
  length_m: 2, slope_deg: 0,
13
  sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05, sweep_count: 21,
14
  };
 
15
  const held = [{ user: "cdeplanne", policy_name: "Walk rough", score: 9.456, seeds_finished: 5 }];
16
 
17
  describe("the masthead", () => {
 
285
  });
286
  });
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  const voted = {
289
  ...open,
290
  id: "swag-contest",
 
310
  expect(note.querySelector(".flyer-leader").textContent).toContain("no votes yet");
311
  });
312
 
 
 
 
 
 
313
  it("leaves a timed flyer alone", () => {
314
  const note = flyer(open, held);
315
  expect(note.querySelector(".vote-button")).toBeNull();
 
325
  it("colours the offset shadow by category", () => {
326
  const shadowOf = (category) => flyer({ ...open, category }, []).className;
327
  expect(shadowOf("race")).toContain("challenge-note--race");
 
328
  expect(shadowOf("showcase")).toContain("challenge-note--showcase");
329
  });
330
 
app/src/player.test.js CHANGED
@@ -159,11 +159,11 @@ describe("byEvent: the player's rounds, best first", () => {
159
  // A null rank compared as a number sorts before every real one, which
160
  // would put the round a player never placed on at the top of their page.
161
  const groups = byEvent([
162
- pub({ run_id: "none", event_id: "rough-ground", event_title: "Rough Ground",
163
  rank: null, on_board: false }),
164
  pub({ run_id: "third", rank: 3 }),
165
  ]);
166
- expect(groups.map((g) => g.eventId)).toEqual(["sprint-2m", "rough-ground"]);
167
  expect(groups[1].best).toBeNull();
168
  });
169
 
 
159
  // A null rank compared as a number sorts before every real one, which
160
  // would put the round a player never placed on at the top of their page.
161
  const groups = byEvent([
162
+ pub({ run_id: "none", event_id: "hill-climb-1m5", event_title: "1.5 m Hill Climb",
163
  rank: null, on_board: false }),
164
  pub({ run_id: "third", rank: 3 }),
165
  ]);
166
+ expect(groups.map((g) => g.eventId)).toEqual(["sprint-2m", "hill-climb-1m5"]);
167
  expect(groups[1].best).toBeNull();
168
  });
169
 
app/src/race.js CHANGED
@@ -335,14 +335,13 @@ export function otherRounds(events, event, boards) {
335
  *
336
  * Separate from otherRounds so that the shape is testable without a network:
337
  * this is the part that fetches, and it asks for a leaderboard per card and a
338
- * still per card. A planned event has no board worth asking for.
339
  */
340
  export async function keepRacing(root, event) {
341
  const events = await getEvents();
342
  const others = events.filter((e) => e.id !== event.id);
343
  const boards = new Map();
344
  await Promise.all(others.map(async (e) => {
345
- if (e.status === "planned") return;
346
  boards.set(e.id, (await getLeaderboard(e.id).catch(() => ({ rows: [] }))).rows);
347
  }));
348
  const strip = otherRounds(events, event, boards);
 
335
  *
336
  * Separate from otherRounds so that the shape is testable without a network:
337
  * this is the part that fetches, and it asks for a leaderboard per card and a
338
+ * still per card.
339
  */
340
  export async function keepRacing(root, event) {
341
  const events = await getEvents();
342
  const others = events.filter((e) => e.id !== event.id);
343
  const boards = new Map();
344
  await Promise.all(others.map(async (e) => {
 
345
  boards.set(e.id, (await getLeaderboard(e.id).catch(() => ({ rows: [] }))).rows);
346
  }));
347
  const strip = otherRounds(events, event, boards);
app/src/race.rounds.test.js CHANGED
@@ -9,8 +9,8 @@
9
 
10
  import { describe, expect, it, vi } from "vitest";
11
 
12
- const event = (id, title, status = "open", category = "race") => ({
13
- id, title, status, category, rig: "legs",
14
  seeds: 5, sweep_count: 5, sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05,
15
  length_m: 2, slope_deg: 0,
16
  });
@@ -19,8 +19,7 @@ const PROGRAMME = [
19
  event("sprint-2m", "2 m Sprint"),
20
  event("roller-sprint-2m", "2 m Roller Sprint"),
21
  event("hill-climb-1m5", "1.5 m Hill Climb"),
22
- event("swag-contest", "Swag Contest", "open", "showcase"),
23
- event("highest-jump", "Highest Jump", "planned", "challenge"),
24
  ];
25
 
26
  const asked = [];
@@ -48,14 +47,13 @@ describe("keepRacing", () => {
48
  expect(kinds).toEqual(["main.", "section.rounds-on", "footer."]);
49
  });
50
 
51
- it("asks for a board per open card and none for a planned one", async () => {
52
  asked.length = 0;
53
  const root = document.createElement("div");
54
  root.append(document.createElement("footer"));
55
  await keepRacing(root, PROGRAMME[0]);
56
- // Every other round is on the wall; only the open ones cost a board.
57
  expect(asked).toEqual(["roller-sprint-2m", "hill-climb-1m5", "swag-contest"]);
58
- expect(root.querySelectorAll(".rounds-on .challenge-note")).toHaveLength(4);
59
  });
60
 
61
  it("appends when there is no footer to sit before", async () => {
 
9
 
10
  import { describe, expect, it, vi } from "vitest";
11
 
12
+ const event = (id, title, category = "race") => ({
13
+ id, title, category, rig: "legs",
14
  seeds: 5, sweep_count: 5, sweep_lo: 0.2, sweep_hi: 1.2, sweep_step: 0.05,
15
  length_m: 2, slope_deg: 0,
16
  });
 
19
  event("sprint-2m", "2 m Sprint"),
20
  event("roller-sprint-2m", "2 m Roller Sprint"),
21
  event("hill-climb-1m5", "1.5 m Hill Climb"),
22
+ event("swag-contest", "Swag Contest", "showcase"),
 
23
  ];
24
 
25
  const asked = [];
 
47
  expect(kinds).toEqual(["main.", "section.rounds-on", "footer."]);
48
  });
49
 
50
+ it("asks for a board per other card", async () => {
51
  asked.length = 0;
52
  const root = document.createElement("div");
53
  root.append(document.createElement("footer"));
54
  await keepRacing(root, PROGRAMME[0]);
 
55
  expect(asked).toEqual(["roller-sprint-2m", "hill-climb-1m5", "swag-contest"]);
56
+ expect(root.querySelectorAll(".rounds-on .challenge-note")).toHaveLength(3);
57
  });
58
 
59
  it("appends when there is no footer to sit before", async () => {
app/src/race.test.js CHANGED
@@ -361,8 +361,8 @@ describe("raceHall: the page's frame", () => {
361
  });
362
 
363
  it("names the kind of event over its title, as the flyer did", () => {
364
- const hall = raceHall({ ...event, title: "2 m Sprint", category: "challenge" });
365
- expect(hall.querySelector(".raceeyebrow").textContent).toBe("CHALLENGE");
366
  // An event whose category the server did not send draws no empty line.
367
  expect(raceHall({ ...event, title: "x" }).querySelector(".raceeyebrow")).toBeNull();
368
  });
@@ -424,16 +424,14 @@ describe("raceHall: the page's frame", () => {
424
  describe("otherRounds: the way on, under the board", () => {
425
  // `event` at the top of this file carries what formatEventFacts reads; the
426
  // programme is what GET /api/events hands the page, so it carries it too.
427
- const round = (id, title, status, category, rig = "legs", extra = {}) => ({
428
- ...event, id, title, status, category, rig, ...extra,
429
  });
430
  const programme = [
431
- round("sprint-2m", "2 m Sprint", "open", "race"),
432
- round("roller-sprint-2m", "2 m Roller Sprint", "open", "race", "rollers"),
433
- round("hill-climb-1m5", "1.5 m Hill Climb", "open", "race"),
434
- round("swag-contest", "Swag Contest", "open", "showcase", "legs", { vote: {} }),
435
- round("highest-jump", "Highest Jump", "planned", "challenge"),
436
- round("rough-ground", "Rough Ground", "planned", "challenge"),
437
  ];
438
  const here = programme[0];
439
 
@@ -461,8 +459,6 @@ describe("otherRounds: the way on, under the board", () => {
461
  const cards = [...strip.querySelectorAll(".challenge-note")];
462
  expect(cards[0].querySelector(".flyer-leader-name").textContent).toBe("ann");
463
  expect(cards[1].querySelector(".flyer-leader-name").textContent).toBe("be the first");
464
- // A planned event says so rather than inviting an entry it cannot take.
465
- expect(cards[3].querySelector(".flyer-leader-name").textContent).toBe("course not built yet");
466
  });
467
  });
468
 
 
361
  });
362
 
363
  it("names the kind of event over its title, as the flyer did", () => {
364
+ const hall = raceHall({ ...event, title: "2 m Sprint", category: "showcase" });
365
+ expect(hall.querySelector(".raceeyebrow").textContent).toBe("SHOWCASE");
366
  // An event whose category the server did not send draws no empty line.
367
  expect(raceHall({ ...event, title: "x" }).querySelector(".raceeyebrow")).toBeNull();
368
  });
 
424
  describe("otherRounds: the way on, under the board", () => {
425
  // `event` at the top of this file carries what formatEventFacts reads; the
426
  // programme is what GET /api/events hands the page, so it carries it too.
427
+ const round = (id, title, category, rig = "legs", extra = {}) => ({
428
+ ...event, id, title, category, rig, ...extra,
429
  });
430
  const programme = [
431
+ round("sprint-2m", "2 m Sprint", "race"),
432
+ round("roller-sprint-2m", "2 m Roller Sprint", "race", "rollers"),
433
+ round("hill-climb-1m5", "1.5 m Hill Climb", "race"),
434
+ round("swag-contest", "Swag Contest", "showcase", "legs", { vote: {} }),
 
 
435
  ];
436
  const here = programme[0];
437
 
 
459
  const cards = [...strip.querySelectorAll(".challenge-note")];
460
  expect(cards[0].querySelector(".flyer-leader-name").textContent).toBe("ann");
461
  expect(cards[1].querySelector(".flyer-leader-name").textContent).toBe("be the first");
 
 
462
  });
463
  });
464
 
arena/events/highest-jump.toml DELETED
@@ -1,52 +0,0 @@
1
- # PLANNED — not raceable yet.
2
- #
3
- # Height off the ground, not time down a lane. Needs a new metric and a
4
- # different command shape — the event that tests whether the manifest is honest.
5
- #
6
- # The physics below is copied verbatim from the sprint it was cloned from,
7
- # so this event exists on the programme and can be designed against — but
8
- # status is "planned", and the engine refuses to race it. A time recorded
9
- # here today would be a sprint time wearing another event's name, which is
10
- # a false result on a board other people read.
11
- #
12
- # Making it real: build the course, then set status = "open".
13
-
14
- status = "planned"
15
- order = 110
16
- id = "highest-jump"
17
- title = "Highest Jump"
18
- category = "challenge"
19
- rig = "legs"
20
- time_limit_s = 50.0
21
- metric = "mean_finish_time"
22
- seeds = [1, 2, 3, 4, 5]
23
-
24
- [course]
25
- kind = "lane"
26
- length_m = 2.0
27
- width_m = 0.8
28
- wall_height_m = 0.15
29
- slope_deg = 0.0
30
-
31
- [command]
32
- vel = [0.25, 0.0, 0.0]
33
- head = [0.0, 0.0, 0.0, 0.0]
34
- body = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
35
-
36
- [start]
37
- keyframe = "STAND"
38
- settle_s = 0.5
39
-
40
- [start.perturbation]
41
- joint_rad = 0.01
42
- yaw_deg = 2.0
43
-
44
- [termination]
45
- fall_gravity_z = -0.5
46
- fall_hold_s = 0.3
47
-
48
- [sweep]
49
- lo = 0.20
50
- hi = 1.20
51
- step = 0.05
52
- finalists = 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
arena/events/hold-your-ground.toml DELETED
@@ -1,53 +0,0 @@
1
- # PLANNED — not raceable yet.
2
- #
3
- # Who resists a shove best: the robot still standing after an external push,
4
- # not the one that pushes hardest. Needs the runner to apply a force
5
- # mid-episode and a metric that scores staying up rather than finishing.
6
- #
7
- # The physics below is copied verbatim from the sprint it was cloned from,
8
- # so this event exists on the programme and can be designed against — but
9
- # status is "planned", and the engine refuses to race it. A time recorded
10
- # here today would be a sprint time wearing another event's name, which is
11
- # a false result on a board other people read.
12
- #
13
- # Making it real: build the course, then set status = "open".
14
-
15
- status = "planned"
16
- order = 140
17
- id = "hold-your-ground"
18
- title = "Hold Your Ground"
19
- category = "challenge"
20
- rig = "legs"
21
- time_limit_s = 50.0
22
- metric = "mean_finish_time"
23
- seeds = [1, 2, 3, 4, 5]
24
-
25
- [course]
26
- kind = "lane"
27
- length_m = 2.0
28
- width_m = 0.8
29
- wall_height_m = 0.15
30
- slope_deg = 0.0
31
-
32
- [command]
33
- vel = [0.25, 0.0, 0.0]
34
- head = [0.0, 0.0, 0.0, 0.0]
35
- body = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
36
-
37
- [start]
38
- keyframe = "STAND"
39
- settle_s = 0.5
40
-
41
- [start.perturbation]
42
- joint_rad = 0.01
43
- yaw_deg = 2.0
44
-
45
- [termination]
46
- fall_gravity_z = -0.5
47
- fall_hold_s = 0.3
48
-
49
- [sweep]
50
- lo = 0.20
51
- hi = 1.20
52
- step = 0.05
53
- finalists = 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
arena/events/roller-slide.toml DELETED
@@ -1,52 +0,0 @@
1
- # PLANNED — not raceable yet.
2
- #
3
- # Distance held in a slide once the command stops. Needs a course that ends
4
- # the drive partway, which no event does yet.
5
- #
6
- # The physics below is copied verbatim from the sprint it was cloned from,
7
- # so this event exists on the programme and can be designed against — but
8
- # status is "planned", and the engine refuses to race it. A time recorded
9
- # here today would be a sprint time wearing another event's name, which is
10
- # a false result on a board other people read.
11
- #
12
- # Making it real: build the course, then set status = "open".
13
-
14
- status = "planned"
15
- order = 120
16
- id = "roller-slide"
17
- title = "Roller Slide"
18
- category = "race"
19
- rig = "rollers"
20
- time_limit_s = 40.0
21
- metric = "mean_finish_time"
22
- seeds = [1, 2, 3, 4, 5]
23
-
24
- [course]
25
- kind = "lane"
26
- length_m = 2.0
27
- width_m = 0.8
28
- wall_height_m = 0.15
29
- slope_deg = 0.0
30
-
31
- [command]
32
- vel = [0.6, 0.0, 0.0] # RVEL_FWD
33
- head = [0.0, 0.0, 0.0, 0.0]
34
- body = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
35
-
36
- [start]
37
- keyframe = "STAND"
38
- settle_s = 0.5
39
-
40
- [start.perturbation]
41
- joint_rad = 0.01
42
- yaw_deg = 2.0
43
-
44
- [termination]
45
- fall_gravity_z = -0.5
46
- fall_hold_s = 0.3
47
-
48
- [sweep]
49
- lo = 0.30
50
- hi = 2.00
51
- step = 0.10
52
- finalists = 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
arena/events/rough-ground.toml DELETED
@@ -1,52 +0,0 @@
1
- # PLANNED — not raceable yet.
2
- #
3
- # The sprint over a broken surface. Needs the course builder to emit terrain,
4
- # which today emits one flat plane.
5
- #
6
- # The physics below is copied verbatim from the sprint it was cloned from,
7
- # so this event exists on the programme and can be designed against — but
8
- # status is "planned", and the engine refuses to race it. A time recorded
9
- # here today would be a sprint time wearing another event's name, which is
10
- # a false result on a board other people read.
11
- #
12
- # Making it real: build the course, then set status = "open".
13
-
14
- status = "planned"
15
- order = 130
16
- id = "rough-ground"
17
- title = "Rough Ground"
18
- category = "challenge"
19
- rig = "legs"
20
- time_limit_s = 50.0
21
- metric = "mean_finish_time"
22
- seeds = [1, 2, 3, 4, 5]
23
-
24
- [course]
25
- kind = "lane"
26
- length_m = 2.0
27
- width_m = 0.8
28
- wall_height_m = 0.15
29
- slope_deg = 0.0
30
-
31
- [command]
32
- vel = [0.25, 0.0, 0.0]
33
- head = [0.0, 0.0, 0.0, 0.0]
34
- body = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
35
-
36
- [start]
37
- keyframe = "STAND"
38
- settle_s = 0.5
39
-
40
- [start.perturbation]
41
- joint_rad = 0.01
42
- yaw_deg = 2.0
43
-
44
- [termination]
45
- fall_gravity_z = -0.5
46
- fall_hold_s = 0.3
47
-
48
- [sweep]
49
- lo = 0.20
50
- hi = 1.20
51
- step = 0.05
52
- finalists = 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/guides/challenges/highest-jump.md DELETED
@@ -1,11 +0,0 @@
1
- # Highest Jump
2
-
3
- **Planned — submissions are not open.**
4
-
5
- The goal is to jump high. Height measurement and landing rules are not defined yet.
6
-
7
- To prepare, experiment with a controlled crouch, small jumps and stable landings
8
- in your own training environment. There is no official Arena training preset or
9
- score for this challenge yet.
10
-
11
- [Training basics →](../train-a-policy.md)
 
 
 
 
 
 
 
 
 
 
 
 
docs/guides/challenges/hold-your-ground.md DELETED
@@ -1,12 +0,0 @@
1
- # Hold Your Ground
2
-
3
- **Planned — submissions are not open.**
4
-
5
- The goal is to remain standing after a shove. Push strength, direction and
6
- scoring rules are not defined yet.
7
-
8
- To prepare, train a stable standing policy, then introduce small pushes from
9
- varying directions. Focus on recovering balance without falling. There is no
10
- official Arena training preset for this challenge yet.
11
-
12
- [Training basics →](../train-a-policy.md)
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/guides/challenges/roller-slide.md DELETED
@@ -1,11 +0,0 @@
1
- # Roller Slide
2
-
3
- **Planned — submissions are not open.**
4
-
5
- The goal is to stay balanced in a slide after the drive command stops.
6
- The command timing and distance rules are not defined yet.
7
-
8
- To prepare, start with `Mjlab-Velocity-Flat-MicroDuck-Rollers` and experiment with
9
- a propulsion phase followed by coasting. The Arena cannot score this challenge yet.
10
-
11
- [Training basics →](../train-a-policy.md)
 
 
 
 
 
 
 
 
 
 
 
 
docs/guides/challenges/rough-ground.md DELETED
@@ -1,12 +0,0 @@
1
- # Rough Ground
2
-
3
- **Planned — submissions are not open.**
4
-
5
- The goal is to walk over uneven ground. The Arena’s terrain and scoring rules
6
- are not defined yet.
7
-
8
- To prepare, try `Mjlab-Velocity-Rough-MicroDuck`. Increase terrain difficulty
9
- slowly and test on unfamiliar surfaces. This training environment is a starting
10
- point, not a reproduction of a released Arena course.
11
-
12
- [Training basics →](../train-a-policy.md)