The family list knows the hall: about panels link to gamehall.kestrelsnest.social, and a new game gets a card there

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
Eric Wagoner
2026-09-23 21:04:28 -04:00
co-authored by Claude Fable 5.1
parent 2d78ab6b3f
commit bce01a013a
7 changed files with 52 additions and 15 deletions
+7 -3
View File
@@ -3,7 +3,7 @@
// bot, open a table, join by code, the ledger of your tables, and the
// about panel with the rules, the guide and a way to reach the keeper.
import { goto } from '$app/navigation';
import { otherGames, type FamilyGame } from '$lib/family';
import { loadFamily, type FamilyGame } from '$lib/family';
import Preferences from './Preferences.svelte';
import { prefs, setPref } from '$lib/prefs.svelte';
import { allSeats, doubtSeat, forgetSeat, rememberSeat, ServerError, trustSeat } from '$lib/net/client';
@@ -33,8 +33,12 @@
const hours = (minutes: number) => (minutes < 90 ? `${minutes} minutes` : `${Math.round(minutes / 60)} hours`);
/** The other games of Kestrel's Hall, for the about panel. */
let family = $state<FamilyGame[]>([]);
let hall = $state('');
$effect(() => {
void otherGames('__SLUG__').then((g) => (family = g));
void loadFamily('__SLUG__').then((f) => {
family = f.games;
hall = f.hall;
});
});
/** Reports this browser's seats have filed, with the keeper's replies. */
let reports = $state<Report[]>([]);
@@ -282,7 +286,7 @@
</p>
{/if}
{#if family.length}
<h3>More games in Kestrel's Hall</h3>
<h3>More games in {#if hall}<a href={hall}>Kestrel's Hall</a>{:else}Kestrel's Hall{/if}</h3>
<ul class="family">
{#each family as g (g.slug)}
<li><a href={g.url}>{g.name}</a>: {g.pitch} <span class="muted">{g.players} players; {g.origin}.</span></li>
+13 -6
View File
@@ -1,6 +1,7 @@
// The other games of Kestrel's Hall, from the family list the kit keeps
// (family.json, one copy shipped with every game), so a player who liked one
// table can find the next. This game is left out of its own list.
// table can find the next, and the hall's front door. This game is left out
// of its own list.
export interface FamilyGame {
slug: string;
@@ -11,13 +12,19 @@ export interface FamilyGame {
origin: string;
}
export async function otherGames(self: string): Promise<FamilyGame[]> {
/** The family list: the hall's front door and every game but this one. */
export interface Family {
hall: string;
games: FamilyGame[];
}
export async function loadFamily(self: string): Promise<Family> {
try {
const res = await fetch('/family.json', { cache: 'no-cache' });
if (!res.ok) return [];
const data = (await res.json()) as { games?: FamilyGame[] };
return (data.games ?? []).filter((g) => g.slug !== self);
if (!res.ok) return { hall: '', games: [] };
const data = (await res.json()) as { hall?: string; games?: FamilyGame[] };
return { hall: data.hall ?? '', games: (data.games ?? []).filter((g) => g.slug !== self) };
} catch {
return [];
return { hall: '', games: [] };
}
}
+9
View File
@@ -1,5 +1,6 @@
{
"family": "Kestrel's Hall",
"hall": "https://gamehall.kestrelsnest.social",
"games": [
{
"slug": "wizwar",
@@ -16,6 +17,14 @@
"pitch": "Duelling wizards. Two hands each. The right run of gestures is a spell.",
"players": "2 to 12",
"origin": "Richard Bartle's pencil-and-paper duel, 1977"
},
{
"slug": "hnefatafl",
"name": "Hnefatafl",
"url": "https://tafl.kestrelsnest.social",
"pitch": "The Viking board game. One king, one throne, four corners, and a ring of attackers closing in.",
"players": "2",
"origin": "the Norse tafl game, reconstructed from Linnaeus's 1732 notes; Copenhagen rules or Tablut"
}
]
}