Phase 6: Tournaments

Status: Active Development iOS PRs: #329 (6a), #348 (6c), #349 (6d), #350 (6d), #351 (6e), #352 (6f)


Overview

Phase 6 implements Tournament functionality for iOS, providing archers with the ability to browse, join, create, and participate in tournaments with multi-archer scoring support.


Phase 6a: Tournament List Filtering

PR: #329 | Status: Complete

Added Active/Completed tab filtering to TournamentListView:

  • Segmented picker for tab selection
  • Tab count badges
  • Per-tab empty states
  • Firebase callback pattern for production stability
  • Combine-based reactive filtering
  • Full TDD implementation (16 tests)

Guide: Tournament List Filtering Guide


Phase 6c: Tournament Creation

PR: #348 | Status: Complete

Tournament creation UI and Firebase integration.


Phase 6d: Multi-Archer Tournament Scoring

PRs: #349, #350 | Status: Complete

Complete multi-archer tournament scoring system:

  • TournamentScoringViewModel with per-participant state management
  • ParticipantTabsView for switching between archers
  • LeaderboardView with archery tie-breaking rules (Score X-count 10-count ID)
  • TournamentScoringView as main scoring interface
  • Firebase Firestore sync for scores and rankings
  • Local Round database persistence for offline-first support
  • ScoringSessionProtocol conformance for unified scoring view

Guide: Multi-Archer Scoring Guide


Phase 6e: Unified ScoringView

PR: #351 | Status: Complete

ScoringSessionProtocol enabling unified scoring interface for solo, solo+guest, and tournament modes.


Phase 6f: Guest Archers

PR: #352 | Status: Complete

Guest archer functionality for tournament scoring:

  • GuestError enum with LocalizedError conformance
  • Guest limits: maxGuestsPerParticipant = 2, maxTotalGuests = 10
  • AddGuestSheet SwiftUI form with validation
  • KMP shared code for guest ID generation
  • Firebase Firestore integration for guest persistence

Guide: Guest Archers Guide


Architecture

TournamentListView
├── TournamentListViewModel (Combine)
│   └── TournamentRepositoryProtocol
│       ├── TournamentRepositoryBridge (Firebase)
│       │   └── TournamentParser
│       └── MockTournamentRepository (Testing)
├── Segmented Picker (Active/Completed)
└── Tournament List (filtered)
    │
    ▼
TournamentDetailView
└── TournamentScoringView
    ├── TournamentScoringViewModel
    │   ├── ScoringSessionProtocol
    │   ├── ParticipantScoreState (per participant)
    │   └── LeaderboardDisplayEntry
    ├── ParticipantTabsView
    ├── AddGuestSheet (modal)
    ├── Score Entry (Buttons/Target)
    └── LeaderboardView (modal overlay)

Key Files

ComponentFilePhase
List ViewModelViewModels/TournamentListViewModel.swift6a
List ViewTournamentListView.swift6a
Scoring ViewModelViewModels/TournamentScoringViewModel.swift6d
Scoring ViewViews/TournamentScoring/TournamentScoringView.swift6d
Participant TabsViews/TournamentScoring/ParticipantTabsView.swift6d
LeaderboardViews/TournamentScoring/LeaderboardView.swift6d
Add Guest SheetViews/TournamentScoring/AddGuestSheet.swift6f
Repository BridgeDI/TournamentRepositoryBridge.swift6a
List TestsTournamentListViewModelTests.swift6a
Scoring TestsTournamentScoringViewModelTests.swift6d, 6f

Test Coverage

PhaseTestsFile
6a16TournamentListViewModelTests.swift
6d20+TournamentScoringViewModelTests.swift
6f15TournamentScoringViewModelTests.swift (Guest tests)

Platform Parity

FeatureiOSAndroid
List FilteringTournamentListViewModelTournamentListViewModel
ScoringTournamentScoringViewModelTournamentDetailsViewModel
Guest LimitsmaxGuestsPerParticipant = 2AdminSettings.maxGuestsPerParticipant
Tie-breakingScore X 10 Ends IDSame


Last Updated: 2025-12-04

3 items under this folder.