navbar: GATE VIEW swaps for CONT GAME on room pages (page-room) → room gate-view — TDD

Phase 0 of the room GATE VIEW + seat-renewal sprint. Mirrors the my-sea
treatment: on any room page the self-referential CONT GAME is replaced
by a GATE VIEW button that opens the room's renewal gate-view.

- `room_view` page_class → "page-gameboard page-room"; the bare gameboard
  listing stays "page-gameboard" (no page-room) so CONT GAME persists
  there for returning to a recent room.
- `_navbar.html` GATE VIEW branch fires on `page-my-sea` OR `page-room`;
  onclick routes, in precedence: page-room → epic:room_gate (room in
  context); my-sea-visit → visitor gate; else owner's sea gate. One
  consolidated branch (DRY) instead of two near-identical button blocks.

Tests: RoomNavbarGateViewTest (4) — room page shows GATE VIEW not CONT
GAME, links to room_gate, gate-view page also shows it, page-room marker
present. 826 epic+gameboard ITs green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-31 23:11:05 -04:00
parent 516b917420
commit 65689295a7
3 changed files with 55 additions and 15 deletions

View File

@@ -449,7 +449,11 @@ def room_view(request, room_id):
room = Room.objects.get(id=room_id)
ctx = _role_select_context(room, request.user)
ctx["room"] = room
ctx["page_class"] = "page-gameboard"
# `page-room` drives the navbar GATE VIEW swap (mirrors my-sea's
# `page-my-sea`) so the table page reaches the renewal gate-view instead
# of a self-referential CONT GAME. The bare gameboard listing stays
# `page-gameboard` (no page-room) → keeps CONT GAME.
ctx["page_class"] = "page-gameboard page-room"
# Reversal-rate hint label under DRAW SEA's SPREAD select — same helper as
# sea_partial so the value tracks any future per-user override automatically.
ctx["stack_reversal_pct"] = int(round(stack_reversal_probability(request.user, room) * 100))