Skip to content

Merge new changes - #127

Merged
cuttle-fish-my merged 28 commits into
mainfrom
dev
Jun 3, 2026
Merged

Merge new changes#127
cuttle-fish-my merged 28 commits into
mainfrom
dev

Conversation

@caoster

Copy link
Copy Markdown
Member

No description provided.

cuttle-fish-myand others added 28 commits July 13, 2025 09:46
Reorganize the codebase and rework on cache system
@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jun 3, 2026

Copy link
Copy Markdown

Deploying opensist with Cloudflare Pages Cloudflare Pages

Latest commit:670cbe3
Status: ✅ Deploy successful!
Preview URL:https://ade778f8.opensist.pages.dev
Branch Preview URL:https://dev.opensist.pages.dev

View logs

@caoster
caoster requested a review from CopilotJune 3, 2026 01:53
@Winlere

Copy link
Copy Markdown

random walk to the site and the user's typical usage works good.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 use apiRequest/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
FileDescription
vite.config.jsAdds Vite config (plugins, dev server, build output, chunking rules).
src/index.jsxImproves theme persistence, memoization, and adds router fallback loading UI.
src/global.d.tsAdds Vite client typings and CSS module declaration.
src/Data/UnivList.jsonUpdates a university color entry.
src/Data/Schemas.jsCleans up application year options formatting.
src/Data/RecordData.jsRefactors record fetching to batch + cache-aware implementation.
src/Data/ProgramData.jsRefactors program list/desc fetching to cache + batched desc endpoint.
src/Data/PostData.jsRefactors post APIs and adds like/comment/delete helpers.
src/Data/FileData.jsRefactors file APIs to apiJson/apiRequest and simplifies mutations.
src/Data/EmailData.jsRemoves email data module.
src/Data/CoreCacheSync.jsAdds background cache prefetch loop for core app data.
src/Data/Common.jsIntroduces apiRequest/apiJson/apiText, improves 401 handling, adds utcToLocal.
src/Data/CommentData.jsRemoves legacy comment data module.
src/Data/CacheStore.jsAdds versioned localforage-backed cache with in-memory layer and request coordination.
src/Data/ApplicantData.jsRefactors applicant APIs to cache-aware implementation and metadata naming updates.
src/Components/WorldMap/display.jsRefactors map functions, improves cleanup, and fixes click coordinate handling.
src/Components/TopBar/TopBar.jsxSwitches SVG imports to Vite svgr ?react usage.
src/Components/TopBar/StatusBlock/StatusBlock.jsxStarts background cache sync on login; switches metadata calls; removes theme write side-effect.
src/Components/TopBar/NavBar/NavBar.jsxRemoves “关于我们” navigation entry and minor import cleanup.
src/Components/router.jsxSwitches markdown loading to ?raw and replaces FAQ route with a component.
src/Components/ProgramPage/SideBar/SideBar.jsxAdds star button in list with metadata context; replaces layout grid usage.
src/Components/ProgramPage/SideBar/SearchBar/SearchBar.jsxConverts to controlled filters with debounced URL param updates.
src/Components/ProgramPage/ProgramPage.jsxAdds star/unstar action handling and loads metadata in loader.
src/Components/ProgramPage/ProgramContent/StarButton.jsxAdds ProgramID hidden field and stops click propagation to avoid list navigation.
src/Components/ProgramPage/ProgramContent/ProgramContent.jsxCleans loader/action, normalizes redirect usage, and avoids mutating records array.
src/Components/Profile/ProfileSideBar/ProfileSideBar.jsxUpdates metadata naming, improves avatar submit behavior, and dialog text logic.
src/Components/Profile/ProfileApplicant/ProfileApplicantShared.jsxAdds shared profile layout primitives (list/item blocks).
src/Components/Profile/ProfileApplicant/ProfileApplicantSections.jsxAdds modular sections for exchange/research/intern/publication/etc display.
src/Components/Profile/ProfileApplicant/ProfileApplicantRecords.jsxAdds record card grid and delete confirmation dialog.
src/Components/Profile/ProfileApplicant/ProfileApplicantHeader.jsxAdds new profile header block with contact/material download + controls.
src/Components/Profile/Profile.jsxUpdates metadata naming and redirects to request.url.
src/Components/Post/PostPage.jsxSimplifies post sidebar actions and removes refresh action wiring.
src/Components/Post/PostContent/PostContent.jsxUses unified delete API, shows local dates, and updates layout grid usage.
src/Components/Post/CommentSection/CommentSection.jsxPresent in PR payload (no diff shown).
src/Components/Post/CommentSection/CommentSection.cssPresent in PR payload (no diff shown).
src/Components/Modify/Program/AddModifyProgram.jsxAdds program name validation and makes submit disabled when invalid.
src/Components/Modify/Post/AddModifyPost.jsxSimplifies action error handling and standardizes actionType naming.
src/Components/Modify/Applicant/FormComponent/SoftBackgroundSections.jsxAdds reusable list-section helpers for applicant soft background form.
src/Components/Modify/Applicant/FormComponent/ApplicantFormShared.jsxAdds shared section wrappers and number input styling.
src/Components/Modify/Applicant/applicantFormData.jsExtracts applicant request body creation + file sync logic.
src/Components/Modify/Applicant/AddModifyApplicant.jsxRefactors applicant submit flow to extracted helpers; cleans form state updates.
src/Components/HowToUse/HowToUse.jsxRemoves HowToUse page implementation.
src/Components/HowToUse/HowToUse.cssRemoves HowToUse styles.
src/Components/Home/home.jsxUpdates map init API, switches SVGs to ?react, and updates layout grid usage.
src/Components/Favorites/ProgramCard.jsxRefactors layout and removes embedded ThemeProvider breakpoints.
src/Components/Favorites/Favorites.jsxWraps favorites list with custom breakpoint theme and updates metadata naming.
src/Components/FAQ/FAQ.jsxAdds new FAQ page with glossary and embedded AboutUs.
src/Components/FAQ/AboutUs.jsxRefactors AboutUs into reusable component and updates layout grid usage.
src/Components/Errors/ErrorPage.jsxAvoids mutating the route error object and improves message selection.
src/Components/DataPoints/DataPoints.jsxRefactors record loading, filtering, sorting, and improves loading fallback.
src/Components/DataPoints/DataPoints.cssFixes responsive .refresh-button selector scoping.
src/Components/common.jsxAdds forceOpen option to loading backdrop and improves DraggableFAB click behavior.
src/Components/Auth/RegisterAndReset/RegisterAndReset.jsxRefactors token cooldown/timer logic and uses apiRequest.
src/Components/Auth/Login/Login.jsxMinor cleanup and removes unnecessary await.
src/babel.config.jsRemoves Babel config (CRA-era).
src/babel-plugin-macros.config.jsRemoves babel-plugin-macros config (CRA-era).
src/APIs/APIs.jsSwitches env var access to import.meta.env.* and updates API endpoints for batching.
public/index.htmlRemoves CRA public index.html.
package.jsonSwitches scripts to Vite, adds lint/typecheck/build pipeline, updates deps.
index.htmlAdds Vite root HTML entrypoint.
eslint.config.jsAdds ESLint flat config for the Vite codebase.
env/alphaRenames env var to VITE_BACKEND_SPECIFIC_API.
.gitignoreStops 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 imports Grid2 from @mui/material/Grid (classic Grid). Use the Grid v2 export so size is actually applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/Data/Common.js
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
cuttle-fish-my merged commit 6c9a0ae into mainJun 3, 2026
2 checks passed
Sign up for freeto 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.

6 participants

@caoster@Winlere@cuttle-fish-my@thezbm@billhu0