Skip to content

Keep multiplayer chat entries pinned at top of room history across question transitions - #577

Draft
geoffrey-wu with Copilot wants to merge 8 commits into
mainfrom
copilot/multiplayer-keep-chat-messages-top
Draft

Keep multiplayer chat entries pinned at top of room history across question transitions#577
geoffrey-wu with Copilot wants to merge 8 commits into
mainfrom
copilot/multiplayer-keep-chat-messages-top

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Multiplayer room history was reordering chat downward as gameplay events and next-question cards were added. This updates history rendering so chat stays visually pinned at the top even when progressing through tossups/bonuses.

  • History ordering behavior

    • Introduced a moveChatMessagesToTop() helper in MultiplayerTossupBonusClient.
    • Reorders existing .chat-message nodes to the top of #room-history while preserving their relative order.
  • Where reordering is applied

    • After tossup history card insertion (endCurrentTossup).
    • After bonus history card insertion (endCurrentBonus).
    • After event log insertion (logEventConditionally).
    • After live/final answer log updates (logGiveAnswer).
  • Minimal surface area

    • Change is isolated to multiplayer client-side history rendering (client/play/mp/MultiplayerTossupBonusClient.js); no protocol or server behavior changes.
function moveChatMessagesToTop () {
  const roomHistory = document.getElementById('room-history');
  const chatMessages = Array.from(roomHistory.getElementsByClassName('chat-message'));
  chatMessages.reverse().forEach(chatMessage => {
    roomHistory.prepend(chatMessage);
  });
}

Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Copilot AI changed the title [WIP] Update chat messages to stay at the top while changing questions Keep multiplayer chat entries pinned at top of room history across question transitions Sep 11, 2026
Copilot AI requested a review from geoffrey-wu September 11, 2026 01:43
geoffrey-wu and others added 6 commits September 10, 2026 23:40
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.

/multiplayer: Keep chat messages at the top, even when moving to the next question

2 participants