Skip to content

Fix essay hand-in/monitor bugs, dark-mode UI issues, and add student password login#246

Merged
NesiciCoding merged 3 commits into
mainfrom
claude/jolly-chatterjee-c379a1
Jul 1, 2026
Merged

Fix essay hand-in/monitor bugs, dark-mode UI issues, and add student password login#246
NesiciCoding merged 3 commits into
mainfrom
claude/jolly-chatterjee-c379a1

Conversation

@NesiciCoding

Copy link
Copy Markdown
Owner

Summary

Fixes several reported student-facing bugs and adds an alternative student login method.

Root-caused bugs:

  • Essay draft autosave crashed repeatedly on QuotaExceededError (unhandled, spamming logs) — now caught silently, draft save just skipped that cycle.
  • "Assignment not found" on submit + broken live monitor — the real cause: the "assign to whole class" flow reuses one teacherKey across many students, but essay_assignments rows are 1:1 with a teacherKey server-side, and nothing ever pushed those rows to Supabase. DB credentials are now only embedded into a link when a save path actually exists; single-student assignments auto-save to Supabase before their link becomes shareable (previously required a separate, easy-to-skip "Save to DB" click); the now-permanently-broken "Monitor" link is hidden for bulk-assigned groups instead of dead-ending.
  • Dark-mode <select> dropdowns rendered black-on-black — missing color-scheme meant native option popups ignored the app's theme colors regardless of our CSS.
  • Essay editor's "A4 page view" was unreadable in dark mode (reported as "typing doesn't work") — its backdrop used theme CSS vars while the text color stayed hardcoded dark, producing invisible dark-on-dark text. Now always renders as a light page, consistent with the rest of that editor's chrome.
  • Large font size in a table cell forced the table wider than its column; that overflow was silently clipped by the editor's own rounded-corner container. Fixed by letting the table wrapper scroll internally instead.
  • Table-insert throttled (300ms) so an autoclicker can't cause runaway insertions/flicker.
  • Default theme changed from dark to light.

New feature — student password login:

  • New set-student-password edge function lets a teacher set/reset a student's login password via the Supabase admin API, scoped to their own roster (verified against owner_id).
  • Students page: a key-icon action generates a password for one student; a new "Generate password slips" action does it for a whole class at once, rendered as a printable slip sheet reusing the same look/mechanics as the existing essay slip sheet (2/4-column print layout, QR code, per-student error handling for partial failures).
  • Landing page: new "Student login (password)" option alongside existing OAuth/OTP, for schools where OTP email delivery is unreliable.
  • README, in-app docs, and i18n (all 5 locales) updated accordingly.

Test plan

  • npm run typecheck — clean
  • npm run lint — 0 errors, only pre-existing warnings
  • Full test suite passes (two full-suite-only a11y/timeout flakes reproduced regardless of these changes; both pass cleanly in isolation)
  • Verified live in browser: dark-mode dropdown contrast, A4 page-mode text visibility, table-overflow containment, and the new password-login form's wiring
  • Deployed set-student-password to a real self-hosted Supabase instance and confirmed end-to-end (401 on missing auth, ready for real use)

🤖 Generated with Claude Code

…tudent password login

Root causes and fixes:
- Essay draft autosave crashed on QuotaExceededError, spamming logs — now caught silently.
- "Assignment not found" on submit + broken live monitor: the "assign to whole class"
  flow reused one teacherKey across many students, but essay_assignments rows are 1:1
  server-side, and nothing ever pushed those rows to Supabase. DB credentials are now
  only embedded when a save path actually exists, single-student assignments auto-save
  before their link is shareable, and the now-nonfunctional Monitor link is hidden for
  bulk-assigned groups.
- Dark-mode dropdowns were black-on-black — missing `color-scheme` meant native option
  popups ignored our theme colors.
- Essay editor's "A4 page view" was unreadable in dark mode (looked like typing didn't
  work) — its backdrop used theme vars while text stayed hardcoded dark; now always
  renders as a light page, consistent with the rest of that editor's chrome.
- Large font size in a table cell forced the table wider than its column, silently
  clipped by the editor's own rounded-corner container — now scrolls within the table
  instead.
- Table-insert throttled to survive an autoclicker without visible flicker.
- Default theme changed to light.

New feature: student password login (alternative to unreliable OTP email)
- New set-student-password edge function lets a teacher set/reset a student's login
  password via the Supabase admin API, scoped to their own roster.
- Students page: a key-icon action generates a password for one student, or a new
  "Generate password slips" action does it for a whole class at once — rendered as a
  printable slip sheet matching the existing essay slip-sheet's look and mechanics.
- Landing page: new "Student login (password)" option alongside OAuth/OTP.
- Docs, README, and i18n (all 5 locales) updated to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@NesiciCoding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2c9b68ce-55de-4c17-bbad-ee7ed3f57562

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6439b and 19004c3.

