Skip to content

teacher-reported-today: sort cards by reportHour ascending - #181

Merged
buzz-code merged 1 commit into
mainfrom
claude/teacher-reported-order-fix
Sep 5, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/teacher-reported-order-fix

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Cards on the "teachers who reported attendance" screen weren't ordered as expected — the earlier report should show first, not last.

Root cause

Sort was { field: 'reportDate', order: 'DESC' }. reportDate is the same value for every row in the default "today" filter, so this sort was a no-op — actual card order fell back to whatever incidental order the underlying view query returned.

Change

Sort by reportHour ascending instead (the real per-report timestamp), so the earliest report of the day shows first.

Testing

  • cd client && yarn build — clean
  • cd client && yarn test — 31/32 suites passing (1 pre-existing skip, unrelated)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn


Generated by Claude Code

Cards were sorted by reportDate DESC, which is a no-op within a single
day (the default filter view) since every row shares the same date -
actual card order fell back to whatever order the view query happened
to return. Sort by reportHour ascending instead, so the earliest report
of the day shows first.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeX6BFe7P4pHLPm3VwFjPn
Copilot AI lite review requested due to automatic review settings September 5, 2026 19:15

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.

🟢 Approval recommended

Change aligns with view field semantics (reportHour exists, used in UI) and fixes ordering bug with minimal, low-risk diff.

Pull request overview

Fix card ordering on teacher_reported_today list so earliest report shows first for default “today” filter.

Changes:

  • Switch React-Admin list sort from reportDate DESC to reportHour ASC
  • Keep sort consistent in both custom List component and entity config
File summaries
File Description
client/src/entities/teacher-reported-today.jsx Change list default sort to reportHour ascending so card order matches report time
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@buzz-code
buzz-code merged commit 18c46e5 into main Sep 5, 2026
5 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