Skip to content

fix(ui): label the login field "Username or email" to match the backend - #3040

Open
jianyx1 wants to merge 2 commits into
Chainlit:mainfrom
jianyx1:fix/login-username-label
Open

jianyx1 wants to merge 2 commits into
Chainlit:mainfrom
jianyx1:fix/login-username-label

Conversation

@jianyx1

@jianyx1 jianyx1 commented Sep 6, 2026

Copy link
Copy Markdown

The login form labels its first field "Email address", but the backend
@cl.password_auth_callback receives any username string, and the docs
use username — users are confused when the UI says "Email" while the
backend accepts any string.

Align the UI with the backend:

  • relabel the field "Username or email" in all 23 locale files
  • update the required-field message to match
  • rename the frontend's email identifiers to username
    (the request payload already sends username, so nothing changes
    on the wire)

The placeholder "me@example.com" is left unchanged: it is a format
example, not a restriction.

Non-English strings follow each locale file's existing wording and may
need native-speaker review.

Verification:

  • cd backend && uv run pytest --cov=chainlit → 932 passed
  • cd frontend && pnpm test → 32 passed (5 files)
  • pnpm type-check → frontend + react-client pass
  • pnpm lint on the changed files → clean

Closes #2902

Co-Authored-By: Claude noreply@anthropic.com


Summary by cubic

Relabels the login form's first field from "Email address" to "Username or email" so the UI matches the backend, which accepts any username string. The request payload already sends username, so nothing changes on the wire.

  • Updates the label and required-field message in all 23 locale files.
  • Renames the frontend's email identifiers to username, including the input's id/name attributes.
  • Updates all Cypress selector references to match the renamed field.
  • Leaves the placeholder me@example.com unchanged as a format example.
  • Non-English strings follow each locale's wording and may need native-speaker review.

Closes #2902.

Written for commit 739365b. Summary will update on new commits.

Review in cubic

The login form labels its first field "Email address", but the backend
@cl.password_auth_callback receives any username string and the docs
use `username`. Align the UI with the backend: relabel the field
"Username or email" in all 23 locales, update the required-field
message, and rename the frontend's `email` identifiers to `username`
(the request payload already sends `username`).

The placeholder "me@example.com" is left unchanged: it is a format
example, not a restriction.

Closes Chainlit#2902

Co-Authored-By: Claude <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 25 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/LoginForm.tsx">

<violation number="1" location="frontend/src/components/LoginForm.tsx:109">
P2: Renaming the input's id from `email` to `username` breaks the Cypress e2e login flow in cypress/e2e/data_layer/spec.cy.ts:8, which still selects `#email` (`cy.get(SELECTORS.EMAIL_INPUT)` at line 35). This repo's verification (pnpm test / type-check / lint) doesn't cover Cypress, so the break ships unnoticed. Update the spec's SELECTORS.EMAIL_INPUT to `#username` (or keep the id stable) in the same change.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

</Label>
<Input
id="email"
id="username"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Renaming the input's id from email to username breaks the Cypress e2e login flow in cypress/e2e/data_layer/spec.cy.ts:8, which still selects #email (cy.get(SELECTORS.EMAIL_INPUT) at line 35). This repo's verification (pnpm test / type-check / lint) doesn't cover Cypress, so the break ships unnoticed. Update the spec's SELECTORS.EMAIL_INPUT to #username (or keep the id stable) in the same change.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/LoginForm.tsx, line 109:

<comment>Renaming the input's id from `email` to `username` breaks the Cypress e2e login flow in cypress/e2e/data_layer/spec.cy.ts:8, which still selects `#email` (`cy.get(SELECTORS.EMAIL_INPUT)` at line 35). This repo's verification (pnpm test / type-check / lint) doesn't cover Cypress, so the break ships unnoticed. Update the spec's SELECTORS.EMAIL_INPUT to `#username` (or keep the id stable) in the same change.</comment>

<file context>
@@ -102,24 +102,26 @@ export function LoginForm({
               </Label>
               <Input
-                id="email"
+                id="username"
                 disabled={loading}
                 autoFocus
</file context>

Renaming the login field from `email` to `username` changed both the
input's `id` and its `name` attribute, which broke the Cypress specs
that selected `#email` / `input[name='email']`. Update all twelve
selector references so the e2e suite matches the renamed field.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 14 days with no activity.

@github-actions github-actions Bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 21, 2026

This branch has not been deployed

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

Labels

stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Login form label says 'Email address' but backend accepts any username

1 participant