Conversation
Replace confusing "Email Address / Username" placeholder with just"Email Address" and add a contextual hint for Jellyfin/Emby instancesexplaining that users without an email set can use their username.
Add a description below the Password heading explaining that thispassword is for the local login form and is separate from the mediaserver password.
…ling media server login Show a warning toast after importing Plex/Jellyfin/Emby users thatimported accounts do not have a local password set. Also show awarning on the user settings page when media server sign-in isdisabled, as affected users may be locked out.
Distinguish between wrong credentials (403) and actual server errors(500) in the local login form instead of showing a generic "Something went wrong" message for both.
…odal Move UserWarnings from the sidebar to the main layout so it is visibleon all screen sizes. Rewrite AddEmailModal to use the profile settingsendpoint instead of Jellyfin auth, allowing users to set their emaildirectly from the banner without navigating away. fix #1108
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughUserWarnings removed from the Sidebar and added into the main Layout; UserWarnings now opens an in-place AddEmailModal to collect missing emails. AddEmailModal, login, import modals, settings, and i18n strings were updated for email-driven flows and improved error/toast handling. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Layout as Layout Component
participant UserWarnings as UserWarnings Component
participant Modal as AddEmailModal
participant API as Backend API
participant UserCtx as User Context
User->>Layout: Load page
Layout->>UserWarnings: Render UserWarnings
UserWarnings->>UserWarnings: Detect profile incomplete
User->>UserWarnings: Click "Profile is incomplete" button
UserWarnings->>Modal: Open AddEmailModal
User->>Modal: Submit email
Modal->>API: GET /api/v1/user/:id/settings/main
API-->>Modal: Return settings payload
Modal->>API: POST /api/v1/user/:id/settings/main (with updated email)
alt Success
API-->>Modal: 200 OK
Modal->>UserCtx: call revalidate()/mutate
UserCtx-->>Modal: user/settings refreshed
Modal->>User: show success toast & close
else InvalidEmail
API-->>Modal: error (InvalidEmail)
Modal->>User: show "email already taken" toast
else Other error
API-->>Modal: error
Modal->>User: show generic failure toast
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
The i18n check failed because translation messages are out of sync. This usually happens when you've added or modified translation strings in your code but haven't updated the translation file. Please run |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/Login/AddEmailModal.tsx`:
- Around line 63-70: Add an early guard to avoid calling axios.get/post and
mutate when user or user.id is missing: check the local AddEmailModal handler
(where axios.get(`/api/v1/user/${user?.id}/settings/main`), axios.post(...), and
mutate(...) are invoked) and return early or throw if user or user.id is falsy
before making the API requests; ensure you reference the same variables (user,
user.id, values.email) and only call axios.get/axios.post/mutate when user.id is
defined.
In `@src/components/Login/LocalLogin.tsx`:
- Line 25: Update the credential error message in the LocalLogin component by
changing the credentialerror string to a neutral form that supports username
fallback (e.g., "The username or password is incorrect."); locate the
credentialerror entry in the LocalLogin.tsx translations/labels object and
replace the current "The email address or password is incorrect." text with the
new neutral wording, ensuring any other usages of credentialerror remain
compatible.
In `@src/i18n/locale/en.json`:
- Line 1370: The message key components.UserList.importedUsersNoPassword
contains a hardcoded "Plex sign-in"; update the string to use the
{mediaServerName} placeholder instead (same pattern as
disabledMediaServerLoginWarning) so it correctly displays the media server name
for Plex/Jellyfin/Emby imports; locate the key
components.UserList.importedUsersNoPassword in src/i18n/locale/en.json and
replace the literal text "Plex sign-in" with "{mediaServerName} sign-in" (or the
equivalent placement) while preserving the existing {applicationTitle}
placeholder and punctuation.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0f2a944c-a146-47bc-acad-fbecd8bcfcc8
📒 Files selected for processing (10)
src/components/Layout/Sidebar/index.tsxsrc/components/Layout/UserWarnings/index.tsxsrc/components/Layout/index.tsxsrc/components/Login/AddEmailModal.tsxsrc/components/Login/LocalLogin.tsxsrc/components/Settings/SettingsUsers/index.tsxsrc/components/UserList/JellyfinImportModal.tsxsrc/components/UserList/PlexImportModal.tsxsrc/components/UserProfile/UserSettings/UserPasswordChange/index.tsxsrc/i18n/locale/en.json
💤 Files with no reviewable changes (1)
- src/components/Layout/Sidebar/index.tsx
| typeof errors.email === 'string' && ( | ||
| <div className="error">{errors.email}</div> | ||
| )} | ||
| {(settings.currentSettings.mediaServerType === |
There was a problem hiding this comment.
Is there any way this message could be displayed only if this is actually a possible concern (i.e. only if there are users that don't have an email set)?
There was a problem hiding this comment.
We will have to query the db for all users and check if the email is valid or not
There was a problem hiding this comment.
Yeah, good point, it might not be worth the tradeoff there. Just thought it might be a bit cleaner.
There was a problem hiding this comment.
Yeah, good point, it might not be worth the tradeoff there. Just thought it might be a bit cleaner.
I also thought of doing that. But that just creates extra latency/performance overhead just for a hint helper text 😔
Description
This PR addresses several UX pain points around local login, particularly for Jellyfin/Emby instances where usernames are used in place of email addresses.
The local login form placeholder has been changed from "Email Address / Username" to just "Email Address", with a contextual hint shown for Jellyfin/Emby instances explaining that users without an email set can use their username.
The password settings page now clarifies that the password is for local login and is separate from the media server password.
Admins are now warned when importing users that imported accounts don't have a local password set, and a warning is shown on the user settings page when disabling media server sign-in, since this could lock out users who haven't set a local password.
The local login error message now distinguishes between invalid credentials and actual server errors instead of showing a generic "Something went wrong" for both.
The email required warning has been moved from the bottom of the sidebar (where it was easy to miss and invisible on mobile) to a banner in the main content area. Clicking the banner opens a modal that lets users set their email directly without navigating away from the current page.
How Has This Been Tested?
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit
New Features
Documentation