Skip to content

Commit 8119efe

Browse files
fix(widgets): stop rendering missing data as if it were real (#568) (#575)
* 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 * docs(qa): before/after widget evidence for #568 Screenshots and A/B GIFs backing PR #575. Kept on the branch rather than master so the PR carries its own evidence; safe to drop before merge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSGmz5frZqzbpQXJxxuqTs --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8bb844b commit 8119efe

20 files changed

Lines changed: 348 additions & 44 deletions
20.3 KB
Loading

docs/qa/568/ab-roster-dark.gif

70.4 KB
Loading
19.1 KB
Loading
22 KB
Loading
18.3 KB
Loading
46.3 KB
Loading

docs/qa/568/after-roster-dark.png

101 KB
Loading
109 KB
Loading

docs/qa/568/after-roster-light.png

96.2 KB
Loading
11.2 KB
Loading

0 commit comments

Comments
 (0)