Skip to content

feat(profile): optional display name on register + nudge banner#49

Merged
amrtgaber merged 1 commit into
mainfrom
feat/display-name-suggest
May 27, 2026
Merged

feat(profile): optional display name on register + nudge banner#49
amrtgaber merged 1 commit into
mainfrom
feat/display-name-suggest

Conversation

@amrtgaber
Copy link
Copy Markdown
Contributor

Frontend slice of #46. Login-by-username (#46 step 3) is deferred — it depends on auth-api work that hasn't shipped yet.

What's in this PR

  1. Optional Display-name input on `/register` — between confirm-password and the TOS checkbox. Empty submission is fine. If provided, PATCH `/auth/me` after the auto-login completes. Failures are swallowed so a transient PATCH error doesn't undo a successful registration; the nudge below will re-prompt.
  2. Nudge banner at the top of `/profile` — fires when `display_name` is null, dismissible per session via `sessionStorage`. Auto-disappears once a name is set. Doesn't interrupt the cross-origin redirect flow because new users registering through a consumer-app link typically bounce out before reaching `/profile`.

What's deferred

  • Login by email-or-username — needs the auth-api to support the alternate lookup. Separate companion issue to open when the backend is scoped.
  • Username as a distinct concept from display_name — the issue body discusses same-vs-separate; this PR doesn't take a position because step 1 + 2 don't depend on the answer.

OAuth users

Google and Steam OAuth users already get `display_name` auto-populated from the provider profile by the auth-api, so the banner only fires for password registrants who skipped the optional field. The issue mentioned suggesting it to Google OAuth users specifically — that's covered transitively (if their Google profile somehow lacked a name, they'd see the nudge on /profile).

Test plan

  • `pnpm test:run` — 49 tests pass (3 new for the nudge: shows when null, hides when set, dismisses for the session).
  • `pnpm exec tsc -b` clean.
  • Locally: `/register` with a display name → `/profile` shows the name in the navbar.
  • `/register` without a display name → `/profile` shows the nudge banner.
  • Dismiss the nudge → gone for the session. Refresh → gone. New session → returns.

Frontend slice of #46. Login-by-username (#46 step 3) is deferred —
it depends on auth-api work that hasn't shipped yet.

- Add an optional Display-name input on /register, between confirm-
  password and the TOS checkbox. Empty submission is fine. If
  provided, PATCH /auth/me after the auto-login completes. Failures
  are swallowed so a transient PATCH error doesn't undo a successful
  registration — the /profile nudge below will re-prompt.
- Add a nudge banner at the top of /profile when display_name is
  null. Dismissible per session via sessionStorage, auto-disappears
  once a name is set. Doesn't interrupt the cross-origin redirect
  flow because new users registering through a consumer-app link
  (e.g. hera-streamer-…) typically bounce out before reaching
  /profile.

OAuth (Google/Steam) users already get display_name auto-populated
from the provider profile by the auth-api, so the banner only fires
for password registrants who skipped the optional field.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 27, 2026

Deploy Preview for criticalbit-auth-web ready!

Name Link
🔨 Latest commit 870cba0
🔍 Latest deploy log https://app.netlify.com/projects/criticalbit-auth-web/deploys/6a16799cf74805000876f2a0
😎 Deploy Preview https://deploy-preview-49--criticalbit-auth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber amrtgaber merged commit cca5cf1 into main May 27, 2026
6 checks passed
@amrtgaber amrtgaber deleted the feat/display-name-suggest branch May 27, 2026 04:58
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