From aee83e27e5f9dcc4d0e6aaa6df0f5bdb4b1231b2 Mon Sep 17 00:00:00 2001 From: Luke Policinski Date: Fri, 23 Oct 2026 15:41:37 -0400 Subject: [PATCH 1/2] feature: friends' online status and the online count come from the api, and tabs stop holding everyone online --- components/hub/SocialPanel.vue | 47 +---- components/matchmaking-lobby/PlayersList.vue | 90 ++------ .../matchmaking/MatchmakingSettingsPanel.vue | 2 + components/play/PlayMatchmaking.vue | 4 +- graphql/messageRequests.ts | 12 -- i18n/locales/en.json | 1 + layouts/components/OnlinePlayers.vue | 4 +- layouts/components/SystemStatus.vue | 46 +++- pages/players/index.vue | 46 ---- stores/MatchmakingStore.ts | 196 ++++++++---------- stores/SearchStore.ts | 24 +-- .../components/hub/SocialPanelOthers.spec.ts | 29 +++ .../SystemStatusOnlineCount.spec.ts | 61 ++++++ tests/pages/players/playersTwitch.spec.ts | 13 +- tests/stores/friendsPresence.spec.ts | 158 ++++++++++++++ tests/stores/onlineRosterAsksOnce.spec.ts | 108 ---------- web-sockets/Socket.ts | 16 +- 17 files changed, 437 insertions(+), 420 deletions(-) create mode 100644 tests/components/hub/SocialPanelOthers.spec.ts create mode 100644 tests/layouts/components/SystemStatusOnlineCount.spec.ts create mode 100644 tests/stores/friendsPresence.spec.ts delete mode 100644 tests/stores/onlineRosterAsksOnce.spec.ts diff --git a/components/hub/SocialPanel.vue b/components/hub/SocialPanel.vue index 80775edbb..9ea10ae5c 100644 --- a/components/hub/SocialPanel.vue +++ b/components/hub/SocialPanel.vue @@ -4,42 +4,18 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs"; import PlayersList from "~/components/matchmaking-lobby/PlayersList.vue"; import HubEmptyState from "~/components/hub/HubEmptyState.vue"; import { useMatchmakingStore } from "~/stores/MatchmakingStore"; -import { useAuthStore } from "~/stores/AuthStore"; import { useInvites } from "@/composables/useInvites"; const activeTab = ref("friends"); const matchmakingStore = useMatchmakingStore(); -const authStore = useAuthStore(); const { hasSocialInvites } = useInvites(); const onlineFriends = computed(() => matchmakingStore.onlineFriends); const offlineFriends = computed(() => matchmakingStore.offlineFriends); -const otherOnlineCount = computed(() => { - const me = authStore.me; - const friends = matchmakingStore.friends; - - return matchmakingStore.playersOnline.filter((player: any) => { - if (me && String(player.steam_id) === String(me.steam_id)) { - return false; - } - - // Mirror PlayersList "Others" filter: accepted friends and incoming - // requests live in the Friends tab; outgoing requests stay here. - const entry = friends?.find( - (f: any) => String(f.steam_id) === String(player.steam_id), - ); - if (entry) { - if (entry.status !== "Pending") return false; - if (String(entry.invited_by_steam_id) !== String(me?.steam_id)) { - return false; - } - } - - return true; - }).length; -}); +// The paged list of everyone else online comes later; the tab shows the count. +const othersCount = computed(() => matchmakingStore.onlineCount);