Skip to content

Group teacher-attendance-reported cards by class, fix reported-hour timezone - #164

Merged
buzz-code merged 3 commits into
mainfrom
claude/teachers-attendance-timezone-fge29w
Sep 1, 2026
Merged

buzz-code merged 3 commits into
mainfrom
claude/teachers-attendance-timezone-fge29w

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Client reported two issues on the "teachers who reported attendance" screen:

  1. Missing class (כיתה) column — wanted cards organized in columns by class.
  2. Reported hour shown incorrectly — timezone issue.

Changes

  • teacher_reported_today view now also exposes klassReferenceId (view entity + migration).
  • Client groups report cards into one column per class (teacher-reported-today.jsx), sorted by class.
  • formatDate/formatHour now explicitly render in Asia/Jerusalem instead of relying on the viewer's browser/OS timezone (root cause of the wrong hour), matching the pattern already used server-side in yemot-handler.service.ts.

Testing

  • cd server && yarn build — clean
  • cd client && yarn build — clean
  • cd server && yarn test --testPathPattern=teacher-report — passing

🤖 Generated with Claude Code


Generated by Claude Code

…imezone

- teacher_reported_today view now also exposes klassReferenceId
- Client groups report cards into one column per class
- Report date/hour now always render in Israel time (Asia/Jerusalem)
  instead of the viewer's browser timezone
Copilot AI lite review requested due to automatic review settings September 1, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Current server view + client grouping can collapse multi-class data into single row/card and mis-assign cards to wrong class column due to klassReferenceId not being part of view id/grouping and card grouping key.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fix teacher-reported-today screen: add klassReferenceId to backend view, group cards by class columns, render date/hour in Asia/Jerusalem to avoid browser timezone drift.

Changes:

  • Recreate teacher_reported_today SQL view + view-entity to expose klassReferenceId.
  • Update client screen layout to columns per class.
  • Pin formatDate/formatHour formatting to Asia/Jerusalem.
File summaries
File Description
server/src/migrations/1787600000000-AddKlassToTeacherReportedTodayView.ts Updates SQL view to include class reference id
server/src/db/view-entities/TeacherReportedToday.entity.ts Adds klassReferenceId to TypeORM view entity expression + columns
client/src/entities/teacher-reported-today.jsx Groups cards into class columns + pins date/time formatting timezone
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

… filter

- teacher_reported_today view groups by klassReferenceId (not MIN()) and
  includes it in the row id, so rows for different classes on the same
  teacher/lesson/date no longer collapse or collide on id
- Client card grouping key includes klassReferenceId so cards from
  different classes never merge into one card / wrong column
- Default "today" date filter now uses Asia/Jerusalem instead of UTC,
  matching the display formatting

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

reportHour computed per teacher+date (ignores class) while UI now groups per class, so displayed hour can be wrong for given class column.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

server/src/db/view-entities/TeacherReportedToday.entity.ts:21

  • reportHour window partition ignores klassReferenceId, but client now groups cards by klassReferenceId; card hour can reflect earliest report for different class. Partition by klassReferenceId so reportHour matches same grouping dimension.
      .addSelect(
        'MIN(MIN(att_report.createdAt)) OVER (PARTITION BY att_report.userId, att_report.teacherReferenceId, att_report.reportDate)',
        'reportHour',
      )
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

- reportHour window now partitions by klassReferenceId too, so a class's
  card shows that class's own earliest report time instead of possibly
  the earliest across all of the teacher's classes that day
- Updated groupByTeacherAndDate comment to reflect klass is now part of
  the grouping key
@buzz-code
buzz-code merged commit 1808f0c into main Sep 1, 2026
4 checks passed
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.

3 participants