five-on-it / apps/client/src/ui/LobbyPage
apps/client/src/ui/LobbyPage
A lobby's page (?lobby=<id>, GAME_DESIGN §13): everything about the run its players gather for, in the open. The mission's card (its title, game, level, creator and rating, and its rules in plain words: players, teams, lives, friendly fire, joining late, the time limit), the teams' slots with each member's name, Respect tier, party, host and ready state and the places still open (and the Respect tier the mission asks for, in its rules: a join it refuses says so, #lobby-error); Join for a reader not in it, Ready, Switch team (with one's party, to a team with room), Leave, the host's Start (enabled once every team has its minimum) and Kick, the invitation (its link to copy, and the friends to invite), the countdown (and the city busy, said); while its run is under way, the way back to one's seat; after it, the results (the outcome, the winner, each seat's part, and what the run paid the reader: RespectParts.tsx' RunStandingPanel, with its endorsements and the mission's stars) and the vote on the next mission (the same, another of the game, one on another level, Replay), each offer's votes and the seconds left.
The page follows the feed (lobby.ts' followLobby): a change shows the lobby it carries (or reads it again), its run opened sends the page to the member's seat (the lobby kept in its address, so the run's results lead back here). Once the reader is no longer in it (kicked, removed as gone from the page, the lobby closed; or a later read finding it gone, or them out of it) the page says so with the way back, and nothing else (#lobby-gone). It tells the platform it is there every 15 s (presence, and the lobby read again), so a member whose page is gone is dropped. A reader who is not a member sees names and counts alone. The ids and data attributes are the end-to-end tests' contract.