Skip to content

Use same popup for add email as signup#7701

Open
Kelrap wants to merge 2 commits into
mainfrom
email-popup
Open

Use same popup for add email as signup#7701
Kelrap wants to merge 2 commits into
mainfrom
email-popup

Conversation

@Kelrap

@Kelrap Kelrap commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Thank you so much for your contribution to FluffyChat ❤️❤️❤️

Pull Request has been tested on:

  • Android
  • iOS
  • Browser (Chromium based)
  • Browser (Firefox based)
  • Browser (WebKit based)
  • Desktop Linux
  • Desktop Windows
  • Desktop macOS

Accessibility

  • New or changed controls have an accessible name (tooltip: / semanticLabel:), and decorative images use excludeFromSemantics: true. See accessibility.instructions.md. (The source-level gate enforces this; manual a11y review is owned by whoever changes the UI.)

Summary by CodeRabbit

  • New Features

    • Added a registration email popup when adding an email address.
    • Added an option to resend the registration email directly from the popup.
  • Bug Fixes

    • Preserved the existing confirmation and cancellation handling while completing email registration.

@Kelrap Kelrap linked an issue Jul 15, 2026 that may be closed by this pull request
2 tasks
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Kelrap, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c5491d8-3e3c-42be-bfe7-06fe47d72a9c

📥 Commits

Reviewing files that changed from the base of the PR and between 34967d9 and 478cb01.

📒 Files selected for processing (1)
  • lib/routes/settings/settings_security/settings_3pid/settings_3pid.dart
📝 Walkthrough

Walkthrough

The 3PID email registration flow now presents a resend-capable RegistrationEmailPopup instead of a basic confirmation alert, while retaining the existing authentication request, cancellation handling, and success-state cleanup.

Changes

Settings 3PID registration

Layer / File(s) Summary
Email registration popup flow
lib/routes/settings/settings_security/settings_3pid/settings_3pid.dart
Replaces the confirmation alert with RegistrationEmailPopup, increments sendAttempt and requests a new token when resending, then continues the existing add3PID authentication flow and state cleanup.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: reusing the signup popup for the add-email flow.
Description check ✅ Passed The description follows the template and includes the required checklist and testing section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch email-popup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/routes/settings/settings_security/settings_3pid/settings_3pid.dart`:
- Around line 53-60: Update the onResendEmail callback to wrap
requestTokenToRegisterEmail with the existing showFutureLoadingDialog pattern
used by the initial request, preserving the send-attempt increment and request
arguments while providing loading feedback and graceful error handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 84adde95-fa08-42db-8641-40afce86c39c

📥 Commits

Reviewing files that changed from the base of the PR and between 604a7f2 and 34967d9.

📒 Files selected for processing (1)
  • lib/routes/settings/settings_security/settings_3pid/settings_3pid.dart

Comment on lines +53 to +60
onResendEmail: () async {
Settings3Pid.sendAttempt++;
await Matrix.of(context).client.requestTokenToRegisterEmail(
clientSecret,
input,
Settings3Pid.sendAttempt,
);
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add error handling and loading feedback for the resend action.

Currently, the onResendEmail callback fires a network request without any visual loading state or error handling. If the request fails, the exception will be unhandled and the user will not receive any feedback.

Consider wrapping the request with showFutureLoadingDialog (as done for the initial request) to provide a loading indicator and to handle potential errors gracefully.

💻 Proposed fix
-            onResendEmail: () async {
-              Settings3Pid.sendAttempt++;
-              await Matrix.of(context).client.requestTokenToRegisterEmail(
-                clientSecret,
-                input,
-                Settings3Pid.sendAttempt,
-              );
-            },
+            onResendEmail: () async {
+              Settings3Pid.sendAttempt++;
+              await showFutureLoadingDialog(
+                context: context,
+                future: () => Matrix.of(context).client.requestTokenToRegisterEmail(
+                  clientSecret,
+                  input,
+                  Settings3Pid.sendAttempt,
+                ),
+              );
+            },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onResendEmail: () async {
Settings3Pid.sendAttempt++;
await Matrix.of(context).client.requestTokenToRegisterEmail(
clientSecret,
input,
Settings3Pid.sendAttempt,
);
},
onResendEmail: () async {
Settings3Pid.sendAttempt++;
await showFutureLoadingDialog(
context: context,
future: () => Matrix.of(context).client.requestTokenToRegisterEmail(
clientSecret,
input,
Settings3Pid.sendAttempt,
),
);
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/routes/settings/settings_security/settings_3pid/settings_3pid.dart`
around lines 53 - 60, Update the onResendEmail callback to wrap
requestTokenToRegisterEmail with the existing showFutureLoadingDialog pattern
used by the initial request, preserving the send-attempt increment and request
arguments while providing loading feedback and graceful error handling.

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.

Make add email popup same as new account email popup?

1 participant