diff --git a/packages/git-ui/README.md b/packages/git-ui/README.md index 98483f2..f96886a 100644 --- a/packages/git-ui/README.md +++ b/packages/git-ui/README.md @@ -197,8 +197,12 @@ servers, one repository, and the records to read. ## Reviewing from the page -The header holds the visitor's session: sign in with a handle or DID, on -whichever server holds the account, beside the site owner's identity. The app +The header holds the visitor's session: who they are and the way out, or a +button that opens a dialog asking for a handle or DID. Signing in is the one +thing on the page that leaves it, so the dialog has room to say where the +visitor is going, what their words are written to, and what failed when +something does. The header had room for none of that: a form there widened the +bar as it opened and left an error to be read from a tooltip. The app is an atproto OAuth client with no backend, PKCE for the code and DPoP for the token, the same client shape `@pdsjs/spaces-ui` uses. The scope asks for exactly the two collections a participant writes, reviews and pull requests. diff --git a/packages/git-ui/src/components/molecules/session-controls.jsx b/packages/git-ui/src/components/molecules/session-controls.jsx index 9d10868..40fe1bb 100644 --- a/packages/git-ui/src/components/molecules/session-controls.jsx +++ b/packages/git-ui/src/components/molecules/session-controls.jsx @@ -1,17 +1,25 @@ +import { Dialog } from '@base-ui/react/dialog'; import { useState } from 'react'; -import { Button } from '#/components/atoms/button.jsx'; +import { Button, buttonVariants } from '#/components/atoms/button.jsx'; import { Handle } from '#/components/molecules/handle.jsx'; +import { account } from '#/lib/git.js'; import { beginSignIn } from '#/lib/oauth.js'; import { useSession } from '#/lib/session.jsx'; +import { cn } from '#/lib/utils.js'; /** * The visitor's session, in the header: a sign-in affordance, or who they * are and the way out. * * The site's own account sits beside this and stays what it is, the identity - * being browsed. This is the identity doing the browsing, on whichever - * server holds it; signing in navigates to that server's consent page and - * back. + * being browsed. This is the identity doing the browsing, on whichever server + * holds it; signing in navigates to that server's consent page and back. + * + * The form asks in a dialog rather than in the header. Signing in is the one + * thing on this page that leaves it, so it is worth a moment's attention and + * room to say where the visitor is going and what fails when it does. The + * header has room for neither: a form there widened the bar as it opened and + * left an error to be read from a tooltip. */ export function SessionControls() { const { session, endSession } = useSession(); @@ -36,14 +44,6 @@ export function SessionControls() { ); } - if (!open) { - return ( - - ); - } - const submit = async (event) => { event.preventDefault(); setBusy(true); @@ -57,38 +57,88 @@ export function SessionControls() { }; return ( -
++ Your words are written to your own repo, never to {account.handle} + 's. This repository decides whose it shows. +
+ + + ); }