Skip to content

feat(profile): implement inline username and email editing (issue #143)#172

Open
Talhaasif7 wants to merge 4 commits into
daviddprtma:mainfrom
Talhaasif7:feat/profile-edit-username-email
Open

feat(profile): implement inline username and email editing (issue #143)#172
Talhaasif7 wants to merge 4 commits into
daviddprtma:mainfrom
Talhaasif7:feat/profile-edit-username-email

Conversation

@Talhaasif7

Copy link
Copy Markdown
Contributor

📌 Related Issue

Fixes #143


Description of Changes

Upgraded the User Profile page to support inline editing for Username and Email address, complete with a new backend endpoint, client API integration, and user interface controls.

  • Backend Route: Implemented the PATCH /api/account endpoint in backend/src/routes/account.js to update username in the profiles table and email in Supabase Auth via admin privileges. Handled unique constraint conflicts (username taken or email in use) gracefully with a 409 Conflict.
  • API Client: Added the updateProfile function in src/lib/api.ts to communicate with the new PATCH endpoint.
  • UI Upgrade: Modified src/pages/Profile.tsx to include an "Edit Profile" action button (using a Pencil icon). Added inline editable input fields with real-time key-up client-side validations, error styling/messaging, and loading/disabled states for buttons during submissions.
  • Session Sync: Integrated supabase.auth.refreshSession() inside the UI save handler to instantly propagate email updates to the local Supabase client instance.
  • Stability: Handled TypeScript strict null-checks for the supabase client instance.

Type of Change

  • 🐛 Bug Fix
  • ✨ New Feature
  • 🎨 UI/UX or Design Update
  • Other

✅ Checklist

  • I’ve read the CONTRIBUTING.md guidelines.
  • My code follows the project’s conventions.
  • I’ve linked the related issue correctly.
  • I’ve tested my changes locally.
  • I’ve added or updated documentation/comments if needed.
  • My PR title follows the branch & commit naming conventions.
  • My changes introduce no new warnings or errors.
  • I’ve performed a self-review of my work.

💬 Additional Notes (Optional)

Unit tests for updateProfile (success, missing session, and validation/taken error cases) have been added and run successfully inside src/lib/__tests__/api.test.ts. Production build (npm run build) and linting (npm run lint) check out with 0 errors.

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@Talhaasif7 is attempting to deploy a commit to the daviddprtma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@daviddprtma daviddprtma moved this from Todo to In Progress in AgroDex SSoC'26 Project Jun 24, 2026
@daviddprtma

Copy link
Copy Markdown
Owner

I get this error while I want to update my username. please fix it with the screenshot below👇

Screenshot 2026-06-24 094600 Screenshot 2026-06-24 094644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Enhancement: Add inline "Edit" functionality to the existing User Profile card

2 participants