You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(widgets): stop rendering missing data as if it were real (#568)
Three widget states presented absent data as a value a teacher could act
on, plus three adjacent defects found while fixing them.
A student with no `profiles.full_name` rendered as a slice of their user
id — `u-008` in the name column, `U-` in the avatar. That is not a name,
identifies nobody, and reads as corrupted data. `student_name: null` is a
normal value (fetchProfileNames drops blanks), so the fallback now goes
through a shared `resources/shared/student-display.ts`: "Unnamed student"
in a muted italic that reads as a placeholder, and a neutral avatar glyph
instead of letters derived from an id. `submission-grader` had the same
`student_id.slice(0, 8)` fallback; `exam-submissions` declared
`student_name` non-nullable while its tool sends null, so a nameless
student rendered as an empty cell.
The roster showed "1 exam" beside an em dash — the same glyph it uses for
"no data" elsewhere — so an ungraded submission read as an exam scored
nothing. It now reads "Ungraded". That state was also unreachable from
real data: `exam_count` was incremented only `if (score != null)`, which
made an ungraded submission vanish entirely and the student read as "0
exams". The aggregation is extracted as `aggregateExamSubmissions()` and
now counts every submission while averaging only the graded ones.
The course dashboard blamed a filter for every empty result, including
the first-run case where no filter exists, the chips have collapsed to a
lone "All", and the teacher is offered no way forward. It now branches:
no courses at all (first-run copy plus a create-course action, chips
hidden), no courses of a server-filtered status, a chip that matched
nothing, and a page past the end of the list. That last case is newly
reachable because `lms_list_courses` was reporting a hardcoded
`total: 0` on an empty page, discarding the real count — which would have
shown a teacher with courses the "create your first course" screen.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSGmz5frZqzbpQXJxxuqTs
0 commit comments