Skip to main content

Diary

A class teacher writes a short summary of the day's lessons / homework / announcements for one or more sections. The entry shows up on the student's diary page (date-bucketed, with a calendar) and the parent's diary timeline (date-chip filter). Parents also get a push notification when a new entry lands.

At a glance

Who can do thisTeachers create and edit entries (only their own sections) · Students read entries for their section · Parents read entries for each linked child's section
Where it livesTeacher app /dashboard/diary (today + history) · /diary/create (compose / edit) · Student app /dashboard/diary (with calendar) · Parent app /diary (date-chip timeline)
Triggers notifications?Yes — push + in-app to all parents of every targeted section on publish
Related featuresHomework · Notice Board & Alerts · Notifications

How it flows

Status lifecycle

There is no Draft state. The teacher app only persists once the teacher hits Publish — clicking back before Publish loses the in-progress text.

Step-by-step

1. Teacher dashboard view

  • Route: Teacher app → /dashboard/diary
  • Top of page: Today's entry card.
    • If today has no entry yet: shows a "Create today's entry" prompt → /diary/create.
    • If an entry exists: shows the summary + Edit button.
  • Below: History — infinite-scroll list of past entries, with date-range filter and search (debounced 500 ms) over summary text.
  • Each card carries: section label, date, summary preview, Edit / Delete on owner cards.

2. Composing an entry

  • Route: /diary/create (also used for edit; carries editingEntry via location state).
  • Form fields:
    • Select Class — multi-select chips of every section the teacher is assigned to. At least one required.
    • Daily summary — TipTap rich-text editor. Empty (after stripping HTML) is rejected with "Please select at least one section and enter a summary".
  • Date is fixed to today (entries are not back-dated from the form).
  • Submit creates one entry per selected section in a single tap (so the same summary can land in 5-A and 5-B).

3. Publish & notify

  • On submit, every targeted section's parents receive a push notification.
  • The entry is immediately visible on the student dashboard for that section.
  • Toast confirms "Diary entry published successfully!" (or "updated" on edit).

4. Editing & deletion

  • Editing is allowed for the same-day entry only (UI surfaces an Edit button on today's card and on history cards owned by the teacher).
  • Deleting an entry triggers a confirmation, then removes from all readers' feeds. (Past parent push notifications remain — they no longer deep-link to anything; tapping shows an empty state.)

5. Student view

  • Route: Student app → /dashboard/diary
  • Layout:
    • Horizontal date strip (±14 days around today) — tap a date to filter entries.
    • Calendar dialog — full-month calendar with dots on dates that have entries.
    • Today entries are highlighted; missing dates render a gentle empty state.
  • Pagination: infinite scroll (20 per page).
  • A student only ever sees entries for their own current section.

6. Parent view

  • Route: Parent app → /diary
  • Date-chip header (15 days, today centered + scrolled into view) and an All filter chip.
  • Each entry card carries: date label (TODAY / YESTERDAY / explicit date), section, summary, time of post, attachments (if any).
  • Multi-child parents: page is contextual to the currently selected child (passed via studentProfileId in nav state, or auto-resolved from the first linked student on profile fetch).

7. Cross-feature ties

  • Homework: a diary entry often references a homework drop — the homework record itself is created separately through Homework so submission tracking works.
  • Notice Board: diary is a daily class summary and is distinct from typed alerts. Use a General Notice for school-wide info.

Edge cases & things to test

  • Multi-section publish: teacher selects 5-A and 5-B — confirm two distinct entries are created (one per section), and parents in each section receive their own push.
  • Empty summary: rich-text editor with only HTML tags (e.g. <p></p>) — strip-then-validate must block submit.
  • Editing yesterday's entry: should the edit button appear on past-day cards? Document behavior.
  • Section reassignment: teacher loses a section assignment after publishing yesterday's entry — they should lose ability to edit it; existing readers continue to see it.
  • Student moves section: student moves from 5-A5-B mid-term — older 5-A diary entries should disappear from their feed (or document if they linger).
  • Multi-child parent: parent with kids in 3-A and 7-C — switching child context should refresh the timeline, not mix sections.
  • Calendar day with multiple entries: section was split across two teachers and both posted today — student calendar dot should still indicate "has entry"; tapping shows both.
  • Push tap deep-link: tap a "new diary" push on parent app — should land on /diary with the relevant date selected.
  • No sections assigned: teacher with zero sections opens /diary/create — selector empty state shows "No sections assigned"; submit blocked.
  • Long summary: paste a 5 000-char summary — rich-text editor must accept; readers should not break layout (truncate / expand).
  • Concurrent edit + delete: teacher edits while another tab deletes — second action should fail gracefully.
  • Filter/search persistence: search "homework", scroll for older results, navigate away and back — does the search query reset? (Per current behavior, the diary list resets on remount.)