Rebuild the Expeditions page around one guided journey: one card, no roles, leave alone or open to a group, follow the trip, keep a Journal

An expedition now opens with a single card. Its creator leaves alone right away, or opens it to the Guild board with an invite link and launches it whenever they want; at the end of recruitment it leaves by itself, alone or as a group, and is never dissolved for lack of players. Stars no longer depend on the number of players, a player has one expedition at a time, and roles are gone: each card brings its stats and a team adds them up, so every requirement is its per-slot share times the number of slots.

The page follows the player's path: the offered destination card is revealed once in a modal, then Préparer shows the destinations (stat requirements, condition and dangers coloured for the chosen card, loot effects), a frame with the sent card in large size, its equipment slots and stats, and the duration and departure. Cards and commons are chosen in modals with sorts and highlighted current picks; tags get matching colours on the card and on equipment synergies. Once gone, the trip is shown with a progress bar and moving cards, the loot opens in a modal, and finished expeditions move to a Journal tab with the Grimoire.

Power commons get short power names of their own and show their exact effects on hover, a card holds one power at a time, and Coup de folie now draws the real requirements between 80 % and 130 % of the shown ones, revealed on return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-17 17:10:56 +01:00
parent d70ae51265
commit 3720fd01f7
41 changed files with 1807 additions and 894 deletions

View file

