created a new settings page for the new UI#959
created a new settings page for the new UI#959L-Tarun-Aditya wants to merge 10 commits intostagefrom
Conversation
9eaf1bb to
305f129
Compare
65351f3 to
d315869
Compare
a0a405a to
3c91ffe
Compare
3c91ffe to
ed80ccc
Compare
There was a problem hiding this comment.
the tests will be in a different pr
There was a problem hiding this comment.
the tests will be in a different pr
| ALREADY_SEND_RESPOND: "Already sent the response.", | ||
| UPDATE_SUCCESS: "Responded successfully.", | ||
| INCORRECT_PASSWORD: "Current password is incorrect", | ||
| SAME_PASSWORD:"Current password is same as old password", |
There was a problem hiding this comment.
can use better messages
like
INCORRECT_PASSWORD: "Password is incorrect.",
SAME_PASSWORD: "Passwords must be different."
There was a problem hiding this comment.
this was already there all i did was run pnpm format and add an extra space thats it. and i think "current password is same as the old password" is more helpful than "must be different" as it explains the problem better , same with the INCORRECT_PASSWORD variable
| }); | ||
|
|
||
| const handleSubmit = async () => { | ||
| console.log("pin", pin); |
|
There was a problem hiding this comment.
Pull request overview
This PR refactors account-related UI by moving profile/security functionality out of the dashboard into a new protected Settings route, and adds MFA flows (2FA setup/disable + MFA sign-in PIN).
Changes:
- Add
/settingsroute with a newUserSettingspage (sidebar tabs) and newProfileInfo+TwoFactorAuthcomponents. - Add MFA sign-in PIN component and update Sign In to branch into MFA when
mfaRequiredis returned. - Update theme/button styling by introducing
--white-fixedand adjusting several component CSS modules; remove some dashboard cards and delete Sign In/UserInfo tests.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/utils/Constants.js | Reformat dashboard titles; add USER_SETTINGS_TITLE. |
| packages/ui/src/page/dashboard/Dashboard.jsx | Remove Plan/User Info/Password/Setting cards from dashboard. |
| packages/ui/src/index.css | Add --white-fixed theme token. |
| packages/ui/src/components/usersettings/UserSettings.module.css | New Settings page layout/styles. |
| packages/ui/src/components/usersettings/UserSettings.jsx | New Settings page with sidebar tabs. |
| packages/ui/src/components/userinfo/UserInfo.module.css | Adjust spacing + ensure primary button text uses --white-fixed. |
| packages/ui/src/components/twofactorauth/TwoFactorAuth.module.css | New 2FA UI styling. |
| packages/ui/src/components/twofactorauth/TwoFactorAuth.jsx | New 2FA enable/verify/disable flows using /auth/mfa/* endpoints. |
| packages/ui/src/components/settings/SettingCard.module.css | Ensure danger button text uses --white-fixed. |
| packages/ui/src/components/profileinfo/ProfileInfo.module.css | New profile/settings grid card layout styling. |
| packages/ui/src/components/profileinfo/ProfileInfo.jsx | New page composing UserInfo/ChangePassword/Setting/Plan. |
| packages/ui/src/components/pin/Pin.module.css | New MFA PIN input styling. |
| packages/ui/src/components/pin/Pin.jsx | New MFA PIN verification component (/auth/mfa/signin). |
| packages/ui/src/components/dropdown/UserDropDown.jsx | Add Settings link to dropdown. |
| packages/ui/src/components/currentplan/CurrentPlan.module.css | Update spacing and button text color variable. |
| packages/ui/src/components/currentplan/CurrentPlan.jsx | Set Button variant="primary" for upgrade button. |
| packages/ui/src/components/common/button/Button.module.css | Change disabled styling (remove opacity). |
| packages/ui/src/components/changepassword/ChangePassword.module.css | Ensure primary button text uses --white-fixed. |
| packages/ui/src/components/auth/Signin.jsx | Add MFA-required branch and render PIN UI; hide form while in MFA. |
| packages/ui/src/App.jsx | Add protected /settings route. |
| packages/ui/tests/components/UserInfo.test.jsx | Delete tests. |
| packages/ui/tests/components/auth/Signin.test.jsx | Delete tests. |
| packages/app/utils/constants.js | Formatting cleanup of message constants. |
Comments suppressed due to low confidence (1)
packages/ui/src/utils/Constants.js:648
USER_SETTINGS_TITLEis exported but appears to be unused (no references inpackages/ui/src). If it’s not needed, remove it; otherwise, wire it into the settings UI to avoid dead constants drifting out of sync.
export const DASHBOARD_CARDS_TITLE = ["Usage", "Generate New API Key"];
export const USER_SETTINGS_TITLE = [
"Plan",
"User Info",
"Change Password",
"Setting",
];
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .button:disabled { | ||
| color: var(--white); | ||
| cursor: not-allowed; | ||
| opacity: 0.8; | ||
| pointer-events: none; | ||
| } |
| const { success, data, error } = await checkMFARequest(); | ||
| if (success && data?.isMfaEnabled !== undefined) { | ||
| setIsMFAEnabled(data.isMfaEnabled); | ||
| setMode(data.isMfaEnabled ? "VERIFIED" : "INITIAL"); | ||
| } else { | ||
| setIsMFAEnabled(false); | ||
| setMode("INITIAL"); | ||
| toast.error(error); |
|
|
||
| export default function TwoFactorAuth() { | ||
| const [isMFAEnabled, setIsMFAEnabled] = useState(false); | ||
| const [mode, setMode] = useState("VERIFIED"); // INITIAL, SETUP, VERIFIED, DISABLE |
| .disableCancleBtn { | ||
| position: absolute; | ||
| right: 2rem; | ||
| bottom: 2rem; | ||
| } |
| <div className={styles.card}> | ||
| <div className={styles.cardBody}> | ||
| <div className={styles.initialState}> | ||
| <h3 className={styles.heading}>Coming Soon</h3> | ||
| <p className={styles.subtext}> | ||
| The {menuItems.find((i) => i.id === activeTab)?.label}{" "} | ||
| settings are currently under development. | ||
| </p> | ||
| </div> |
| setPin(new Array(6).fill("")); | ||
| setIsAuthenticated(true); | ||
| navigate("/dashboard"); | ||
| onClose(); |
| if (success) { | ||
| if (data.source && data.statusCode === 201) { | ||
| toast.success(MESSAGES.VERIFICATION_EMAIL_SENT); | ||
| } else if (data.mfaRequired && data.statusCode === 200) { | ||
| setIsMFAEnabled(true); | ||
| } else { |
| )} | ||
|
|
||
| {isForgotPassword && ( | ||
| {isMFAEnabled && <Pin onClose={onClose} />} |
| background-color: var(--background-light); | ||
| min-height: 100vh; | ||
| } | ||
|
|
||
| [data-theme="dark"] .container { | ||
| background-color: var(--background-dark); |
| } | ||
|
|
||
| [data-theme="dark"] .card { | ||
| background-color: var(--background-dark); |



Description
this pr closes #958
Title
Implement Dedicated Settings Page & 2FA
Description
This PR introduces a dedicated Settings Page to centralize account management and improve security. It migrates existing account features from the Dashboard and adds Two-Factor Authentication (2FA) support.
Key Changes:
Why is this needed?
What type of PR is this? (Check all applicable)
Screenshots (if applicable)
mfa.mp4
Checklist