📒 Files selected for processing (24)
  • README.md
  • src/components/Editor/EssayEditor.tsx
  • src/components/Essay/EssayAssignmentModal.tsx
  • src/components/Students/StudentPasswordSlipSheet.tsx
  • src/components/auth/LoginButtons.tsx
  • src/context/AppContext.tsx
  • src/index.css
  • src/locales/de.json
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/fr.json
  • src/locales/nl.json
  • src/pages/ActivityDashboardPage.tsx
  • src/pages/DocsPage.tsx
  • src/pages/EssayBuilderPage.tsx
  • src/pages/LandingPage.tsx
  • src/pages/StudentEssayPage.tsx
  • src/pages/StudentsPage.tsx
  • src/services/database/StorageSync.ts
  • src/services/database/SupabaseAdapter.ts
  • src/store/storage.test.ts
  • src/store/storage.ts
  • src/utils/studentPassword.ts
  • supabase/functions/set-student-password/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/jolly-chatterjee-c379a1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/utils/studentPassword.ts Fixed
NesiciCoding and others added 2 commits July 1, 2026 14:39
CI's format:check failed on these two files from the previous commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CodeQL flagged chars[byte % chars.length] as biased since 256 isn't a
multiple of the 56-character alphabet. Switched to rejection sampling:
bytes >= the largest multiple of 56 that fits in a byte are discarded
and redrawn, so every character is equally likely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.42% (🎯 65%) 7089 / 9925
🔵 Statements 69.66% (🎯 65%) 8077 / 11594
🔵 Functions 62.91% (🎯 60%) 2529 / 4020
🔵 Branches 61.82% (🎯 58%) 5868 / 9492
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/Students/StudentPasswordSlipSheet.tsx 0% 0% 0% 0% 21-180
src/components/auth/LoginButtons.tsx 79.41% 78.75% 80.64% 79.34% 96-111, 325-360
src/context/AppContext.tsx 57.32% 39.85% 51.69% 58.72% 154, 205-224, 270-286, 336, 374, 377, 389, 392, 425, 467, 475, 488, 495-501, 519-624, 629, 807-826, 840, 867-874, 931-932, 942-1010, 1018, 1022-1026, 1027-1028, 1034-1040, 1056-1081, 1094-1122, 1152-1153, 1184-1185, 1204, 1262, 1376, 1388-1391, 1395, 1398, 1401, 1404, 1407, 1411, 1415, 1420, 1424-1425, 1428-1429, 1432-1433, 1436-1437, 1443-1462, 1469-1470, 1474, 1478-1482, 1488, 1492-1499, 1503, 1506, 1508, 1512, 1516, 1520, 1523, 1524, 1526, 1530, 1533, 1537-1538, 1542-1543, 1548-1550, 1556, 1560, 1564, 1568-1571, 1577-1591, 1602, 1604, 1607, 1610, 1613, 1614, 1616, 1620, 1625-1636, 1758
src/pages/ActivityDashboardPage.tsx 36.36% 26.19% 31.81% 39.82% 59-60, 73-96, 107, 108, 135-162, 168-182, 208-301, 452-456, 518-522, 576-642, 658-693
src/pages/DocsPage.tsx 100% 100% 100% 100%
src/pages/EssayBuilderPage.tsx 50.79% 62.76% 39.21% 50.87% 84, 113-131, 139, 148-152, 159-172, 183, 201-319, 363, 421-436, 462-515
src/pages/LandingPage.tsx 69.69% 82.75% 84.61% 68.75% 173-180, 336, 365
src/pages/StudentsPage.tsx 57.22% 51.75% 48.66% 58.22% 59, 71, 78-79, 87-88, 104, 118, 171-173, 189-201, 251, 253, 259, 297, 301, 303-320, 331-334, 349-361, 391-408, 441, 502, 601-604, 633-649, 682-684, 740-751, 861, 874-877, 910-931, 962-963, 982-983, 1008-1319, 1325, 1357, 1376-1380, 1387-1433, 1437
src/store/storage.ts 86.66% 76.25% 88.88% 84.97% 444, 448, 452, 456, 460, 470, 474, 478, 482, 486, 490, 494, 499, 503, 507, 514-516, 520, 524, 528, 535-540, 544, 551-553, 557, 574-578, 680
src/utils/studentPassword.ts 22.22% 0% 0% 25% 10-17
Generated in workflow #712 for commit 19004c3 by the Vitest Coverage Report Action

@NesiciCoding NesiciCoding merged commit a5f89a3 into main Jul 1, 2026
8 checks passed
@NesiciCoding NesiciCoding deleted the claude/jolly-chatterjee-c379a1 branch July 1, 2026 13:40
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.

2 participants