Skip to content

🐛(frontend) prefill prejoin name from the user profile#1435

Open
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/prejoin-name-from-profile
Open

🐛(frontend) prefill prejoin name from the user profile#1435
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:fix/prejoin-name-from-profile

Conversation

@maartendra

Copy link
Copy Markdown
Contributor

Purpose

On the prejoin screen, the display-name field is sourced only from userChoicesStore (persisted to localStorage via LiveKit's loadUserChoices). 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 and useUser() (/users/mefull_name) exposes the name client-side.

Reported by a self-hosting deployment using OIDC (Authentik): users authenticate, meet_user.full_name is populated, yet the prejoin still demands a name on each refresh.

Changes

In src/features/rooms/components/Join.tsx:

  • Seed username from user.full_name when the user is logged in and hasn't set one yet, via saveUsername(...). Writing it to the store (not just the field) means the room/lobby requests (fetchRoom, useLobby) and LiveKit connect use it too.
  • Seed once (guarded by a ref) so it never fights a manual edit or a deliberate clear.
  • Done in an effect because useUser() can resolve after the prejoin mounts (e.g. a cold load straight to a room URL).
  • Switch the name Field from defaultValue to a controlled value={username} so a profile that resolves after mount is actually reflected (a defaultValue only applies on first mount).

Guests are unaffectedisLoggedIn is 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) ✅
  • Changelog entry added under [Unreleased] / Fixed.

🤖 Generated with Claude Code

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>
@maartendra maartendra force-pushed the fix/prejoin-name-from-profile branch from a082713 to c3a1fbd Compare June 22, 2026 16:55
@sonarqubecloud

Copy link
Copy Markdown

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