Repository navigation
Conversation
PR Summary by QodoExpand roadmaps, historical cutoffs, and student settings
AI Description
Diagram
High-Level Assessment
Files changed (21)
|
Code Review by Qodo
1. Accounts survive destructive actions
|
| logout(); | ||
| toast({ | ||
| title: "Account Deactivated", | ||
| description: "Your account has been deactivated. Sign in anytime to reactivate.", |
There was a problem hiding this comment.
1. Accounts survive destructive actions 🐞 Bug ≡ Correctness
handleDeactivateAccount and handleDeleteAccount invoke only the client-side logout function before displaying success messages that claim the requested account operation completed. After either confirmation, no request has reached the server, so the user row and associated saved data remain available and the same credentials can immediately sign in again.
Agent Prompt
## Issue description
The Deactivate Account and Delete Account controls only clear local authentication while claiming that the requested account operation succeeded, leaving the server-side account and associated data intact.
## Issue Context
Add authenticated backend operations for account deactivation and permanent deletion, including appropriate handling of all user-owned and associated records. Permanent deletion should delete or appropriately anonymize the account and related data transactionally. Invoke the relevant operation from the UI before clearing local authentication, and show the corresponding success state only after the server confirms completion.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[193-218]
- frontend/src/hooks/use-auth.ts[14-24]
- backend/src/routes/users.ts[8-39]
- backend/src/routes/index.ts[19-32]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if (authUser?.stream && !stream) setStream(authUser.stream); | ||
| if (authUser?.zscore != null && zscore === null) setZscore(authUser.zscore); | ||
| if (authUser?.district && !district) setDistrict(authUser.district); |
There was a problem hiding this comment.
2. Another user's profile drives matches 🐞 Bug ≡ Correctness
The settings synchronization now copies authenticated profile fields only when the persisted local values are empty, and the default district is already nonempty. When another account signs in through the same browser, the previous account's stream, score, and district remain preferred by the dashboard and drive its recommendations.
Agent Prompt
## Issue description
A browser-wide persisted profile can override the profile belonging to the currently authenticated account.
## Issue Context
Treat authenticated server fields as canonical for core recommendation inputs, or key persisted profile data by user ID. Clear or switch user-scoped values during logout and account changes without destroying intentional guest-profile behavior.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[222-234]
- frontend/src/hooks/use-profile.ts[40-94]
- frontend/src/hooks/use-auth.ts[14-24]
- frontend/src/pages/dashboard.tsx[48-79]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| onClick={() => { | ||
| setPreferredUniversities(parseCommaSeparated(inputUnis)); | ||
| setPreferredStudyAreas(parseCommaSeparated(inputAreas)); | ||
| setPreferredCareers(parseCommaSeparated(inputCareersPref)); |
There was a problem hiding this comment.
3. Saved preferences never shape results 🐞 Bug ≡ Correctness
The recommendation-preference button writes the three inputs only into otherwise unconsumed Zustand fields and then says recommendations were updated. Subsequent dashboard recommendation requests still contain only stream, score, district, and year mode, so every saved university, study-area, and career preference is ignored.
Agent Prompt
## Issue description
Saved recommendation preferences do not affect any recommendation result despite the success confirmation.
## Issue Context
Pass the preferences into the recommendation API and implement backend filtering or ranking, or remove/label the controls until this behavior exists. Ensure authenticated preferences are also stored server-side if they are expected to follow the account.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[641-704]
- frontend/src/hooks/use-profile.ts[15-16]
- frontend/src/pages/dashboard.tsx[69-80]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| <p className="text-sm font-medium mt-1"> | ||
| {new Date().toLocaleDateString(undefined, { | ||
| year: "numeric", | ||
| month: "long", |
There was a problem hiding this comment.
4. Every account appears newly created 🐞 Bug ≡ Correctness
The account information panel renders new Date() rather than an account creation value. Each visit therefore displays the current date even though the user record has a persistent createdAt timestamp.
Agent Prompt
## Issue description
The account creation date is always rendered as today's date.
## Issue Context
Expose the stored user creation timestamp through authentication responses and the frontend `User` schema, then format that value in settings. Do not synthesize a date when the field is unavailable.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[844-855]
- frontend/src/api/generated/api.schemas.ts[313-327]
- backend/src/routes/auth.ts[80-115]
- backend/src/db/schema/users.ts[5-16]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| const isDark = | ||
| theme === "dark" || | ||
| (theme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches); |
There was a problem hiding this comment.
5. System theme stops following the os 🐞 Bug ≡ Correctness
applyTheme samples prefers-color-scheme only when the setting is selected or the store rehydrates, without subscribing to media-query changes. While the theme remains set to system, changing the operating-system appearance leaves the application in the previous mode until another application action or reload reapplies it.
Agent Prompt
## Issue description
System theme mode does not react when the operating-system color scheme changes.
## Issue Context
When `theme` is `system`, attach a change listener to the `prefers-color-scheme: dark` media query and clean it up when leaving system mode or unmounting. Keep the existing immediate application behavior.
## Fix Focus Areas
- frontend/src/hooks/use-profile.ts[79-107]
- frontend/src/pages/settings.tsx[782-812]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| setPasswordLoading(true); | ||
| setTimeout(() => { | ||
| setPasswordLoading(false); | ||
| setCurrentPassword(""); |
There was a problem hiding this comment.
6. Passwords remain unchanged after update 🐞 Bug ⛨ Security
handleChangePassword validates fields but never checks currentPassword or sends a backend request, instead waiting 800 ms before clearing the form and showing a success toast. Every authenticated submission therefore appears to succeed while the stored password remains valid, including submissions with an incorrect current password.
Agent Prompt
## Issue description
The settings password form reports success without changing the authenticated user's password or validating the supplied current password.
## Issue Context
Add an authenticated backend password-change endpoint that verifies the current password, validates and hashes the replacement password, persists it to the user record, and returns an error on failure. Call this endpoint from the settings form, and only clear the form and display the success message after the request succeeds.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[153-190]
- backend/src/routes/auth.ts[54-115]
- backend/src/routes/index.ts[19-32]
- backend/src/db/schema/users.ts[5-16]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| // Auto-generate ONLY when arriving with a specific courseId in the URL | ||
| useEffect(() => { | ||
| if (courseIdParam) { | ||
| setSelectedCourseId(courseIdParam); | ||
| } | ||
| }, [courseIdParam]); | ||
|
|
||
| useEffect(() => { | ||
| if (selectedCourseId && !roadmap) { | ||
| generateRoadmap({ | ||
| data: { | ||
| courseId: parseInt(selectedCourseId), | ||
| courseId: parseInt(courseIdParam), |
There was a problem hiding this comment.
7. Students create duplicate roadmaps 🐞 Bug ≡ Correctness
The URL-driven effect calls generateRoadmap whenever courseIdParam is present, including links newly added for an already saved roadmap. Each authenticated generation unconditionally inserts a row, so using Continue Roadmap repeatedly creates records for the same course and replaces the dashboard's newest active entry.
Agent Prompt
## Issue description
Opening a roadmap with a `courseId` query parameter always regenerates it, even when the user selected an existing saved roadmap from the dashboard. Generation inserts a fresh database row each time.
## Issue Context
The dashboard's Continue Roadmap links use `courseId`, and the backend does not deduplicate roadmap inserts. Fetch and render the existing user roadmap for that course, or add an explicit regenerate action with an upsert/replace policy.
## Fix Focus Areas
- frontend/src/pages/roadmap.tsx[204-216]
- frontend/src/pages/dashboard.tsx[316-318]
- frontend/src/pages/dashboard.tsx[515-519]
- backend/src/routes/roadmaps.ts[247-260]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| setFullName(data.fullName); | ||
| setEducationStage(data.educationStage); | ||
| setStream(data.stream); | ||
| setZscore(data.zscore); | ||
| setDistrict(data.district); | ||
| setInterests(interestsList); | ||
| setPreferredCareers(preferredCareersList); | ||
| setSkills(skillsList); |
There was a problem hiding this comment.
8. New profile details do not sync 🐞 Bug ≡ Correctness
onSubmit stores education stage, interests, preferred careers, and skills only in the local Zustand profile store, then omits them from the profile-update payload. Signed-in students therefore see a successful profile update but lose those new details on another device or after browser storage is cleared.
Agent Prompt
## Issue description
New profile fields are saved only in browser-local Zustand state and are not included in the authenticated profile update request.
## Issue Context
Extend the database model, API validation, and user update route to support the added profile data, then include those values in the frontend mutation and hydrate them from the authenticated user response.
## Fix Focus Areas
- frontend/src/pages/settings.tsx[271-295]
- frontend/src/hooks/use-profile.ts[4-95]
- backend/src/routes/users.ts[17-36]
- backend/src/api-zod/generated/api.ts[447-453]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.