Codebase audit: 8 fixes for student grading view, admin nav, auth race, analytics, settings#12
Merged
Conversation
submissionStatus 'graded' and 'grading' fell through to "Start" button, which tried to create a new attempt instead of opening the existing submission. Add badges + route them through the same submission view as submitted/late. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Filter compared item.roles against effectiveRole, but effectiveRole for an admin is always 'student' or 'staff' (per AuthContext.tsx:132-137), so admin-only items (User Management, Settings) were never shown. Admins now always see admin items based on dbUser.role. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two bugs in onAuthStateChange that bounced password-authed users to /login when they navigated directly to a deep URL: - The handler unconditionally cleared dbUser when Supabase had no session, even if a custom JWT (password login) was active. - The handler unconditionally flipped loading=false on every Supabase event, including the initial INITIAL_SESSION emitted before the custom-JWT fetchDbUser had finished. Route guards then ran with loading=false and dbUser=null and redirected. Now: only clear dbUser if there is no custom token, and let the custom-token path own setLoading(false) when it's the active session. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Top Auto-graded / Pending Review / Total Graded tiles were hardcoded 0. Add /api/auto-grade/grading-stats returning: - autoGradedThisWeek: distinct submissions with AI-assisted marks in 7d - pendingReview: submissions in submitted/grading/late status - totalGraded: submissions in 'graded' status AnalyticsTab now fetches and renders, with em-dash placeholders while loading. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Save Settings button on the per-course Settings tab popped a placeholder alert. Now it loads + persists the two toggles (auto-grade on submit, MCQ-only) via new GET/PUT /api/courses/:id/automation-settings, stored in system_settings under course-scoped keys. UI shows inline success or error feedback instead of an alert(). Field set is disabled while loading/saving. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
For MCQ-only assignments canAutoGrade is false because gradableCount==0, but missingModelAnswers is also 0 — so the warning rendered as "0 question(s) missing model answers", which is wrong and confusing. Show "No auto-gradable questions" in that branch instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both the header card and the sticky floating indicator rendered a SaveIndicator at the top of the page, so users saw "Not saved yet" twice side by side. Keep only the sticky one — it stays visible when scrolled, which is what the user needs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
seed-passwords.ts shipped with an empty seedUsers array, so db:seed-passwords was a no-op. Real seeding lives in db:seed (src/db/seed.ts), which sets up users, courses, questions, and assignments — and which this script is now removed in favor of. Removes the script, the npm task, and updates CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rothendieck-fda9a1 # Conflicts: # src/client/features/staff-grading/AssignmentAutoGradingList.tsx # src/server/routes/auto-grade/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eight independent fixes from a thorough codebase audit. Each commit is reviewed, typechecked, lint-clean, and browser-verified before commit.
6c313c3'graded'and'grading'submissions now show "View" badge + route to submission, not new attempt229c6dea9e8cf6onAuthStateChangeno longer clobbers password-login session on initial mount2a70fe8/api/auto-grade/grading-stats+ AnalyticsTab fetches real countsb4409ad/api/courses/:id/automation-settings+ SettingsTab persists per-course297219ef83a767e3a3653seed-passwords.ts, removed npm script, updated CLAUDE.mdTest plan
npx tsc -b --noEmitcleannpx eslint .cleannpm test— 441/441 passingmaininAssignmentAutoGradingList.tsxfrom in-progress feature merged separately — will resolve in this PR/staff/*URL from a fresh tab)🤖 Generated with Claude Code