Skip reveal phase and freeze titles after suggestions

This commit is contained in:
2026-02-04 22:06:43 +01:00
parent 0f6a0fb35a
commit 90bcde6f36
8 changed files with 13 additions and 44 deletions

View File

@@ -72,7 +72,6 @@ export function renderPhasePill() {
);
const viewMap = {
Suggest: "suggest-view",
Reveal: "reveal-view",
Vote: "vote-view",
Results: "results-view",
};
@@ -120,9 +119,7 @@ export function renderAllSuggestions() {
if (!list) return;
list.innerHTML = "";
const allowEdit = !!state.me?.isAdmin;
const allowDelete =
!!state.me?.isAdmin &&
(state.phase === "Reveal" || state.phase === "Suggest");
const allowDelete = !!state.me?.isAdmin;
state.allSuggestions.forEach((s) =>
list.appendChild(
buildCard(s, { showAuthor: true, allowEdit, allowDelete }),
@@ -269,15 +266,8 @@ function buildResultMeta(r) {
}
export function renderPhaseTitles() {
const revealTitle = $("reveal-title");
const voteTitle = $("vote-title");
const totalGames = state.allSuggestions?.length ?? 0;
if (revealTitle) {
revealTitle.textContent =
totalGames > 0
? t("section.allSuggestions.count", { count: totalGames })
: t("section.allSuggestions");
}
if (voteTitle) {
voteTitle.textContent =
totalGames > 0
@@ -726,7 +716,6 @@ export function updatePhaseNav() {
};
showNav("nav-suggest", phase === "Suggest");
showNav("nav-reveal", phase === "Reveal");
showNav("nav-vote", phase === "Vote");
const lockBadge = $("results-lock");
@@ -737,7 +726,7 @@ export function updatePhaseNav() {
}
// Toggle admin-only back buttons
const backButtons = ["nav-reveal-prev", "nav-vote-prev"];
const backButtons = ["nav-vote-prev"];
backButtons.forEach((id) => {
const btn = $(id);
if (btn) btn.classList.toggle("hidden", !isAdmin);