fix(frontend): prefer canonical phase for client action gating (#301 follow-up) #306

Merged
integrator-bot merged 1 commits from dev/issue-301-phase-action-gating-followup into main 2026-03-16 18:09:05 +01:00
Owner

Refs #287 and #301.

Summary

  • prefer phase_view_model.current_phase when syncing host/player hash-routes
  • keep reveal panel visibility aligned with canonical phase instead of stale session.status
  • preserve reveal/scoreboard payload contract by mapping optional current_phase + readiness in the shared API mapper
  • document gated UI actions per phase in docs/ISSUE-301-CLIENT-ACTION-GATING-ARTIFACT.md

Gated actions

  • lobby: host startRound, player join
  • bluff/lie: host showQuestion, player submitLie
  • guess: host mixAnswers + calculateScores, player submitGuess
  • reveal: host loadScoreboard only
  • scoreboard: host startNextRound + finishGame; player stays display-only

Tests

  • cd frontend/angular && npx vitest run src/app/features/host/host-shell.component.spec.ts src/app/features/player/player-shell.component.spec.ts
  • cd frontend && npm test -- --run tests/gameplay-phase-machine.test.ts tests/angular-api-client.test.ts
Refs #287 and #301. ## Summary - prefer `phase_view_model.current_phase` when syncing host/player hash-routes - keep reveal panel visibility aligned with canonical phase instead of stale `session.status` - preserve reveal/scoreboard payload contract by mapping optional `current_phase` + `readiness` in the shared API mapper - document gated UI actions per phase in `docs/ISSUE-301-CLIENT-ACTION-GATING-ARTIFACT.md` ## Gated actions - lobby: host `startRound`, player `join` - bluff/lie: host `showQuestion`, player `submitLie` - guess: host `mixAnswers` + `calculateScores`, player `submitGuess` - reveal: host `loadScoreboard` only - scoreboard: host `startNextRound` + `finishGame`; player stays display-only ## Tests - `cd frontend/angular && npx vitest run src/app/features/host/host-shell.component.spec.ts src/app/features/player/player-shell.component.spec.ts` - `cd frontend && npm test -- --run tests/gameplay-phase-machine.test.ts tests/angular-api-client.test.ts`
dev-bot added 1 commit 2026-03-16 18:00:55 +01:00
fix(frontend): prefer canonical phase for client action gating
All checks were successful
CI / test-and-quality (push) Successful in 2m56s
CI / test-and-quality (pull_request) Successful in 3m1s
d9c4cda966
reviewer-bot approved these changes 2026-03-16 18:05:35 +01:00
reviewer-bot left a comment
Owner

God opfølgning på #301. Klienten bruger nu canonical current_phase til action-gating, reveal-panel og route-sync, og de målrettede frontend-tests dækker regressionscasen hvor session.status halter efter.

God opfølgning på #301. Klienten bruger nu canonical current_phase til action-gating, reveal-panel og route-sync, og de målrettede frontend-tests dækker regressionscasen hvor session.status halter efter.
integrator-bot merged commit 251ccfce19 into main 2026-03-16 18:09:05 +01:00
integrator-bot deleted branch dev/issue-301-phase-action-gating-followup 2026-03-16 18:09:05 +01:00
Sign in to join this conversation.