Skip to content

fix(samples): replace login email with name#1272

Closed
renefloor wants to merge 1 commit into
mainfrom
feat/update-dogfooding-login-page
Closed

fix(samples): replace login email with name#1272
renefloor wants to merge 1 commit into
mainfrom
feat/update-dogfooding-login-page

Conversation

@renefloor

@renefloor renefloor commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎯 Goal

The login screen is confusing for many people because of the login with email.

🛠 Implementation details

This replaces the email with a display name, how it's also actually working.
The React pronto app only asks the name later, but that would be a bigger change.

🎨 UI Changes

Add relevant screenshots

Before After
image image

from pronto:
image

☑️Contributor Checklist

General

  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#flutter-team) (required)
  • PR is linked to the GitHub issue it resolves

☑️Reviewer Checklist

  • Sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated Documentation

Summary by CodeRabbit

  • New Features

    • The login screen now lets users choose a display name instead of entering an email.
    • Added clearer validation for empty display names, with inline error feedback.
    • Updated the primary action to continue with the chosen display name.
  • Bug Fixes

    • Improved the login flow so the entered name is used consistently when signing in.

@renefloor renefloor requested a review from a team as a code owner July 7, 2026 13:58
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The login screen replaces email-based sign-up with a display-name entry flow. State fields switch from an email controller to a username controller with an error flag, _loginWithEmail is replaced by _loginWithName performing validation and UserInfo creation via createValidId, and the UI is updated accordingly.

Changes

Display Name Login Flow

Layer / File(s) Summary
Username state and login logic
dogfooding/lib/screens/login_screen.dart
Replaces _emailController with _userNameController and adds _userNameHasError; replaces _loginWithEmail with _loginWithName that validates empty input, builds UserInfo via createValidId(userName), and delegates to _login; updates dispose() to dispose the new controller.
Username input UI
dogfooding/lib/screens/login_screen.dart
Replaces the email TextField and "Sign up with email" button with a "Choose display name" TextField showing errorText from _userNameHasError, and a "Continue" button wired to _loginWithName.

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

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LoginScreen
    participant UserInfo

    User->>LoginScreen: Enter display name, tap Continue
    LoginScreen->>LoginScreen: _loginWithName()
    alt Name is empty
        LoginScreen->>LoginScreen: setState _userNameHasError = true
        LoginScreen-->>User: Show error text
    else Name provided
        LoginScreen->>LoginScreen: setState _userNameHasError = false
        LoginScreen->>UserInfo: createValidId(userName)
        LoginScreen->>LoginScreen: _login(UserInfo)
    end
Loading

Compact metadata:

  • Related issues: None found
  • Related PRs: None found
  • Suggested labels: None found
  • Suggested reviewers: None found

🐰 A rabbit hops away from mail,
No more "email" upon the trail,
A name now typed with gentle care,
"Continue" clicked, we're login-ware,
Hooray, display names prevail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change from email login to display-name login.
Description check ✅ Passed It includes the goal, implementation details, screenshots, and checklists; the testing section from the template is missing.
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 feat/update-dogfooding-login-page

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 `@dogfooding/lib/screens/login_screen.dart`:
- Around line 66-73: The _loginWithName validation in login_screen.dart only
checks _userNameController.text with isEmpty, so whitespace-only input still
passes and later creates a blank-looking name/id via createValidId. Update
_loginWithName to trim the entered user name before validating and use the
trimmed value consistently for the error check and subsequent login flow. Keep
the fix localized around _loginWithName, _userNameController, and createValidId
so names containing only spaces are rejected.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3257e163-ada9-480c-bf2d-a6feae35aa07

📥 Commits

Reviewing files that changed from the base of the PR and between a5eeb44 and 1f6c37d.

📒 Files selected for processing (1)
  • dogfooding/lib/screens/login_screen.dart

Comment on lines +66 to +73
Future<void> _loginWithName() async {
final userName = _userNameController.text;
if (userName.isEmpty) {
setState(() {
_userNameHasError = true;
});
return debugPrint('User name is empty');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Whitespace-only name bypasses validation.

userName.isEmpty doesn't trim, so a name of only spaces passes validation but yields an all-underscore id (via createValidId) and a blank-looking display name.

🐛 Proposed fix
   Future<void> _loginWithName() async {
-    final userName = _userNameController.text;
+    final userName = _userNameController.text.trim();
     if (userName.isEmpty) {
📝 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
Future<void> _loginWithName() async {
final userName = _userNameController.text;
if (userName.isEmpty) {
setState(() {
_userNameHasError = true;
});
return debugPrint('User name is empty');
}
Future<void> _loginWithName() async {
final userName = _userNameController.text.trim();
if (userName.isEmpty) {
setState(() {
_userNameHasError = true;
});
return debugPrint('User name is empty');
}
🤖 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 `@dogfooding/lib/screens/login_screen.dart` around lines 66 - 73, The
_loginWithName validation in login_screen.dart only checks
_userNameController.text with isEmpty, so whitespace-only input still passes and
later creates a blank-looking name/id via createValidId. Update _loginWithName
to trim the entered user name before validating and use the trimmed value
consistently for the error check and subsequent login flow. Keep the fix
localized around _loginWithName, _userNameController, and createValidId so names
containing only spaces are rejected.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 10.16%. Comparing base (a5eeb44) to head (1f6c37d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1272   +/-   ##
=======================================
  Coverage   10.16%   10.16%           
=======================================
  Files         679      679           
  Lines       49765    49765           
=======================================
  Hits         5059     5059           
  Misses      44706    44706           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renefloor renefloor closed this Jul 7, 2026
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.

1 participant