Skip to content

Add "מעקב חיסורים" absence tracking page - #208

Merged
buzz-code merged 3 commits into
mainfrom
claude/eloquent-ramanujan-f0e3jz
Oct 7, 2026
Merged

buzz-code merged 3 commits into
mainfrom
claude/eloquent-ramanujan-f0e3jz

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Feedback: the teachers-reported report is clear and easy to read, the student attendance pivot is hard to use. This adds a separate page, מעקב חיסורים (/student/absence-tracking, in the reports menu next to the pivot), in the same visual language. The existing pivot is unchanged.

  • Card per base class (כיתת אם), worst class first; a row per student, highest absence rate first.
  • Threshold typed by the user (percent, default 20, remembered in the browser).
  • Per student: colored absence % (unapproved / all lessons), how many absences are left until the threshold (or how far over), a bar with a threshold tick, and chips for subjects with absences.
  • Summary tiles: students, over threshold, near threshold (1–3 absences left), overall rate. Over/near tiles filter the list.
  • Per class: the subject whose absence rate stands out against the class's overall rate (≥1.5×, minimum lessons/absences).
  • Click a student: per-subject lessons/absences/% from att_report, last absence dates, and a link to all her reports.
  • Loads one page like the pivot (100 students by default, with pagination). When more students exist than shown, a note says the summary covers the shown students and suggests choosing a class.

Server change

StudentAttendance pivot now also sends lessons per subject as lessons_<lessonId>, without a header, so the pivot table and its export are unchanged (covered by a spec assertion). Needed for the per-class subject rate.

Testing

  • Client: unit tests for the threshold/grouping/rate helpers, and a render test of the page with a mocked data provider. All client (225) and server (1171) tests pass; vite build passes.
  • Browser (Playwright) against a local server + MySQL seeded with 1,050 students in 21 classes of 50, ~57k reports:
    • Classes grouped by base class (track classes not shown as cards).
    • Over-threshold counts at 20% and 10% match a direct SQL calculation, per class and in total.
    • Drill-down lessons/absences equal the row's numbers (with and without approved absences).
    • Typed threshold and tile filtering work; no horizontal scroll at 400px.
    • Load: one class ≈ 2.9s, first page of the whole school ≈ 5s, next page ≈ 2.4s. One pivot request per page in the production build (the double request seen in dev is React StrictMode).
    • Filters persist when leaving/returning and on reload, separately from the old pivot.

Notes

  • Subject chips and the class subject rate include approved absences (the pivot has no per-subject approved count); the threshold uses unapproved absences only.
  • The drill-down does not apply the "class type" and "excluded lessons" filters.
  • React warnings in the console come from existing shared components (ShowMatchingRecordsButton, CommonReferenceInputFilter).

🤖 Generated with Claude Code

https://claude.ai/code/session_01T5Hdg7cKavdUKRf9T4FPnP


Generated by Claude Code

claude added 3 commits October 7, 2026 19:36
…t per student

New client-only page (/student/absence-tracking, menu: מעקב חיסורים) built on
the existing StudentAttendance pivot, kept separate from the pivot table.
Fetches all pivot pages, groups students by base class, shows how many
unapproved absences each student has left before a user-typed threshold,
summary tiles that filter over/near students, the subject behind most of a
class's absences, and a per-student drill-down from att_report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5Hdg7cKavdUKRf9T4FPnP
- StudentAttendance pivot also sends lessons per subject (lessons_<id>), with
  no header, so the existing pivot table and export are unchanged.
- The class insight now picks the subject with the highest absence rate
  against the class's overall rate, instead of the most absences.
- Pages load in parallel and show as they arrive with a progress bar; each
  page shows only with its base classes, so students never flash under
  "no class". Page 1's classes load before the other pages start.
- Clickable tiles use CardActionArea; row text says "לא מאושרים".

Verified in a browser against a local server with 600 students / 32k
reports: class grouping, threshold counts (match SQL), and drill-down
totals matching the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5Hdg7cKavdUKRf9T4FPnP
Loading the whole school (1,050 students, 11 pivot pages) took ~26s, so the
page now loads only the current page (100 students by default) with the
usual pagination, like the existing pivot table. When there are more
students than shown, a note says the summary covers the shown students
only and suggests choosing a class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5Hdg7cKavdUKRf9T4FPnP
@buzz-code
buzz-code merged commit efac25b into main Oct 7, 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.

2 participants