Skip to content

[UI] Feature: Change account name and ID#2871

Merged
qingqing-ux merged 1 commit into
goplus:uifrom
yueman920:Change-account-name-and-ID
Feb 27, 2026
Merged

[UI] Feature: Change account name and ID#2871
qingqing-ux merged 1 commit into
goplus:uifrom
yueman920:Change-account-name-and-ID

Conversation

@yueman920
Copy link
Copy Markdown

Background

-The builder now supports modifying account name, ID, and avatar.

Modifications

  • User ID is now displayed on the profile page.

  • The personal information editing pop-up now supports modifying the account name, ID, and avatar.

  • A new ID modification reminder pop-up has been added.

-A new avatar upload pop-up has been added.

Scope of Impact

  • Personal Information Page

Does it affect the design system?

  • No

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 introduces significant UI enhancements to the user profile management system. It enables users to update their account name, ID, and avatar through an intuitive interface. The changes include displaying the user ID on the main profile page and providing a comprehensive modal flow for editing personal information, complete with warnings for ID changes and an integrated avatar cropping tool.

Highlights

  • Profile Editing Functionality: Implemented UI functionality to modify account name, ID, and avatar.
  • User ID Display: Displayed the user ID directly on the main profile page.
  • Modal System for Profile Management: Introduced a multi-step modal system for profile editing, including an ID modification warning and an avatar upload with cropping capabilities.

🧠 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
  • ui/features/spx/Change-account-name-and-ID_2026.02.13/Figma-design-file-link.md
    • Added a new file containing a link to the Figma design for the feature.
  • ui/features/spx/Change-account-name-and-ID_2026.02.13/modal-account-name_demo.html
    • Added a new HTML file demonstrating a React-based user profile page.
    • Implemented state management for profile data (name, ID, bio, avatar).
    • Developed a main profile display with an "Edit profile" button.
    • Created a "profile-edit" modal for modifying name, ID, and bio.
    • Integrated an "id-warning" modal to alert users about ID change implications.
    • Included an "id-input" modal for entering a new ID.
    • Designed an "avatar-crop" modal for uploading and cropping user avatars with zoom and drag functionality.
    • Utilized Tailwind CSS for styling and Lucide React for icons.
Activity
  • No specific activity has been recorded for 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

本次 PR 实现了修改账户名称、ID 和头像的功能,代码整体实现了一个功能完整的原型。我发现了一个可以改进的地方,主要是在处理表单输入时,建议使用 React 的受控组件来代替直接的 DOM 操作,以提高代码的健壮性和可维护性。具体的建议请看我的评论。

Comment on lines +314 to +337
{activeModal === 'id-input' && (
<div className="bg-white w-full max-w-[560px] rounded-[12px] shadow-2xl overflow-hidden border border-[#eaeff3]">
<ModalHeader title="修改账号 ID" onClose={() => setActiveModal('profile-edit')} />
<div className="px-6 pt-6 pb-8 space-y-3">
<input
type="text"
defaultValue={editState.id}
id="new-id-input"
className="w-full h-8 bg-[#f6f8fa] border border-[#eaeff3] rounded-[12px] px-3 text-[14px] focus:outline-none focus:border-[#0bc0cf] transition-colors"
/>
<p className="text-[13px] text-[#6e7781] px-1">项目 ID 只能包含数字</p>
</div>
<div className="px-6 pt-5 pb-6 flex justify-end gap-3 border-t border-[#eaeff3]">
<button
onClick={() => setActiveModal('profile-edit')}
className="bg-[#eaeff3] text-[#57606a] px-6 py-1.5 rounded-[12px] font-medium text-[14px] hover:bg-[#e1e7ec] transition-colors"
>取消</button>
<button
onClick={() => handleIdConfirm(document.getElementById('new-id-input').value)}
className="bg-[#0bc0cf] text-white px-6 py-1.5 rounded-[12px] font-medium text-[14px] shadow-[0_2px_0_#0B8893] active:translate-y-[2px] active:shadow-none transition-all"
>确认</button>
</div>
</div>
)}
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

在 React 中使用 document.getElementById 来获取表单值是一种反模式,因为它脱离了 React 的声明式特性,并且可能导致 bug。更好的方式是使用受控组件和 state。

我建议为临时 ID 引入一个新的 state,并将输入框改为受控组件。这将使您的代码更健壮,并符合 React 的最佳实践。

  1. App 组件中添加一个新的 state:

    const [tempId, setTempId] = useState('');
  2. 当从“ID 警告”弹窗打开此弹窗时,用当前 ID 初始化 tempId。您需要更新该弹窗中按钮的 onClick (在 304 行附近):

    onClick={() => { setTempId(editState.id); setActiveModal('id-input'); }}
  3. 然后,您可以用建议中的代码替换此“ID 输入”弹窗的实现,它使用了新的 tempId state。

              {activeModal === 'id-input' && (
                <div className="bg-white w-full max-w-[560px] rounded-[12px] shadow-2xl overflow-hidden border border-[#eaeff3]">
                  <ModalHeader title="修改账号 ID" onClose={() => setActiveModal('profile-edit')} />
                  <div className="px-6 pt-6 pb-8 space-y-3">
                    <input 
                      type="text"
                      value={tempId}
                      onChange={(e) => setTempId(e.target.value)}
                      className="w-full h-8 bg-[#f6f8fa] border border-[#eaeff3] rounded-[12px] px-3 text-[14px] focus:outline-none focus:border-[#0bc0cf] transition-colors"
                    />
                    <p className="text-[13px] text-[#6e7781] px-1">项目 ID 只能包含数字</p>
                  </div>
                  <div className="px-6 pt-5 pb-6 flex justify-end gap-3 border-t border-[#eaeff3]">
                     <button 
                      onClick={() => setActiveModal('profile-edit')}
                      className="bg-[#eaeff3] text-[#57606a] px-6 py-1.5 rounded-[12px] font-medium text-[14px] hover:bg-[#e1e7ec] transition-colors"
                    >取消</button>
                    <button 
                      onClick={() => handleIdConfirm(tempId)}
                      className="bg-[#0bc0cf] text-white px-6 py-1.5 rounded-[12px] font-medium text-[14px] shadow-[0_2px_0_#0B8893] active:translate-y-[2px] active:shadow-none transition-all"
                    >确认</button>
                  </div>
                </div>
              )}

@qingqing-ux qingqing-ux merged commit 9c105d0 into goplus:ui Feb 27, 2026
5 checks passed
@yueman920
Copy link
Copy Markdown
Author

update #2889

@yueman920
Copy link
Copy Markdown
Author

update #2840

Sign up for free to 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.

2 participants