@ -1856,7 +1856,7 @@ test("a player finds the daily card with hints and copies the result", async ({
});
// Dernier parcours : il ouvre les Expéditions et décale l'horloge du serveur, deux réglages globaux qu'il remet en place à la fin.
test("an administrator opens expeditions and a player sends a team, then claims its loot", async ({ browser, page }) => {
test("an administrator opens expeditions and a player leaves alone, follows the journey, then claims its loot", async ({ browser, page }) => {
const clockFile = join(tmpdir(), "sokkog-cards-e2e-clock.json");
const setServerClock = (offsetMs) => writeFile(clockFile, JSON.stringify({ offsetMs }));
await setServerClock(0);
@ -1871,7 +1871,7 @@ test("an administrator opens expeditions and a player sends a team, then claims
await status.getByRole("button", { name: "Ouvrir les Expéditions", exact: true }).click();
await page.getByRole("dialog").getByRole("button", { name: "Ouvrir", exact: true }).click();
await expect(status).toContainText("Ouvertes aux joueurs");
await expect(page.getByRole("region", { name: "Destinations", exact: true }).getByRole("listitem")).toHaveCount(15);
await expect(page.getByRole("region", { name: "Destinations", exact: true }).getByRole("listitem")).toHaveCount(16);
// Le prix d'un Éclat n'est plus dans les réglages des Expéditions : il se règle dans la Boutique.
await page.getByRole("tab", { name: "Cartes", exact: true }).click();
await expect(page.getByRole("region", { name: "Améliorations", exact: true })).not.toContainText("Éclat d’étoile en boutique");
@ -1886,7 +1886,7 @@ test("an administrator opens expeditions and a player sends a team, then claims
await expect(applyBar).toHaveCount(0);
await expect(perDay).toHaveValue("4");
// Le partenaire possède deux légendaires distinctes : de quoi partir en solo.
// Le partenaire possède deux légendaires distinctes : une suffit pour partir.
const { token } = JSON.parse(await readFile(join(tmpdir(), "sokkog-cards-e2e-partner.json"), "utf8"));
const partnerContext = await browser.newContext({ baseURL: "http://127.0.0.1:4180", viewport: { width: 1280, height: 900 } });
await partnerContext.addCookies([{ name: "__Host-sokkog_cards_session", value: token, domain: "127.0.0.1", path: "/", secure: true, httpOnly: true, sameSite: "Lax" }]);
@ -1901,57 +1901,76 @@ test("an administrator opens expeditions and a player sends a team, then claims
const destinations = partner.getByRole("region", { name: "1. Destination du jour" }).getByRole("button");
await expect(destinations).toHaveCount(4);
await expect(destinations.first()).toHaveAttribute("aria-pressed", "true");
// La difficulté est tirée avec les destinations : une de chaque niveau, 1 à 4 étoiles en solo. On prend la plus facile.
// La difficulté est tirée avec les destinations : une de chaque niveau, 1 à 4 étoiles, seul ou en groupe. On prend la plus facile.
for (const stars of ["1 étoile", "2 étoiles", "3 étoiles", "4 étoiles"]) await expect(destinations.filter({ has: partner.getByRole("img", { name: `Difficulté : ${stars}`, exact: true }) })).toHaveCount(1);
await destinations.filter({ has: partner.getByRole("img", { name: "Difficulté : 1 étoile", exact: true }) }).click();
const settings = partner.getByRole("region", { name: "2. Durée et exigences" });
await expect(settings.getByRole("img", { name: "Difficulté : 1 étoile", exact: true })).toBeVisible();
const easiest = destinations.filter({ has: partner.getByRole("img", { name: "Difficulté : 1 étoile", exact: true }) });
await easiest.click();
// Chaque destination montre ses exigences pour une carte seule, une étoile sur la stat principale.
await expect(easiest.locator(".nebula-destination-requirement[data-main] .nebula-main-stat-mark")).toHaveCount(1);
await expect(easiest.locator(".nebula-destination-requirement[data-met]")).toHaveCount(0);
// Une seule carte, avec son rôle ; plus de choix entre solo et groupe.
await expect(partner.getByRole("group", { name: "Mode" })).toHaveCount(0);
const team = partner.getByRole("region", { name: "2. Votre carte" });
// La carte se choisit dans une fenêtre, depuis l'emplacement vide du cadre.
await team.getByRole("button", { name: "Choisir une carte", exact: true }).click();
const picker = partner.getByRole("dialog", { name: "Choisir la carte envoyée" });
await picker.getByRole("group", { name: "Trier par" }).getByRole("button", { name: "Puissance", exact: true }).click();
await picker.getByRole("button", { name: /^Choisir Loup des Aurores$/ }).click();
await expect(picker).toHaveCount(0);
// La carte choisie : ses stats pour l'expédition et son équipement ; les exigences se colorent selon elle.
await expect(team.locator(".nebula-expedition-loadout")).toContainText("Loup des Aurores");
await expect(team.locator(".nebula-expedition-loadout").getByRole("list", { name: "Équipements", exact: true }).getByRole("listitem")).toHaveCount(3);
await expect(easiest.locator(".nebula-destination-requirement[data-met]")).toHaveCount(1);
const settings = partner.getByRole("region", { name: "3. Durée et départ" });
await settings.getByRole("button", { name: "2 h", exact: true }).click();
const team = partner.getByRole("region", { name: "3. Équipe" });
await team.getByRole("button", { name: /^Placer Loup des Aurores en / }).click();
await team.getByRole("button", { name: /^Placer Dragon du Néant Étoilé en / }).first().click();
const preview = partner.getByRole("region", { name: "4. Aperçu" });
await expect(preview).toContainText(/Butin attendu : environ [\d,]+ Éclats/);
await expect(preview.locator(".nebula-expedition-preview .nds-badge").first()).toHaveText(/^(Retour difficile|Réussite|Triomphe)$/);
await preview.getByRole("button", { name: "Partir en expédition", exact: true }).click();
await expect(partner.getByRole("status").filter({ hasText: "Expédition lancée !" })).toBeVisible();
const report = partner.locator(".nebula-expedition-report").first();
await expect(report).toContainText(/En route, retour dans (1 h|2 h)/);
await expect(partner.getByText("Récupérez le butin de votre expédition avant d’en lancer une autre.")).toBeVisible();
await expect(settings).toContainText(/Butin attendu : environ [\d,]+ Éclats/);
await expect(settings.locator(".nebula-expedition-preview .nds-badge").first()).toHaveText(/^(Retour difficile|Réussite|Triomphe)$/);
await settings.getByRole("button", { name: "Partir seul maintenant", exact: true }).click();
await expect(partner.getByRole("status").filter({ hasText: "Expédition partie !" })).toBeVisible();
// En route : la préparation laisse place au voyage, avec sa barre de progression et les cartes parties.
const journey = partner.locator(".nebula-expedition-journey");
await expect(journey).toContainText(/En route, retour dans (1 h|2 h)/);
await expect(journey.getByRole("progressbar", { name: "Progression du voyage" })).toBeVisible();
await expect(journey.locator(".nebula-expedition-caravan li")).toHaveCount(1);
await expect(partner.getByRole("region", { name: "1. Destination du jour" })).toHaveCount(0);
// En demi-écran, la page reste sans défilement horizontal.
await partner.setViewportSize({ width: 768, height: 900 });
expect(await partner.locator(".nebula-expeditions").evaluate((element) => element.scrollWidth - element.clientWidth)).toBe(0);
await partner.setViewportSize({ width: 1280, height: 900 });
// Trois heures plus tard pour le serveur : l'expédition est revenue, son butin se récupère une fois.
// Trois heures plus tard pour le serveur : l'expédition est revenue, son butin se récupère une fois et s'affiche dans une fenêtre.
await setServerClock(3 * 3_600_000);
await partner.reload();
const report = partner.locator(".nebula-expedition-report").first();
await expect(report).toContainText("De retour ! Le butin vous attend.");
await report.getByRole("button", { name: "Récupérer le butin", exact: true }).click();
await expect(partner.getByRole("status").filter({ hasText: "Butin récupéré !" })).toBeVisible();
await expect(report).toContainText("Butin récupéré.");
await expect(report.locator(".nebula-expedition-rewards .nds-badge").filter({ hasText: /^\+[\d\s]+ Éclats$/ })).toBeVisible();
const claimed = partner.getByRole("dialog", { name: "Butin rapporté" });
await expect(claimed.locator(".nebula-expedition-rewards .nds-badge").filter({ hasText: /^\+[\d\s]+ Éclats$/ })).toBeVisible();
await claimed.getByRole("button", { name: "Préparer la suivante", exact: true }).click();
await expect(partner.locator(".nebula-expeditions .nds-section-heading .nds-badge")).not.toHaveText("0 Éclats d’étoile");
// En groupe : le partenaire ouvre un groupe, qui attend un second joueur sur le tableau, puis le dissout.
await partner.getByRole("group", { name: "Mode" }).getByRole("button", { name: "En groupe", exact: true }).click();
await partner.getByRole("region", { name: "3. Équipe" }).getByRole("button", { name: /^Placer Loup des Aurores en / }).click();
await expect(partner.getByRole("region", { name: "4. Aperçu" })).toContainText(/Butin attendu : environ/);
await partner.getByRole("button", { name: "Ouvrir le groupe", exact: true }).click();
await expect(partner.getByRole("status").filter({ hasText: "Groupe ouvert !" })).toBeVisible();
const board = partner.getByRole("region", { name: "Tableau des groupes" });
const groupCard = board.locator(".nebula-expedition-group");
await expect(groupCard).toHaveCount(1);
// L'expédition terminée passe au Journal, avec le Grimoire.
await partner.getByRole("tab", { name: "Journal (1)", exact: true }).click();
await expect(partner.getByRole("region", { name: "Expéditions terminées", exact: true }).locator(".nebula-expedition-report")).toContainText("Butin récupéré.");
await expect(partner.getByRole("region", { name: /^Grimoire/ })).toContainText("Les paires de lore");
await partner.getByRole("tab", { name: "Préparer", exact: true }).click();
// Ouverte au groupe, l'expédition attend d'autres joueurs, avec son lien d'invitation ; son créateur peut l'annuler.
await partner.getByRole("region", { name: "2. Votre carte" }).getByRole("button", { name: "Choisir une carte", exact: true }).click();
await partner.getByRole("dialog", { name: "Choisir la carte envoyée" }).getByRole("button", { name: /^Choisir Loup des Aurores$/ }).click();
await expect(partner.getByRole("region", { name: "3. Durée et départ" })).toContainText(/Butin attendu : environ/);
await partner.getByRole("button", { name: "Ouvrir au groupe", exact: true }).click();
await expect(partner.getByRole("status").filter({ hasText: "Expédition ouverte !" })).toBeVisible();
const mine = partner.getByRole("region", { name: "Votre expédition en préparation" });
const groupCard = mine.locator(".nebula-expedition-group");
await expect(groupCard).toContainText("ouvert par vous");
await expect(groupCard.locator(".nebula-expedition-group-free")).toHaveCount(3);
await expect(groupCard.getByRole("button", { name: "Lancer l’expédition", exact: true })).toBeDisabled();
await expect(groupCard).toContainText("Il faut au moins 2 joueurs pour partir.");
await groupCard.getByRole("button", { name: "Dissoudre le groupe", exact: true }).click();
await expect(groupCard).toHaveCount(0);
await expect(board).toContainText("Aucun groupe ouvert pour le moment");
await expect(groupCard.getByRole("textbox", { name: /^Lien d’invitation/ })).toHaveValue(/#\/cards\/expeditions\/[\w-]+$/);
await groupCard.getByRole("button", { name: "Annuler l’expédition", exact: true }).click();
await expect(mine).toHaveCount(0);
await expect(partner.getByRole("region", { name: "1. Destination du jour" })).toBeVisible();
// Pont des Veilleurs, en boutique : 3 poussières pour 1 Éclat ; la fiche de carte montre le niveau, la Puissance et l'expérience gagnée au retour.
await expect(partner.getByRole("region", { name: /^Grimoire/ })).toContainText("Les paires de lore");
await expect(partner.getByRole("region", { name: "Sac du Veilleur", exact: true })).toBeVisible();
await expect(partner.getByRole("form", { name: "Éclats d’étoile" })).toHaveCount(0);
await partner.goto("/#/cards/shop");