fix(ui): F8-04b lobby — auto-expand first available games sub + hide empty invitations #64
Reference in New Issue
Block a user
Delete Branch "feature/lobby-default-expand-and-empty-invitations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up nits on F8-04b spotted post-merge.
Summary
lobbyresolver (lobby-screen.svelte) used to redirect unconditionally togames-recruitment. Now it awaits the lobby fan-out + account fetch, then hands off to the samefirstVisibleGamesScreenhelper the sidebar uses — so a fresh entry with games in the roster lands onactive-past, whilerecruitmentstays the deterministic canonical fallback.games-invitationswas unconditionally visible in the sidebar. Now hidden when the pending-invites list is empty (mirroring theactive-pastrule). The lobby shell's auto-kick effect treats invitations symmetrically: accepting / declining the last invite routes the player to the next visible sub-page once the fan-out has resolved.acceptInvitereorders its writes tosetMyGames-before-removeInvitation, so both mutations land in the same microtask and the auto-kick sees the freshly added game already inmyGames— without it the player would bounce throughrecruitmentfor one frame before settling onactive-past.The visibility predicates and canonical order moved to
src/lib/lobby-nav.ts(pure helper) so the sidebar and the resolver share a single source of truth.Test plan
cd ui/frontend && npm test— 814 passed (11 new inlobby-nav.test.ts).cd ui/frontend && npm run check— clean.cd ui/frontend && npm run build— clean.ui-test.yamlon gitea — pending.active-past(notrecruitment);invitationssidebar item appears only when there is at least one pending invite.Doc sync
ui/docs/lobby.mdupdated:invitationsvisibility rule + first-visible resolver path now describe the new behavior.