Skip to content

feat(profile): refactor email handling and implement debouncing for search input#25

Merged
hoangsonww merged 1 commit intomasterfrom
feat/enhance-frontend
Feb 4, 2026
Merged

feat(profile): refactor email handling and implement debouncing for search input#25
hoangsonww merged 1 commit intomasterfrom
feat/enhance-frontend

Conversation

@hoangsonww
Copy link
Copy Markdown
Owner

This pull request primarily updates Babel dependencies and refactors the email state management and search debounce logic in the Profile.js component. The most important changes are grouped below:

Dependency Updates:

  • Added @babel/plugin-proposal-private-property-in-object version ^7.21.11 to both frontend/package.json and frontend/package-lock.json, updating its metadata and dependencies. Note that this plugin is now deprecated and recommends using @babel/plugin-transform-private-property-in-object instead. [1] [2] [3]
  • Added an explicit entry for @babel/plugin-proposal-private-property-in-object under node_modules/@babel/preset-env in package-lock.json, clarifying its version and peer dependencies.

Profile Component Refactor:

  • Removed the unused email state and now rely on userData.email for displaying and updating the email address, improving state consistency. [1] [2] [3]
  • Refactored the search debounce logic: removed the custom debounce function and debouncedSearch callback, replacing them with a useEffect that handles debouncing via a timeout, simplifying the code and improving readability. [1] [2]

@hoangsonww hoangsonww added this to the v1.0.0 - Stable Release milestone Feb 4, 2026
@hoangsonww hoangsonww self-assigned this Feb 4, 2026
Copilot AI review requested due to automatic review settings February 4, 2026 18:11
@hoangsonww hoangsonww added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Feb 4, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
budget-management-backend-api Ignored Ignored Feb 4, 2026 6:11pm

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 4, 2026

Deploy Preview for budget-management-system ready!

Name Link
🔨 Latest commit 19a2d05
🔍 Latest deploy log https://app.netlify.com/projects/budget-management-system/deploys/69838bec12de5600082f549a
😎 Deploy Preview https://deploy-preview-25--budget-management-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hoangsonww hoangsonww merged commit 75b7408 into master Feb 4, 2026
5 of 6 checks passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @hoangsonww, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the frontend's stability and maintainability by updating Babel dependencies and refactoring key functionalities within the Profile.js component. The changes streamline email state management and modernize the search input debouncing mechanism, contributing to a more robust and efficient user profile interface.

Highlights

  • Babel Dependency Updates: The @babel/plugin-proposal-private-property-in-object dependency has been added and updated to version 7.21.11 in package.json and package-lock.json. An explicit entry for this plugin under @babel/preset-env was also added in package-lock.json. It's noted that this plugin is deprecated and recommends using @babel/plugin-transform-private-property-in-object instead.
  • Profile Component Email Handling Refactor: The Profile.js component no longer uses a separate email state. Instead, it now directly utilizes userData.email for displaying and updating the user's email, enhancing state consistency and simplifying the component.
  • Profile Component Search Debounce Logic Improvement: The custom debounce utility function and debouncedSearch callback in Profile.js have been removed. The search input debouncing is now handled more idiomatically using a useEffect hook with a setTimeout and a cleanup function, leading to cleaner and more readable code.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • frontend/package-lock.json
    • Added @babel/plugin-proposal-private-property-in-object to devDependencies.
    • Updated the version and metadata for @babel/plugin-proposal-private-property-in-object to 7.21.11.
    • Added a new entry for @babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object.
  • frontend/package.json
    • Added @babel/plugin-proposal-private-property-in-object with version ^7.21.11 to devDependencies.
  • frontend/src/pages/Profile.js
    • Removed the unused email state variable.
    • Removed the custom debounce utility function.
    • Removed the debouncedSearch useCallback hook.
    • Modified the email update logic to directly update userData.email via setUserData.
    • Replaced the custom debounce implementation for search with a useEffect hook that manages a setTimeout.
Activity
  • The pull request author, hoangsonww, created this PR with a clear description outlining the dependency updates and refactoring efforts in the Profile.js component.
  • The description explicitly links to relevant diff hunks for each major change, providing easy navigation for reviewers.
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces some excellent refactoring in the Profile.js component by simplifying email state management and implementing a more idiomatic debouncing mechanism for the search input using useEffect. However, it also introduces a dependency on a deprecated Babel plugin. My review includes a suggestion to replace this deprecated package to ensure future maintainability.

},
"devDependencies": {
"@babel/core": "^7.28.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

You are adding @babel/plugin-proposal-private-property-in-object, which is a deprecated package. As noted in the PR description and the package's deprecation message, you should use @babel/plugin-transform-private-property-in-object instead. Using deprecated packages can lead to future maintenance issues and lack of support.

It's also possible this plugin is already included in @babel/preset-env and doesn't need to be added explicitly, which you might want to verify.

Suggested change
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.21.11",

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors Profile page state management around email updates and replaces a custom debounced search helper with a simpler useEffect timeout approach, alongside a Babel dependency update to address build/tooling needs.

Changes:

  • Remove redundant email React state in favor of userData.email, updating local state on successful email save.
  • Replace custom debounce + debouncedSearch with a useEffect-driven timeout debounce for search.
  • Add @babel/plugin-proposal-private-property-in-object to frontend devDependencies and update lockfile entries.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
frontend/src/pages/Profile.js Simplifies email state handling and reworks search debouncing using useEffect + setTimeout.
frontend/package.json Adds Babel plugin dependency needed for tooling/build compatibility.
frontend/package-lock.json Updates lockfile to reflect the added Babel plugin and related dependency metadata.
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

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

},
"devDependencies": {
"@babel/core": "^7.28.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

@babel/plugin-proposal-private-property-in-object is marked deprecated by Babel. If this was added as a workaround for a missing-module/build issue, consider switching to @babel/plugin-transform-private-property-in-object (or upgrading the Babel toolchain/react-scripts) to avoid carrying a deprecated direct dependency; otherwise please add a short note in the repo/docs about why this deprecated plugin is required so it doesn’t get removed accidentally later.

Suggested change
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.21.11",

Copilot uses AI. Check for mistakes.
Comment on lines 92 to +96
setUpdatingEmail(true);
setError('');
try {
await api.put('/api/users/profile', { email: newEmail });
setEmail(newEmail);
setUserData(prev => (prev ? { ...prev, email: newEmail } : prev));
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

handleUpdateEmail submits newEmail as-is and the UI currently allows submitting an empty/whitespace value (and likely values that aren’t valid emails). This can result in attempting to set the account email to an invalid value. Add client-side validation (e.g., trim + non-empty + basic email format) and disable/guard the update action when invalid or unchanged; also consider initializing newEmail from the current userData.email when entering edit mode so the field isn’t blank by default.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants