diff --git a/components/chat/ChatLobby.vue b/components/chat/ChatLobby.vue index 0d5b2705..2c0c73cc 100644 --- a/components/chat/ChatLobby.vue +++ b/components/chat/ChatLobby.vue @@ -353,6 +353,10 @@ export default { type: Object as PropType, required: false, }, + disableAutoFocusOnActivate: { + type: Boolean, + default: false, + }, }, data() { return { @@ -604,23 +608,25 @@ export default { } // When activating a tab, always jump to the bottom so the latest - // messages are immediately visible. + // messages are immediately visible, and optionally focus the input. if (active && !this.isMinimized) { this.safeScrollToBottom(true); - this.$nextTick(() => { - const chatInput = this.$refs.chatInputRef as any; - if (chatInput) { - if (typeof chatInput.focus === "function") { - chatInput.focus(); - } else if (chatInput.$el) { - // Fallback: try to focus the first input inside the component root. - const el = chatInput.$el.querySelector( - "input, textarea, [tabindex]", - ) as HTMLElement | null; - el?.focus(); + if (!this.disableAutoFocusOnActivate) { + this.$nextTick(() => { + const chatInput = this.$refs.chatInputRef as any; + if (chatInput) { + if (typeof chatInput.focus === "function") { + chatInput.focus(); + } else if (chatInput.$el) { + // Fallback: try to focus the first input inside the component root. + const el = chatInput.$el.querySelector( + "input, textarea, [tabindex]", + ) as HTMLElement | null; + el?.focus(); + } } - } - }); + }); + } } }, }, diff --git a/components/chat/ChatMessage.vue b/components/chat/ChatMessage.vue index 6660bf0d..94249666 100644 --- a/components/chat/ChatMessage.vue +++ b/components/chat/ChatMessage.vue @@ -4,43 +4,48 @@ import PlayerDisplay from "~/components/PlayerDisplay.vue"; @@ -75,6 +80,9 @@ export default { return previousTimestamp > messageTimestamp; }, + showMeta() { + return !this.isSameSender || !this.isCloseTogether; + }, }, }; diff --git a/components/hub/ChatPanel.vue b/components/hub/ChatPanel.vue index 96a1e5f2..e915d262 100644 --- a/components/hub/ChatPanel.vue +++ b/components/hub/ChatPanel.vue @@ -1,5 +1,6 @@