Skip to content

Add instructor filter to Report + auto-set display name on login#166

Merged
ChristopherRotnes merged 7 commits into
masterfrom
claude/clarify-session-reports-visibility-ceio8
May 13, 2026
Merged

Add instructor filter to Report + auto-set display name on login#166
ChristopherRotnes merged 7 commits into
masterfrom
claude/clarify-session-reports-visibility-ceio8

Conversation

@ChristopherRotnes
Copy link
Copy Markdown
Owner

@ChristopherRotnes ChristopherRotnes commented May 13, 2026

$(cat <<'EOF'

Summary

  • Report page gains a fourth filter chip row listing instructor display names, shown only when sessions from more than one co-instructor exist in the selected period. Default is all instructors (empty selection = no filter), consistent with the existing weekday and session-type pattern.
  • fetchSessionsForReport now joins trainer_id and profiles(display_name) so instructor identity is available without an extra query.
  • ensureDisplayName() added to db.js and called alongside ensureGymMembership() on every login. If profiles.display_name is null it is set automatically to the prefix before @ in the user's email — ensures the instructor filter always has a meaningful label without requiring manual action in Settings. Falls back to "Unnamed" in the filter if somehow still null.

Test plan

  • Log in — verify profiles.display_name is populated (check Settings → Konto or Supabase dashboard)
  • Report page with only your own sessions: instructor filter row should not appear
  • Report page when a co-instructor has sessions in the same period: instructor row appears with both names as chips
  • Selecting an instructor chip filters KPIs, heatmap, frequency table, and recommendations to that instructor's sessions only
  • Reset filter clears instructor selection alongside days/types
  • Existing filter behaviour (period, weekday, session type) unchanged

https://claude.ai/code/session_01Ks23ragnyERfPjjqHpfyjp
EOF
)


Generated by Claude Code

claude added 3 commits May 13, 2026 18:03
- fetchSessionsForReport now joins trainer_id + profiles(display_name)
- Report shows a 4th filter chip row (instructor names) when >1 instructor
  present in the period; empty selection = all instructors (default)
- Reset filter clears instructor selection alongside days/types
- ensureDisplayName() sets profiles.display_name to email prefix on first
  login if not yet set, ensuring the filter always has a meaningful label
- Docs updated: CHANGELOG, README, CLAUDE.md

https://claude.ai/code/session_01Ks23ragnyERfPjjqHpfyjp
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-166.westeurope.7.azurestaticapps.net

claude-opus-4-5 has been retired by Anthropic; updated CLAUDE_MODEL_VISION
in prompts.js and the model allowlist + test in claudeUtils.js to use
claude-opus-4-7.

https://claude.ai/code/session_01Ks23ragnyERfPjjqHpfyjp
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-166.westeurope.7.azurestaticapps.net

OCR + structured JSON extraction from whiteboard photos doesn't require
Opus-level reasoning. Both CLAUDE_MODEL_VISION and CLAUDE_MODEL_TEXT now
use claude-sonnet-4-6; allowlist reduced to a single entry.

https://claude.ai/code/session_01Ks23ragnyERfPjjqHpfyjp
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-166.westeurope.7.azurestaticapps.net

When Anthropic returns a non-OK response, include the actual error
message as a 'detail' field in the JSON body. Server logs now include
the error type and message. The UI reads data?.error?.message which is
unaffected by this shape, so users still see the generic Serverfeil
message — detail is visible only in the network tab for developers.

https://claude.ai/code/session_01Ks23ragnyERfPjjqHpfyjp
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-166.westeurope.7.azurestaticapps.net

…lossary

- Report instructor filter now derives from gym_calendar.instructor (the
  sporty.no class leader e.g. "Linda Hatlevik") instead of trainer_id
  (the app user who logged the session) — these are entirely different
  concepts; the previous implementation produced a filter that never
  showed more than one entry for a single-user account
- fetchSessionsForReport: removed trainer_id + profiles join, added
  instructor to gym_calendar select
- CSP: added sha256 hash for inline theme script to script-src so the
  FOUC-prevention script is no longer blocked
- i18n: added report.unnamed key to all three locales (was hardcoded
  "Unnamed" in English only)
- CLAUDE.md: added Glossary section defining User, Trainer (avoid),
  Instructor, Co-instructor, Session, Gym class, Exercise variants,
  Template, Muscle concepts, and System concepts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-166.westeurope.7.azurestaticapps.net

@ChristopherRotnes ChristopherRotnes marked this pull request as ready for review May 13, 2026 20:12
@ChristopherRotnes ChristopherRotnes merged commit a7f8660 into master May 13, 2026
1 check passed
@ChristopherRotnes ChristopherRotnes deleted the claude/clarify-session-reports-visibility-ceio8 branch May 13, 2026 20:13
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.

2 participants