Skip to content

feat(dashboard): show mini timetable strip per teacher in assign modal#111

Merged
guangshinhaha merged 1 commit into
feat/fix-back-to-back-consecutivefrom
feat/timetable-strip-modal
Apr 27, 2026
Merged

feat(dashboard): show mini timetable strip per teacher in assign modal#111
guangshinhaha merged 1 commit into
feat/fix-back-to-back-consecutivefrom
feat/timetable-strip-modal

Conversation

@guangshinhaha
Copy link
Copy Markdown
Collaborator

Summary

Adds a compact horizontal timetable strip below each candidate teacher's name in the relief assignment modal. Shows the teacher's full-day schedule at a glance:

  • Blue = teaching (hover shows subject + class)
  • Amber = already covering another relief slot
  • Orange + ring = the period being assigned
  • Gray = free

Scannable in < 2 seconds — designed for KPs working at 6:45am.

Stacked on #110 (fix back-to-back).

Changes

File What
src/app/api/dashboard/route.ts Enriched allEntriesForDay with className/subject/period; added schoolPeriods query; buildDaySchedule() helper
DashboardContent.tsx New TeacherPeriodSlot type, daySchedule on AvailableTeacher
AssignReliefModal.tsx Same type update; timetable strip rendered inline with flex blocks + tooltips

Research evidence

All 3 schools flagged this as the #1 confidence gap — "I need to see if the teacher is already loaded before assigning."

Closes #67

Test plan

  • npm test — 278 tests pass
  • npm run build — 45/45 static pages, zero errors
  • Visual test in browser: verify strip renders, colors correct, tooltips show, target period highlighted

🤖 Generated with Claude Code

Every school interviewed said they want to see a teacher's daily
schedule before assigning relief — the #1 confidence gap in the current
UX. This adds a compact horizontal strip below each candidate's name
in the assign modal showing their full-day timetable at a glance.

Visual: colored blocks per period
- Blue = teaching (hover shows subject + class)
- Amber-light = already covering another relief slot
- Orange/highlighted = the period being assigned (ring indicator)
- Gray = free period

Data pipeline:
- API: enriched allEntriesForDay query with className/subject/period
  number; new schoolPeriods query; buildDaySchedule() helper combines
  timetable + existing relief into per-teacher schedule
- Types: new TeacherPeriodSlot type, daySchedule field on
  AvailableTeacher in both DashboardContent and AssignReliefModal
- Modal: inline strip rendered with flex blocks, hover tooltips,
  and ring indicator on the target period

Scannable in < 2 seconds as KPs work at 6:45am.

Closes #67

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
relief-teacher-planning Ready Ready Preview, Comment Apr 27, 2026 1:33am

@guangshinhaha guangshinhaha merged commit effb76b into feat/fix-back-to-back-consecutive Apr 27, 2026
2 checks passed
guangshinhaha added a commit that referenced this pull request Apr 30, 2026
…ional gauge (#145)

The previous mini-strip (PR #111) crammed every period into an equal-width
flex-1 block with no labels and no time anchors, so admins couldn't tell
which period was which without hovering — and the target slot's amber
treatment competed with the relief amber. The PR also shipped without
visual verification.

Redesign:
- Periods are now positioned + sized proportionally to their actual minutes,
  so a 60-min lesson is visibly wider than a 30-min one and recess gaps
  appear as gaps, not absorbed.
- A single shared hour-tick gauge sits above the teacher list (24h ticks
  aligned to every strip below) with an inline legend.
- Target slot is a faint primary-tinted highlight column, not a colored
  block — every listed teacher is free at the target slot by construction,
  so coloring it was redundant. The column anchors the eye to *where* in
  the day the absent slot sits.
- Strip moved to its own line under the row header so periods get the
  full row width instead of being squeezed next to the badge.

Plumbing: Period.startTime/endTime are now selected on the dashboard
route and threaded through buildTeacherDaySchedule into each
TeacherPeriodSlot as startMinute/endMinute.
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.

1 participant