Skip to content

BUG "The Movie Was" & "The Artist Was" reveal boxes persist into subsequent rounds #523

@maxlin1

Description

@maxlin1

Summary

Two related UI bugs on the reveal screen: content from challenge rounds (Movie Challenge and Artist Challenge) remains permanently visible in subsequent rounds, even when the next song has no film score or artist challenge at all.


Bug 1 — "The Movie Was" box persists after a movie soundtrack round

Steps to Reproduce

  1. Play the Movies – 100 Greatest Themes playlist (or any playlist with movie challenge songs)
  2. A round plays → Reveal correctly shows the box "🎬 The movie was: Titanic"
  3. Admin clicks Next Round → the next song is a regular song with no movie challenge
  4. → The "The movie was" box stays visible, still showing the movie title from the previous round

Expected Behavior

The #movie-reveal-section card is hidden when the reveal data for the current round contains no movie_challenge.


Bug 2 — "The Artist Was" box persists after an artist challenge round

Identical behavior: after a round with an Artist Challenge, the section "🎤 The artist was: …" remains visible in all subsequent rounds that have no artist challenge.

Steps to Reproduce

  1. Play any playlist with Artist Challenge enabled
  2. A round plays → Reveal correctly shows "🎤 The artist was: …"
  3. Admin clicks Next Round → next song has no artist challenge
  4. → The "The artist was" box stays visible from the previous round

Root Cause (Code Analysis)

In player-reveal.js (lines 113–119), renderArtistReveal() and renderMovieReveal() are only called when the challenge data is present. There is no else branch to explicitly hide the sections for rounds without a challenge:

// player-reveal.js — CURRENT (buggy)
if (data.artist_challenge) {
    renderArtistReveal(data.artist_challenge, state.playerName);
}
// ❌ No else → artist-reveal-section stays visible from previous round

if (data.movie_challenge) {
    renderMovieReveal(data.movie_challenge, state.playerName);
}
// ❌ No else → movie-reveal-section stays visible from previous round

Both renderMovieReveal() and renderArtistReveal() in player-game.js already handle null correctly — they hide the section when called with no data:

// player-game.js — renderMovieReveal() handles null correctly...
export function renderMovieReveal(movieChallenge, currentPlayerName) {
    var section = document.getElementById('movie-reveal-section');
    if (!section) return;

    if (!movieChallenge || !movieChallenge.correct_movie) {
        section.classList.add('hidden'); // ✅ logic is correct...
        return;
    }
    // ...but this is never reached because the function is never called with null
}

The same applies to renderArtistReveal() (player-game.js, line 940).


Additional Note: resetSubmissionState() does not clear reveal sections

resetSubmissionState() (player-game.js, line 692) correctly calls resetArtistChallengeState() and resetMovieChallengeState(). However, those functions only clear the player input containers (artist-challenge-container, movie-challenge-container) used during the guessing phase — they do not touch the reveal sections (artist-reveal-section, movie-reveal-section).

Hiding the reveal sections must therefore happen in the reveal handler itself, as described below.


Proposed Fix

player-reveal.js — always call both render functions, passing null as fallback:

// BEFORE (buggy)
if (data.artist_challenge) {
    renderArtistReveal(data.artist_challenge, state.playerName);
}
if (data.movie_challenge) {
    renderMovieReveal(data.movie_challenge, state.playerName);
}

// AFTER (correct) — one line change per function
renderArtistReveal(data.artist_challenge || null, state.playerName);
renderMovieReveal(data.movie_challenge || null, state.playerName);

Since both render functions already handle null correctly and hide the section in that case, it is sufficient to always call them — passing null as a fallback when no challenge data is present.

Alternative — explicit else branches:

if (data.artist_challenge) {
    renderArtistReveal(data.artist_challenge, state.playerName);
} else {
    var artistSection = document.getElementById('artist-reveal-section');
    if (artistSection) artistSection.classList.add('hidden');
}

if (data.movie_challenge) {
    renderMovieReveal(data.movie_challenge, state.playerName);
} else {
    var movieSection = document.getElementById('movie-reveal-section');
    if (movieSection) movieSection.classList.add('hidden');
}

Affected Files

File Line Change
www/js/player-reveal.js 113–119 Always call renderArtistReveal and renderMovieReveal (with null fallback)

The logic inside player-game.js (renderMovieReveal, renderArtistReveal) is correct as-is and does not need to be changed.


Impact

  • Affects all players on any mixed playlist that combines movie soundtrack songs with regular songs
  • The stale box persists for the entire remainder of the game once triggered, until a new movie/artist challenge round refreshes it
  • Particularly confusing when the displayed movie/artist title has no relation to the song currently being revealed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions