Repository navigation
feat(identity): ask "Connect to your community" — sign in or bring a key — for a community no tenant hosts - #1808
Closed
matt2e wants to merge 1 commit into
Conversation
… for a community no tenant hosts Implements plan note 83762c25 on top of 6762695. Nothing of it existed before this commit: no ConnectChoice.tsx, no "connect-choice" pause, committed or uncommitted, so the plan is implemented as written with the four decisions taken: the button reads "Connect with Builderlab", the same as the landing; a key created for a community Block does not host is still linked to the Builderlab account and backed up there; Cancel sign-in after Connect returns to the landing with the URL kept; the heading is "Connect to {host}" and the footer button "Back". When discovery finds a community that discoverAuthentication answers `none` for (no tenant row by hostname or NIP-11 `self`, or a non-default port), first run no longer runs "Creating keys…" on its own and lands on Join Community with a key nobody chose. Setup pauses on a new page: Finding community ─► Connect to {host} Connect with Builderlab ─► the landing's own sign-in at BUZZ_BUILDERLAB_URL (Cancel sign-in, field disabled and held) ─► Checking your account… ─► Checking for a backed-up key… ─► Set up your key / Welcome back, every existing choice ─► Join Community for the found address I already have a key ─► Enter your private key ─► Importing your key… ─► Join Community (no link step, no backup offer) Back ─► Connect to {host} Back ─► landing, address kept, no second lookup - ConnectChoice.tsx (new, stateless): heading, a body saying the relay cannot sign the user in but Buzz still needs a key, Connect with Builderlab (primary, lg), I already have a key (sm, the same contrast KeyChoice uses) and a Back footer. Shared owner reused: Button. No new tokens, components or variants. - setup.ts: SetupPause gains "connect-choice"; createKey's comment no longer describes a key-only lane. No store change. - Welcome.tsx: onFound pauses on "connect-choice" instead of starting createKey. paused() is now two-phase: the two pauses reachable before any sign-in (connect-choice, key-import) render before the `reads.current` guard, then the five post-sign-in pages as before. Connect is `setup.reset(); void signIn()`: reset is legal from paused and signIn publishes pending synchronously, so one render shows the landing's existing pending view, and from there every path is the Connect-without- URL lane (reads at the build portal, backup offered there, the dev seed applying). The key-import case derives "no account this run" from `reads.current === undefined`: Back then returns to the connect choice, and a successful import is `setup.start([])`, resting at done so the kept address renders Join Community. The linked and new-account import paths are unchanged; `link` is built inside that branch when an account exists. Every return to the landing still goes through backToLanding. - builderlab-tenants.ts: the doc comment's "key-only" rationale now says no portal is chosen and the welcome screen asks; the matching rules and the `none` answer are unchanged. The tenants test row is renamed. QR: a scanned non-hosted community reaches this page through the same setFinding path as a typed URL, with no scanner-specific code. Failures are the existing ones: a refused identity_import stays under the import field with the key kept; after Connect, an account-check failure before a key goes Back to the landing, and a link or backup failure after "Creating keys…" offers Try again / Continue without linking or backup and lands on Join Community for the address. Failure, SKIPPED, KeyChoice, KeyImport and FindCommunity are untouched. Tests (identity.test.tsx): the key-only journey is replaced by six on the existing landingRelay fixture (relay.example.com:8443 misses the table by port), through a shared connectChoicePage helper: - the choice with no sign-in and no identity_create, Back keeping the address, invoke = restore + the two GETs; - Connect from the choice: connect(signal, undefined), Cancel sign-in with the field disabled and held, account built at the build portal, Set up your key, Create my key with backUp(viewer), Join Community, Cancel to Join a community prefilled; - Cancel sign-in after Connect: landing, address kept, signal aborted, no re-entry into discovery or the choice; - I already have a key: any valid nsec accepted with its npub preview, Back to the choice (not Set up your key), reopened empty, Importing your key… behind a held identity_import, Join Community as the imported key, no Back up this key?, connect and account never called; - a native import refusal staying under the field, Back to the choice; - (beside the tenant sibling, where linkedTo lives) Connect from the choice as a linked account: Welcome back at the build portal, import, Not now, Join Community. All six fail against HEAD's Welcome.tsx and setup.ts (checked by running a copy of the test against HEAD's files under temporary names) and pass here. No ConnectChoice unit test, as for KeyChoice and WelcomeBack; setup.test.ts needs nothing. Docs: docs/identity.md describes the page, both choices and where Back lands, and no longer speaks of key-only setup (the import's blank profile name and the consent paragraph say "without a Builderlab sign-in"); docs/configuration.md, .env.example and the Builderlab README say an unmatched URL asks rather than setting up a key only. Shared worktree: another session's uncommitted known-communities work (the `known` ref and three-argument checkAccount in Welcome.tsx and setup.ts, knownCommunities stubs in identity.test.tsx, and its edits to builderlab-account.*, first-run-seed.*, setup.test.ts, vite-config.test.mjs and the same four docs) is left unstaged, untouched and uncommitted; only this change's hunks were staged, through `git add -p`. The staged test file was run against the staged Welcome.tsx and setup.ts (103 tests pass) as well as against the working tree. Diff: production +118/−33 across ConnectChoice.tsx (53 new lines), Welcome.tsx, setup.ts and builderlab-tenants.ts, against the plan's ≈+80/−12; the excess is the paused() restructure moving the five existing cases under a second switch, plus doc comments. Tests +335/−17, docs +19/−9. No FOUNDATION file (App.tsx, services.ts, main.tsx, communities/service.ts, plugins/api.ts), no Rust, no new dependencies. Validation on the working tree: `bin/pnpm vitest run src/features/identity` (13 files, 365 tests), `tsc --noEmit`, `pnpm lint` (0 errors, pre-existing infos only), `biome check` on the six changed source and test files, `pnpm design:check`, `git diff --cached --check`. Nothing was run in the native app: neither Connect from the choice nor an import before any sign-in has ever run natively, so the first real run should use a non-tenant relay (the throwaway Caddy relay from note f72cf6f3) after resetting this branch's Keychain slot. Squashed for the stacked PR — 3f8efb2 (fix(identity): lead the Connect to {host} page with why Buzz needs a key): fix(identity): lead the Connect to {host} page with why Buzz needs a key Copy change to the first-run **Connect to {host}** page from eba834b, per feedback on project note 4925261e. The body framed the choice around a limitation of the relay ("{host} isn’t hosted by Builderlab, so it can’t sign you in. Buzz still needs a private key for you. …"). It now leads with what Buzz actually needs, and says nothing about what the relay can or cannot do. The final body, exactly: Buzz relies on a key for your identity. Connect with Builderlab to create and back one up, or bring a key you already have. Unchanged: the heading "Connect to {host}", the primary lg "Connect with Builderlab" and the small secondary "I already have a key" buttons, their order, the Back footer, and all behaviour. The component's doc comment still records the pause's rationale for developers. - src/features/identity/ConnectChoice.tsx: the body paragraph only. - identity.test.tsx: the one connect-choice journey that pinned the old body ("isn’t hosted by Builderlab") now asserts the new lead sentence; the other five journeys through connectChoicePage check the heading and buttons only and need no change. - docs/identity.md: the Connect to {host} paragraph now says the page leads with why a key is needed and offers two ways to get one. Shared worktree: another session's uncommitted known-communities work (Welcome.tsx, setup.*, builderlab-account.*, first-run-seed.*, vite-config.test.mjs, 14 lines of identity.test.tsx, the docs/identity.md known-communities paragraph, .env.example, configuration.md, the README) was left unstaged and untouched; only these three hunks were staged with `git add -p`. No FOUNDATION file (App.tsx, services.ts, main.tsx, communities/service.ts, plugins/api.ts), no Rust, no new dependencies. Validation on the working tree: `bin/pnpm vitest run src/features/identity` (13 files, 365 tests), `tsc --noEmit`, `biome check` on ConnectChoice.tsx and identity.test.tsx, `git diff --cached --check`. Not exercised in the native app; the change is copy only. Squashed for the stacked PR — 4946410 (fix(identity): trim the Connect to {host} body to one sentence): fix(identity): trim the Connect to {host} body to one sentence Copy trim to the first-run **Connect to {host}** page, following f06994a. The body's second sentence ("Connect with Builderlab to create and back one up, or bring a key you already have.") is removed and not replaced; it restated the two buttons beneath it. The final body, exactly: Buzz relies on a key for your identity. Unchanged: the heading "Connect to {host}", the primary lg "Connect with Builderlab" and small secondary "I already have a key" buttons, their order, sizes and variants, the Back footer, and all behaviour. - src/features/identity/ConnectChoice.tsx: the body paragraph only. - identity.test.tsx: the connect-choice journey that matched the body with a prefix regex now asserts the exact full string "Buzz relies on a key for your identity.", so a second sentence cannot return unnoticed. - docs/identity.md: the Connect to {host} paragraph no longer says the page "offers two ways to get one"; it says the page says only that Buzz relies on a key for the user's identity and lists the two choices. Reflowed to the file's 80-column wrap. Shared worktree: another session's uncommitted known-communities work (Welcome.tsx, setup.*, builderlab-account.*, first-run-seed.*, vite-config.test.mjs, its hunks in identity.test.tsx and docs/identity.md, .env.example, configuration.md, the README) was left unstaged and untouched; only these three hunks were staged with `git add -p`. No FOUNDATION file (App.tsx, services.ts, main.tsx, communities/service.ts, plugins/api.ts), no Rust, no new dependencies. Validation on the working tree: `bin/pnpm vitest run src/features/identity` (13 files, 365 tests), `tsc --noEmit` (exit 0), `biome check` on ConnectChoice.tsx and identity.test.tsx, `git diff --cached --check`. Not exercised in the native app; the change is copy only. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
This was referenced Oct 28, 2026
Closed
matt2e
marked this pull request as ready for review
October 28, 2026 12:26
Contributor
Author
|
🤖 Closing: this stack was cut as chronological slices of the branch history rather than logical, independently reviewable layers. It will be replaced by a stack built from the squashed diff. Nothing from this PR was merged. |
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.
Part 7 of 12 of the
onboarding-flowstack (the first-run onboarding work reviewed on #1061, split into stacked PRs per the plan). Base:onboarding/06-unlink-restore-create-my-key. Each PR is a contiguous slice of the original branch's history, cherry-picked ontomain; the combined tree of the whole stack equalsonboarding-flowat572d69398rebased ontomain(verified by diff, see the stack notes in the last PR). Built onmainatdf5180b4a(2026-10-28, theorigin/mainof the build);mainhas moved on since and the stack is not rebased onto the newer tip.Stack
onboarding/01-welcome-find-joinonboarding/02-profile-step-landing-urlonboarding/03-builderlab-tenantsonboarding/04-key-choice-import-welcome-backonboarding/05-link-and-native-backuponboarding/06-unlink-restore-create-my-key7. feat(identity): ask "Connect to your community" — sign in or bring a key — for a community no tenant hosts #1808
onboarding/07-connect-choice← this PRonboarding/08-invite-links-known-communitiesonboarding/09-onboarding-layouts-and-copyonboarding/10-navigation-deadlineonboarding/11-review-fixesonboarding/12-do-not-merge-keychain-slotScope
ConnectChoice.tsx, theconnect-choicepause, the two-phasepaused()inWelcome, and thebuilderlab-tenants.tsdoc comment. Replaces PR 03's silent key-only lane with a Connect to {host} page offering sign-in or an existing key.Squash vs the original branch: the two copy follow-ups (
3f8efb2d3,4946410d2) folded intoac665e492. The later title fix (572d69398) stays in PR 11, because it post-dates the layout / focus / alias rewrites of this page.Checks at this level (worktree
/tmp/onb-stack, head ofonboarding/07-connect-choice)bin/pnpm exec tsc --noEmit— 0 errorsbin/pnpm lint— 0 errors (21 pre-existing infos)bin/pnpm design:check— all checks passgit diff --check origin/main...HEAD— cleanbin/pnpm vitest run src/features/identity— 13 files, 352 tests passed, 0 failedNative evidence — not claimed here
No per-level native run was performed for this PR. Native first-run testing happens on the tree of the final DO-NOT-MERGE PR of the stack (#1813), which carries the isolated debug Keychain slot; the human in-app check for this PR's behaviour is owed there, so this PR stays a draft without
buzz-review-completeduntil Matt confirms it.🤖 Generated with Claude Code