Add Coach mode: dark-chrome shell, mode switcher, C1 Today, C2 Bench attendance

First slice of the coach-mode build (design_handoff_rosterchief_platform/
README.md's "Coach mode" section, C1-C6). Ships the foundation together with
the two screens the design doc calls out as the reason coaches install
anything at all, rather than landing a Today screen with a dead "Check
attendance" button:

- mobile/coach_mixins.py's CoachScopeMixin -- the dark-mode mirror of
  PersonScopeMixin, scoped by active team (via club.services.access'
  teams_staffed_by/teams_managed_by) instead of managed people.
- A standalone dark ink/ice shell (mobile/templates/mobile/coach/base.html)
  with the mode's signature 20px-radius overlapping sheet, reusing the
  --color-ice/--color-ink tokens that already existed in assets/mobile.css
  but were unconsumed until now.
- The Coach/Member role switcher is re-added to the member shell, gated on
  a real staff assignment (has_coach_access), replacing the "deliberately
  not rendered yet" placeholder.
- C1 Today: stat tiles, a tonight's-session card, a silent-players "needs
  you" row, and an "Also yours" card reusing HomeView's own hero-RSVP
  pattern scoped to the coach's own member record.
- C2 Bench attendance: writes through events.services.attendance.
  record_check_in, which existed for exactly this and had no caller yet.
  Read-only for staff on a team without a management position.

Line-up (C3), create event (C4), post news (C5), and add-to-roster (C6)
follow in later stages -- see the coach-mode plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
2026-08-21 22:21:25 +02:00
parent 9fbcc89646
commit 6a9a6204ed
12 changed files with 873 additions and 6 deletions

View File

@@ -445,4 +445,49 @@
color: #fff;
border-radius: var(--radius-box);
}
/* --- Coach mode shell (C1-C6) ---------------------------------------------------
Dark-chrome mirror of the member .app-header/.tab-bar pair above. .coach-sheet is
the mode's signature: a light body that overlaps the ink header by 20px via a
matching negative margin, so the header appears to sit "behind" a rounded sheet
rather than the two stacking edge-to-edge like the member shell's navy header does. */
.coach-header {
padding: max(env(safe-area-inset-top), 14px) 16px 14px;
background: var(--color-ink);
color: #fff;
flex-shrink: 0;
}
.coach-sheet {
background: var(--color-paper);
border-radius: 20px 20px 0 0;
margin-top: -20px;
position: relative;
flex: 1;
overflow-y: auto;
}
.coach-tab-bar {
flex-shrink: 0;
background: var(--color-ink);
border-top: 1px solid var(--color-hairline);
padding: 8px 8px max(env(safe-area-inset-bottom), 26px);
display: flex;
}
.coach-tab-bar-item {
flex: 1;
height: 48px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 3px;
color: var(--color-on-dark);
}
.coach-tab-bar-item-active {
color: var(--color-ice);
}
}