Repository navigation
Let accounts go by a name (FW-602) - #45
Merged
Merged
Conversation
The header on the landing page and /pricing gets an account slot beside the GitHub button: - Signed out, it reads Sign in, linking to /login. - Signed in, it shows the account's initial and address. A menu says who is signed in and offers Account, Console and Sign out. An account still on the waitlist gets Waitlist instead of Console. Signing out stays on the page and puts focus on Sign in; a sign-out that fails says so in the menu. - The landing page is prerendered with no session, so the slot keeps one width and shows nothing until the service answers. Someone signed in never sees Sign in flash by, and the links never move. If the service can't be asked, it offers Sign in. Below 1100px the slot narrows to the initial and the GitHub button to its mark, so the links fit as before. Below 851px the menu hangs from the header's right edge so it stays inside the window. The "How it works" menu's close-on-outside-press, Escape and tab-out handling moves into a useDismiss hook that both menus use, and its panel motion into lib/panel.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accounts kept only an email address, so the header could only show
that. Now an account can have a name:
- api: migration 0003 adds users.name, and the user the service
describes carries it (null until given). /auth/verify takes an
optional name, which names a new account or one without a name yet,
and never replaces one. A new POST /auth/profile sets or clears it
for the signed-in account. A name is trimmed, its runs of spaces made
one, and up to 80 characters; control characters and bidirectional
overrides are refused, before the code is tried, so a bad name
doesn't use up a try. The admin listing carries names too.
- site: /signup asks for an optional name above the address. /account
has a Name field to change or clear it. The header shows the name,
with the initials of its first and last words ("AL"), and the menu
shows the name above the address; without a name, both show the
address as before. The console's footer and the admin page show it
too. The in-browser demo keeps the name with its session.
Tests: api/test/profile.test.mjs covers giving, keeping, changing and
clearing a name, what's refused, the session and origin checks, and
the admin listing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pillOutline sits on shadcn's default Button variant, whose hover:bg-primary/80 it never overrode, so under the pointer an outlined button (Sign out on /account, Resend code and Use another address while signing in, Save name) turned near-black with its dark text unreadable. It now keeps its fill, and only its border darkens, as intended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Landed on preview through #47, which merged this branch together with the other two FW-60x PRs on top of the Paygate billing work. Your commits are unchanged. Changes made during the merge: the profile-name migration is renumbered to |
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.
What this does
FW-602: a profile name. Accounts kept only an email address. Now an account can go by a name, and the header shows it.
This PR builds on #44 (FW-601, the header sign-in), which should merge first. Until then, this PR's diff also shows that PR's commit,
780c547. This PR's own commits are90b0e98anda0b37ad.Service (
api/)0003_profile_name.sqladdsusers.name. The user the service describes carriesname, which isnulluntil it's given.POST /auth/verifytakes an optionalname. It names a new account, or one with no name yet, and never replaces an existing name.POST /auth/profile { name }sets the signed-in account's name; an empty name clears it.Site
/signup: an optional Your name field above the address./account: a Name field to change or clear the name.Also fixed (
a0b37ad): the outlined buttons (Sign out on/account, Resend code and Use another address while signing in) turned near-black on hover, which left their dark text unreadable.pillOutlinenever overrode shadcn's defaulthover:bg-primary/80. Now only the border darkens on hover, as intended.When it merges, in this order
npm --prefix api run migrate:remote, to add the column to the live database.npm --prefix api run deploy.The Worker's new code reads
users.name, so deploying it before the migration would break sign-in. The site copes with the Worker not being updated yet: it shows the address, and saving a name on/accountsays "Not found." until the deploy.Testing
npm --prefix api run check: 72 tests pass, 15 of them new, inapi/test/profile.test.mjs. They cover:npm --prefix site run checkpasses at both commits, anddocs/matches a rebuild./accountwith no name: saving one, keeping it after a reload, a refused name, clearing it, and a double-click saving only once.Merging with the other two PRs
#44 (FW-601), this PR and #43 (FW-603, open sign-up) each rebuild
docs/. Whichever merges second needs a rebuild, plus one test constant inapi/test/auth.test.mjs: it takesname: nullfrom this PR andwaiting: falsefrom FW-603. I merged all three locally and ran every check on the result: everything passes.🤖 Generated with Claude Code