🐛(frontend) prefill prejoin name from the user profile#1435
Open
maartendra wants to merge 1 commit into
Open
Conversation
The prejoin name field was sourced only from userChoicesStore (persisted to localStorage), so an authenticated user who had not manually typed a name was shown an empty, required field and asked to enter their name on every join/refresh -- even though their profile name is available via useUser() (/users/me, full_name). Seed the username from user.full_name when the user is logged in and has not set one yet (once, so it never fights a manual edit), writing it to the store so the room/lobby requests use it too. Switch the field to a controlled value so a profile that resolves after the screen mounts is still reflected. Guests are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a082713 to
c3a1fbd
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Purpose
On the prejoin screen, the display-name field is sourced only from
userChoicesStore(persisted tolocalStoragevia LiveKit'sloadUserChoices). Nothing seeds it from the authenticated user's profile, so a logged-in user who hasn't manually typed a name is shown an empty, required field and asked to enter their name on every join / refresh — even though the backend already knows them anduseUser()(/users/me→full_name) exposes the name client-side.Reported by a self-hosting deployment using OIDC (Authentik): users authenticate,
meet_user.full_nameis populated, yet the prejoin still demands a name on each refresh.Changes
In
src/features/rooms/components/Join.tsx:usernamefromuser.full_namewhen the user is logged in and hasn't set one yet, viasaveUsername(...). Writing it to the store (not just the field) means the room/lobby requests (fetchRoom,useLobby) and LiveKit connect use it too.useUser()can resolve after the prejoin mounts (e.g. a cold load straight to a room URL).FieldfromdefaultValueto a controlledvalue={username}so a profile that resolves after mount is actually reflected (adefaultValueonly applies on first mount).Guests are unaffected —
isLoggedInis false, so nothing is seeded and the field behaves exactly as before.Checks
npm run lint(eslint,--max-warnings 0) ✅panda codegen && tsc -b(typecheck) ✅[Unreleased] / Fixed.🤖 Generated with Claude Code