fix(lobby): mark past journeys with solo/MP mode icon#167
Merged
Conversation
The past-journeys list showed solo and multiplayer saves with no visual distinction — a misclick risk in MP context (sq-playtest 2026-04-26 [BUG-LOW]). Adds a per-row mode badge: ◈ solo, ⚑ multiplayer, ◇ unknown (legacy entries pre 2026-04-24 that lack the mode field). The unknown glyph is intentional rather than defaulting to solo, so an unknown row visually differs from a known solo row instead of silently misleading. Helps Alex (slow reader, MP context) see at-a-glance which session a row belongs to before clicking. Aria-label + title give screen-reader users the same signal. modeBadge() lives in its own file to keep the React Fast Refresh boundary component-only (react-refresh/only-export-components). Tests: - JourneyHistory.test.tsx: unit test for the per-row badge + a direct test of the modeBadge mapping function - past-journeys-mode-icon-wiring.test.tsx: wiring test that mounts the full ConnectScreen and asserts all three badge variants survive the production render path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Past-journeys list in the lobby showed solo and multiplayer saves with no visual distinction — a real misclick risk in MP context. Adds a per-row mode badge so a glance is enough to tell what a row is before clicking.
Reported in
sq-playtest-pingpong.md2026-04-26 —[BUG-LOW] Past Journeys list mixes solo + MP saves with no visual distinction.Changes
src/screens/lobby/modeBadge.ts(new) — Pure mappingmode -> { glyph, label }. Lives in its own module so the React Fast Refresh boundary onJourneyHistory.tsxstays component-only.src/screens/lobby/JourneyHistory.tsx— Per-row badge rendered inline before the player name.data-modeattribute exposes the mode for tests;aria-label+titlegive screen-reader users the same signal.src/screens/lobby/__tests__/JourneyHistory.test.tsx— Unit tests for the per-row badge + direct test ofmodeBadge()mapping.src/screens/__tests__/past-journeys-mode-icon-wiring.test.tsx(new) — Wiring test (per CLAUDE.md "Every Test Suite Needs a Wiring Test") that mounts the fullConnectScreenand asserts all three badge variants survive the production render path.Glyph choices + judgment calls
◈solo,⚑multiplayer (matches the report's suggested fix exactly).◇(hollow diamond) for unknown — pre-2026-04-24 entries lack themodefield. I chose to render a distinct "unknown" glyph rather than defaulting to solo, because silently displaying a solo icon for what might be an MP save would recreate the very misclick risk this fix addresses.Test plan
npx vitest run src/screens/lobby/__tests__/JourneyHistory.test.tsx src/screens/__tests__/past-journeys-mode-icon-wiring.test.tsx— 9/9 passnpx vitest run src/screens/lobby/__tests__/ src/screens/__tests__/ConnectScreen.test.tsx— 70/70 pass (no regressions in neighboring suites)npx eslinton touched files — clean