Skip to content

Hide outcome row until a game outcome exists (player-vs-bot and player-vs-player)#784

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/pvb-hide-outcome-field
Closed

Hide outcome row until a game outcome exists (player-vs-bot and player-vs-player)#784
Copilot wants to merge 3 commits into
masterfrom
copilot/pvb-hide-outcome-field

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The Outcome field in the player-vs-bot game info box was always shown, even while a game was in progress with no outcome yet (displaying a placeholder --). This mirrors the behavior already implemented for player-vs-player.

Changes

  • player_vs_bot.html: Added id="info-outcome-row" and style="display: none" to the Outcome <tr>, hiding it by default (consistent with the page's variant row).
  • player-vs-bot-page.js: #updateOutcomeLabel() now tracks whether a real outcome exists (canceled, win, loss, or draw) and toggles the row visibility. As this runs on game load and every outcome update, the row appears reactively once the game finishes.
  • player_vs_player_game.html: Defined the outcome row's hidden default inline via style="display: none", consistent with the player-vs-bot row.
  • player-vs-player.css: Removed the now-redundant tr#outcome-row rule, since the hidden default is defined in the template. The existing JS toggle continues to show the row only once an outcome is known.
  • changelog.html: Added an entry for this change.
this.#infoOutcomeLabel.innerText = label;
this.#infoOutcomeRow.style.display = hasOutcome ? '' : 'none';

Copilot AI linked an issue Jun 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Hide outcome field when no outcome is present Hide player-vs-bot outcome row until a game outcome exists Jun 9, 2026
Copilot AI requested a review from benckx June 9, 2026 13:22
Copilot finished work on behalf of benckx June 9, 2026 13:22

@benckx benckx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot same for player_vs_player games

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot same for player_vs_player games

Done in 0f5b869's follow-up commit. The pvp outcome row now defines its hidden default inline in player_vs_player_game.html (matching the pvb row) instead of relying on the shared CSS rule; the existing JS already shows it only once an outcome is known.

Copilot AI changed the title Hide player-vs-bot outcome row until a game outcome exists Hide outcome row until a game outcome exists (player-vs-bot and player-vs-player) Jun 9, 2026
Copilot finished work on behalf of benckx June 9, 2026 19:08
Copilot AI requested a review from benckx June 9, 2026 19:08
<td class="values"><span id="info-variant"></span></td>
</tr>
<tr>
<tr id="info-outcome-row" style="display: none">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot should the display none be in the css?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The player_vs_bot.html page doesn't load a dedicated CSS stylesheet, and it already uses inline style="display: none" for the analogous info-variant-row (line 53) and the actions box (line 68). So keeping it inline here is consistent with the existing page convention. I left it as-is, but happy to introduce a player-vs-bot.css (mirroring player-vs-player.css) and move these rules there if you'd prefer the CSS approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pvb hide outcome field as long as there is no outcome

2 participants