Skip to content

fix(lobby): mark past journeys with solo/MP mode icon#167

Merged
slabgorb merged 1 commit intodevelopfrom
fix/past-journeys-mode-icon
Apr 26, 2026
Merged

fix(lobby): mark past journeys with solo/MP mode icon#167
slabgorb merged 1 commit intodevelopfrom
fix/past-journeys-mode-icon

Conversation

@slabgorb
Copy link
Copy Markdown
Owner

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.md 2026-04-26 — [BUG-LOW] Past Journeys list mixes solo + MP saves with no visual distinction.

Changes

  • src/screens/lobby/modeBadge.ts (new) — Pure mapping mode -> { glyph, label }. Lives in its own module so the React Fast Refresh boundary on JourneyHistory.tsx stays component-only.
  • src/screens/lobby/JourneyHistory.tsx — Per-row badge rendered inline before the player name. data-mode attribute exposes the mode for tests; aria-label + title give screen-reader users the same signal.
  • src/screens/lobby/__tests__/JourneyHistory.test.tsx — Unit tests for the per-row badge + direct test of modeBadge() 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 full ConnectScreen and 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 the mode field. 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.
  • Icon over filter: Per the report's hint, the icon approach is less surprising and shows all data — and it is the right call for Alex (slow reader, freezes under pressure per CLAUDE.md), who benefits from a visible mode signal that does not hide rows.

Test plan

  • npx vitest run src/screens/lobby/__tests__/JourneyHistory.test.tsx src/screens/__tests__/past-journeys-mode-icon-wiring.test.tsx — 9/9 pass
  • npx vitest run src/screens/lobby/__tests__/ src/screens/__tests__/ConnectScreen.test.tsx — 70/70 pass (no regressions in neighboring suites)
  • npx eslint on touched files — clean

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
@slabgorb slabgorb merged commit 90656da into develop Apr 26, 2026
1 check failed
@slabgorb slabgorb deleted the fix/past-journeys-mode-icon branch April 26, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant