Merge new changes#127
Merged
Merged
Conversation
Bug fix for dev
… Applicants, Records, Metadata, Avatars
Reorganize the codebase and rework on cache system
Bugfix and remove about-us
Deploying opensist with
|
| Latest commit: |
670cbe3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ade778f8.opensist.pages.dev |
| Branch Preview URL: | https://dev.opensist.pages.dev |
|
random walk to the site and the user's typical usage works good. |
Winlere
approved these changes
Jun 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the frontend build from Create React App to Vite, while also refactoring client data access to a unified request + caching layer and updating multiple UI routes/components to support new features (favorites starring, FAQ page, improved profile rendering) and performance (background cache prefetch).
Changes:
- Migrate build tooling to Vite (new root
index.html,vite.config.js, ESLint flat config, env var prefix changes). - Introduce a versioned cache layer (
CacheStore) and background prefetcher (CoreCacheSync), and refactor data modules to useapiRequest/apiJson+ cache APIs. - UI refactors across routes (SVG via
?react, markdown via?raw, new FAQ page, favorites starring flow, profile page component split, improved DataPoints filtering).
Reviewed changes
Copilot reviewed 65 out of 70 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.js | Adds Vite config (plugins, dev server, build output, chunking rules). |
| src/index.jsx | Improves theme persistence, memoization, and adds router fallback loading UI. |
| src/global.d.ts | Adds Vite client typings and CSS module declaration. |
| src/Data/UnivList.json | Updates a university color entry. |
| src/Data/Schemas.js | Cleans up application year options formatting. |
| src/Data/RecordData.js | Refactors record fetching to batch + cache-aware implementation. |
| src/Data/ProgramData.js | Refactors program list/desc fetching to cache + batched desc endpoint. |
| src/Data/PostData.js | Refactors post APIs and adds like/comment/delete helpers. |
| src/Data/FileData.js | Refactors file APIs to apiJson/apiRequest and simplifies mutations. |
| src/Data/EmailData.js | Removes email data module. |
| src/Data/CoreCacheSync.js | Adds background cache prefetch loop for core app data. |
| src/Data/Common.js | Introduces apiRequest/apiJson/apiText, improves 401 handling, adds utcToLocal. |
| src/Data/CommentData.js | Removes legacy comment data module. |
| src/Data/CacheStore.js | Adds versioned localforage-backed cache with in-memory layer and request coordination. |
| src/Data/ApplicantData.js | Refactors applicant APIs to cache-aware implementation and metadata naming updates. |
| src/Components/WorldMap/display.js | Refactors map functions, improves cleanup, and fixes click coordinate handling. |
| src/Components/TopBar/TopBar.jsx | Switches SVG imports to Vite svgr ?react usage. |
| src/Components/TopBar/StatusBlock/StatusBlock.jsx | Starts background cache sync on login; switches metadata calls; removes theme write side-effect. |
| src/Components/TopBar/NavBar/NavBar.jsx | Removes “关于我们” navigation entry and minor import cleanup. |
| src/Components/router.jsx | Switches markdown loading to ?raw and replaces FAQ route with a component. |
| src/Components/ProgramPage/SideBar/SideBar.jsx | Adds star button in list with metadata context; replaces layout grid usage. |
| src/Components/ProgramPage/SideBar/SearchBar/SearchBar.jsx | Converts to controlled filters with debounced URL param updates. |
| src/Components/ProgramPage/ProgramPage.jsx | Adds star/unstar action handling and loads metadata in loader. |
| src/Components/ProgramPage/ProgramContent/StarButton.jsx | Adds ProgramID hidden field and stops click propagation to avoid list navigation. |
| src/Components/ProgramPage/ProgramContent/ProgramContent.jsx | Cleans loader/action, normalizes redirect usage, and avoids mutating records array. |
| src/Components/Profile/ProfileSideBar/ProfileSideBar.jsx | Updates metadata naming, improves avatar submit behavior, and dialog text logic. |
| src/Components/Profile/ProfileApplicant/ProfileApplicantShared.jsx | Adds shared profile layout primitives (list/item blocks). |
| src/Components/Profile/ProfileApplicant/ProfileApplicantSections.jsx | Adds modular sections for exchange/research/intern/publication/etc display. |
| src/Components/Profile/ProfileApplicant/ProfileApplicantRecords.jsx | Adds record card grid and delete confirmation dialog. |
| src/Components/Profile/ProfileApplicant/ProfileApplicantHeader.jsx | Adds new profile header block with contact/material download + controls. |
| src/Components/Profile/Profile.jsx | Updates metadata naming and redirects to request.url. |
| src/Components/Post/PostPage.jsx | Simplifies post sidebar actions and removes refresh action wiring. |
| src/Components/Post/PostContent/PostContent.jsx | Uses unified delete API, shows local dates, and updates layout grid usage. |
| src/Components/Post/CommentSection/CommentSection.jsx | Present in PR payload (no diff shown). |
| src/Components/Post/CommentSection/CommentSection.css | Present in PR payload (no diff shown). |
| src/Components/Modify/Program/AddModifyProgram.jsx | Adds program name validation and makes submit disabled when invalid. |
| src/Components/Modify/Post/AddModifyPost.jsx | Simplifies action error handling and standardizes actionType naming. |
| src/Components/Modify/Applicant/FormComponent/SoftBackgroundSections.jsx | Adds reusable list-section helpers for applicant soft background form. |
| src/Components/Modify/Applicant/FormComponent/ApplicantFormShared.jsx | Adds shared section wrappers and number input styling. |
| src/Components/Modify/Applicant/applicantFormData.js | Extracts applicant request body creation + file sync logic. |
| src/Components/Modify/Applicant/AddModifyApplicant.jsx | Refactors applicant submit flow to extracted helpers; cleans form state updates. |
| src/Components/HowToUse/HowToUse.jsx | Removes HowToUse page implementation. |
| src/Components/HowToUse/HowToUse.css | Removes HowToUse styles. |
| src/Components/Home/home.jsx | Updates map init API, switches SVGs to ?react, and updates layout grid usage. |
| src/Components/Favorites/ProgramCard.jsx | Refactors layout and removes embedded ThemeProvider breakpoints. |
| src/Components/Favorites/Favorites.jsx | Wraps favorites list with custom breakpoint theme and updates metadata naming. |
| src/Components/FAQ/FAQ.jsx | Adds new FAQ page with glossary and embedded AboutUs. |
| src/Components/FAQ/AboutUs.jsx | Refactors AboutUs into reusable component and updates layout grid usage. |
| src/Components/Errors/ErrorPage.jsx | Avoids mutating the route error object and improves message selection. |
| src/Components/DataPoints/DataPoints.jsx | Refactors record loading, filtering, sorting, and improves loading fallback. |
| src/Components/DataPoints/DataPoints.css | Fixes responsive .refresh-button selector scoping. |
| src/Components/common.jsx | Adds forceOpen option to loading backdrop and improves DraggableFAB click behavior. |
| src/Components/Auth/RegisterAndReset/RegisterAndReset.jsx | Refactors token cooldown/timer logic and uses apiRequest. |
| src/Components/Auth/Login/Login.jsx | Minor cleanup and removes unnecessary await. |
| src/babel.config.js | Removes Babel config (CRA-era). |
| src/babel-plugin-macros.config.js | Removes babel-plugin-macros config (CRA-era). |
| src/APIs/APIs.js | Switches env var access to import.meta.env.* and updates API endpoints for batching. |
| public/index.html | Removes CRA public index.html. |
| package.json | Switches scripts to Vite, adds lint/typecheck/build pipeline, updates deps. |
| index.html | Adds Vite root HTML entrypoint. |
| eslint.config.js | Adds ESLint flat config for the Vite codebase. |
| env/alpha | Renames env var to VITE_BACKEND_SPECIFIC_API. |
| .gitignore | Stops ignoring package-lock.json. |
Comments suppressed due to low confidence (1)
src/Components/FAQ/AboutUs.jsx:3
- This component uses the Grid v2 API (
size={{ xs, sm, ... }}), but importsGrid2from@mui/material/Grid(classic Grid). Use the Grid v2 export sosizeis actually applied.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+100
| export function utcToLocal(dateString, dateOnly = false) { | ||
| const utcString = dateString.replace(" ", "T") + "Z"; | ||
| const date = new Date(utcString); | ||
|
|
| import {clickHandler, init_map} from "../WorldMap/display"; | ||
| import Grid2 from "@mui/material/Unstable_Grid2"; | ||
| import {clickHandler, initMap} from "../WorldMap/display"; | ||
| import Grid2 from "@mui/material/Grid"; |
| import {getMetaData, getAvatar} from "../../../Data/UserData"; | ||
| import Grid2 from "@mui/material/Unstable_Grid2"; | ||
| import {getAvatar, getMetadata} from "../../../Data/UserData"; | ||
| import Grid2 from "@mui/material/Grid"; |
| import { useNavigate } from "react-router-dom"; | ||
| import { regionFlagMapping } from "../../Data/Schemas"; | ||
| import { univAbbrFullNameMapping, univColorMapping } from "../../Data/Common"; | ||
| import Grid from "@mui/material/Grid"; |
Comment on lines
+1
to
+3
| import {Box, ListItem, ListItemIcon, ListItemText, Paper, styled, Typography} from "@mui/material"; | ||
| import Grid2 from "@mui/material/Grid"; | ||
| import {BoldTypography} from "../../common"; |
| import TransgenderIcon from '@mui/icons-material/Transgender'; | ||
| import {faQq, faWeixin} from "@fortawesome/free-brands-svg-icons"; | ||
| import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; | ||
| import Grid2 from "@mui/material/Grid"; |
| Tooltip | ||
| } from "@mui/material"; | ||
| import {Add, Delete, Edit} from "@mui/icons-material"; | ||
| import Grid2 from "@mui/material/Grid"; |
| import React, {useEffect, useState} from "react"; | ||
| import Grid2 from "@mui/material/Unstable_Grid2"; | ||
| import React, {useRef, useState} from "react"; | ||
| import Grid2 from "@mui/material/Grid"; |
cuttle-fish-my
approved these changes
Jun 3, 2026
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.
No description provided.