Skip to content

tailwind v2 migration: settings, leaderboard, stats#621

Closed
kokonut121 wants to merge 3 commits into
masterfrom
tailwind-batch2-rest
Closed

tailwind v2 migration: settings, leaderboard, stats#621
kokonut121 wants to merge 3 commits into
masterfrom
tailwind-batch2-rest

Conversation

@kokonut121
Copy link
Copy Markdown
Collaborator

Summary

Combines the next three batch-2 page migrations into a single PR for batch review. All three are independently reviewable as commits — see the commit list for the per-page split.

Settings (commit 187999e)

  • views/private/settingsV2.ejs using base.ejs layout — Profile / Personalization / Account / Delete Account forms with Tailwind 12-col grids and native input styling
  • Replace jQuery unsaved-changes detector with Alpine.js (already loaded by V2 head)
  • Replace Bootstrap delete-confirm modal with an Alpine-driven custom modal
  • Field names, IDs, and POST endpoints (/changeProfile, /changePreferences, /changeSettings, /deleteAccount) all preserved
  • Wire /settings to V2 view via expressLayouts

Leaderboard (commit a8fc5ff)

  • views/private/leaderboardV2.ejs using base.ejs layout — rating leaderboard 4-col grid (Physics/Chemistry/Biology/USABO), Rush leaderboard, Experience leaderboard
  • Consolidate four near-identical rating tables into a single forEach over [title, list, valueGetter] tuples
  • Row colors (1st/2nd/3rd/4th+) and medal SVGs preserved
  • Wire /leaderboard to V2 view via expressLayouts

Stats (commit dad3aea) — largest page in batch 2 per #609

  • views/private/statsV2.ejs using base.ejs layout — 5 subject sections (Physics/Chemistry/Biology/ESS/USABO) each with rating + global rank, collected tags (subjects with tags only — USABO has none), analytics groups (Areas of Mastery / Currently Studying / Recommended Training / Favorite Units), Chart.js rating tracker, Change Proficiency button; performance section with Chart.js correct/wrong pie + custom plugin, Tailwind site-experience bar, Problem Rush stats
  • Consolidate 5 near-identical subject sections into a single forEach over a [displayName, ratingKey, analyticsKey, proficiencyPath, hasTags] config table; URL casing preserved (USABO stays uppercase in /train/USABO/proficiency)
  • Wire /stats/:username (both teacher and self branches) to V2 view via expressLayouts

Part of the broader Tailwind V2 migration tracked in #609. Legacy settings.ejs, leaderboard.ejs, stats.ejs remain in tree until the final cleanup pass.

Test plan

Settings

  • /settings loads at 1280px and 375px with no console errors
  • Edit any field → orange "unsaved changes" alert appears
  • Submit each form individually with valid + invalid data → success and error flashes both render in V2 styling
  • Click "Delete Account" → modal appears → Cancel closes it; clicking Delete submits the form (test with a throwaway account)
  • view-source:/settings contains exactly one <head> and one <body>

Leaderboard

  • /leaderboard loads at 1280px (4 columns side-by-side) and 375px (stacked)
  • 1st/2nd/3rd row colors render (sky blue / yellow / red), 4th+ green; medal SVGs in ranks 1–3
  • Click a username → /profile/:username opens in a new tab
  • view-source:/leaderboard contains exactly one <head> and one <body>

Stats

  • /stats (your own) loads at 1280px and 375px with no console errors; 5 subject sections + performance section render
  • After ~1s the global ranks fill in (replaces "XXX") for physics/chemistry/biology/experience/rush
  • Correct/wrong pie chart renders with on-canvas Correct: %% / Wrong: %% labels via the custom plugin
  • Each "Change <Subject> Proficiency" button links to /train/<lowercase>/proficiency (USABO uppercase)
  • As a teacher, view a private student's stats and confirm the V2 page renders
  • view-source:/stats/:username contains exactly one <head> and one <body>

🤖 Generated with Claude Code

kokonut121 and others added 3 commits May 7, 2026 17:02
- Add views/private/settingsV2.ejs using base.ejs layout: profile/personalization/account/delete-account forms with Tailwind grid layouts and native input styling
- Replace jQuery unsaved-changes detector with Alpine.js (already loaded by V2 head); replace Bootstrap delete-confirmation modal with an Alpine-driven custom modal
- Replace Bootstrap form-group/form-control classes with V2 input styling and grid; preserve all field names/IDs/POST endpoints
- Wire /settings route to render settingsV2.ejs with expressLayouts

Part of the broader Tailwind V2 migration tracked in #609. Legacy settings.ejs remains in tree until the final cleanup pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add views/private/leaderboardV2.ejs using base.ejs layout: rating leaderboard 4-col grid (Physics/Chemistry/Biology/USABO), Rush leaderboard, Experience leaderboard
- Consolidate the four near-identical rating tables into a single forEach over [title, list, valueGetter] tuples; preserves row colors (1st/2nd/3rd/4th+) and medal SVGs
- Wire /leaderboard route to render leaderboardV2.ejs with expressLayouts

Part of the broader Tailwind V2 migration tracked in #609.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add views/private/statsV2.ejs using base.ejs layout: 5 subject sections (Physics/Chemistry/Biology/ESS/USABO) each with rating+global rank, collected tags, analytics tags (Areas of Mastery / Currently Studying / Recommended Training / Favorite Units), Chart.js rating tracker, and a Change Proficiency button; plus a Performance section with Chart.js correct/wrong pie, site experience bar, and Problem Rush stats
- Consolidate 5 near-identical subject sections into a single forEach over a config table; preserves all rating/analytics keys and proficiency URL casing (note: USABO uses uppercase "USABO" in /train/USABO/proficiency)
- Wire /stats/:username route (both teacher and self branches) to render statsV2.ejs with expressLayouts

Part of the broader Tailwind V2 migration tracked in #609. Largest page in batch 2 per the migration plan.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant