From e4c86d473c7afa931880b2ea81914149536ad427 Mon Sep 17 00:00:00 2001 From: pptx704 Date: Fri, 13 Mar 2026 08:41:13 +0600 Subject: [PATCH] fix: resolve bugs and improve frontend performance - Fix register not resetting isLoading on success (causing login page to hang) - Fix leaderboard streaks 400 error by forcing all_time timeframe - Reorder routes so static paths match before dynamic practice/:sheetId - Lazy-load QuestMap + Three.js (saves ~350KB gzip on initial load) - Move KaTeX CSS to lazy import (only loads on math pages) - Remove 28 duplicate Google Font @import lines from component CSS - Add font preconnect + single stylesheet link in index.html - Replace 8 unsafe JSON.parse(localStorage) calls with Zustand selectors - Add global ErrorBoundary to prevent full-app crashes - Extract arcTheme utilities to break static import cycle with QuestMap - Merge Three.js + Troika into single chunk to fix circular dependency Co-Authored-By: Claude Opus 4.6 --- index.html | 6 ++ src/App.tsx | 22 ++-- src/components/ChestOpenModal.tsx | 1 - src/components/ChoiceCard.tsx | 1 - src/components/CircularLevelProgress.tsx | 1 - src/components/ErrorBoundary.tsx | 83 ++++++++++++++ src/components/InfoHeader.tsx | 3 +- src/components/InventoryButton.tsx | 1 - src/components/InventoryModal.tsx | 1 - src/components/LessonModal.tsx | 8 +- src/components/PredictedScoreCard.tsx | 1 - src/components/QuestNodeModal.tsx | 3 +- src/components/RenderQuestionText.tsx | 1 + src/components/SearchOverlay.tsx | 1 - src/main.tsx | 5 +- src/pages/auth/Login.tsx | 1 - src/pages/auth/Register.tsx | 1 - src/pages/student/Home.tsx | 10 +- src/pages/student/Lessons.tsx | 12 +-- src/pages/student/Practice.tsx | 1 - src/pages/student/Profile.tsx | 1 - src/pages/student/QuestMap.tsx | 108 +------------------ src/pages/student/Rewards.tsx | 25 +++-- src/pages/student/StudentLayout.tsx | 3 +- src/pages/student/drills/page.tsx | 11 +- src/pages/student/hard-test-modules/page.tsx | 1 - src/pages/student/practice-sheet/page.tsx | 10 +- src/pages/student/practice/Pretest.tsx | 12 +-- src/pages/student/practice/Results.tsx | 1 - src/pages/student/practice/Test.tsx | 1 - src/pages/student/targeted-practice/page.tsx | 10 +- src/stores/authStore.ts | 6 ++ src/utils/arcTheme.ts | 105 ++++++++++++++++++ vite.config.ts | 8 +- 34 files changed, 259 insertions(+), 206 deletions(-) create mode 100644 src/components/ErrorBoundary.tsx create mode 100644 src/utils/arcTheme.ts diff --git a/index.html b/index.html index dbebf1a..e84783e 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,12 @@ + + +