Show suggest-phase hint until first submission
This commit is contained in:
1
SPEC.md
1
SPEC.md
@@ -19,6 +19,7 @@ Help a small Discord group (4–8 players) pick a co-op game via phased flow:
|
||||
- Name required; optional genre, description, screenshot URL, YouTube URL, external game link, min/max players
|
||||
- Players see only their own suggestions until voting
|
||||
- A player can enter Vote only after submitting at least one own suggestion
|
||||
- The Suggest phase shows a non-interactive “add a game first” hint until the first successful suggestion, then immediately shows the `Next` button
|
||||
- Screenshots validated as reachable images
|
||||
|
||||
## Vote Phase
|
||||
|
||||
@@ -173,6 +173,10 @@ button .chip {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-hint {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.warning-text {
|
||||
color: #b23b3b;
|
||||
font-weight: 600;
|
||||
|
||||
@@ -183,6 +183,7 @@ Warte auf die Abstimmungsphase und bitte bei Bedarf um einen Joker.
|
||||
### „Füge mindestens einen Vorschlag hinzu, bevor du in die Abstimmungsphase wechselst."
|
||||
|
||||
Füge mit deinem aktuellen Konto mindestens einen Spielvorschlag hinzu. Erst dann kannst du von der Vorschlagsphase in die Abstimmungsphase wechseln. Diesese Verhalten erschwert die Abgabe von mehreren Stimmen pro Benutzer.
|
||||
Bis dahin zeigt die Navigation in der Vorschlagsphase einen Hinweis statt eines Weiter-Buttons und wechselt direkt nach der ersten erfolgreichen Einreichung.
|
||||
|
||||
### „Ungültiger Admin-Schlüssel."
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ Wait for the Vote phase and request a joker if needed.
|
||||
### "Add at least one suggestion before entering the Vote phase."
|
||||
|
||||
Add at least one game suggestion with your current account. Only then can you move from Suggest to Vote. This behavior hinders the submission of multiple votes per user.
|
||||
Until then, the Suggest navigation shows a hint instead of a Next button, and switches immediately after your first successful submission.
|
||||
|
||||
### "Invalid admin key."
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
<p data-i18n="nav.freezeHint">Moving forward will freeze your suggestions. Titles become locked; only extra details stay editable.</p>
|
||||
</div>
|
||||
<div class="nav-actions">
|
||||
<span id="nav-suggest-hint" class="muted nav-hint" data-i18n="nav.addSuggestionFirst">Add a game first</span>
|
||||
<button id="nav-suggest-next" class="primary" data-i18n="nav.next">Next</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@ export async function loadSuggestData() {
|
||||
if (state.phase !== "Suggest") return;
|
||||
state.mySuggestions = await api.mySuggestions();
|
||||
renderMySuggestions();
|
||||
updatePhaseNav();
|
||||
}
|
||||
|
||||
export async function loadSuggestionsData() {
|
||||
|
||||
@@ -249,14 +249,16 @@ export function updatePhaseNav() {
|
||||
});
|
||||
|
||||
const suggestNext = $("nav-suggest-next");
|
||||
const suggestHint = $("nav-suggest-hint");
|
||||
if (suggestNext) {
|
||||
const hasSuggestions = (state.mySuggestions?.length ?? 0) > 0;
|
||||
const needsSuggestion = phase === "Suggest" && !hasSuggestions;
|
||||
suggestNext.disabled = needsSuggestion;
|
||||
suggestNext.classList.toggle("needs-suggestion", needsSuggestion);
|
||||
suggestNext.textContent = needsSuggestion
|
||||
? t("nav.addSuggestionFirst")
|
||||
: t("nav.next");
|
||||
suggestNext.classList.toggle("hidden", needsSuggestion);
|
||||
suggestNext.textContent = t("nav.next");
|
||||
if (suggestHint) {
|
||||
suggestHint.classList.toggle("hidden", !needsSuggestion);
|
||||
suggestHint.textContent = t("nav.addSuggestionFirst");
|
||||
}
|
||||
}
|
||||
|
||||
const voteNext = $("nav-vote-next");
|
||||
|
||||
Reference in New Issue
Block a user