Skip to content

feat(ui): Final step, a panel over Home until your agent is connected - #916

Merged
allisonmahmood merged 3 commits into
mainfrom
feat/final-step-panel
Oct 24, 2026
Merged

allisonmahmood merged 3 commits into
mainfrom
feat/final-step-panel

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #914, which is stacked on #913. Merge those first; the onboarding stack ships together.

What changed

The first-patch guide didn't convert:

  • It was Home itself in an empty company and a separate page everywhere else.
  • On a phone it read as seven steps.
  • It asked people to invent a first patch.
  • It never moved on without a reload.

Now, until someone has a live machine token, their real Home sits blurred behind one panel headed Final step: connecting an agent is the last step between them and Patchy. It has two steps, giving the agent the line and confirming it's you.

The panel follows along on Patchy's own records. It says You're set when the computer connects and lets go. Home then shows the first publication after that without a reload. There's no close button: Later puts the panel off for the rest of a sign-in. It comes back at each sign-in for the person's first week or first three sign-ins, whichever lasts longer. On a phone it's a bottom sheet that sends the address to their computer.

Closes #909. Part of #906.

Look at

  • The show rule (packages/auth/src/SetupPrompts.ts with migration 0026): one small table of the sign-ins (Clerk session ids) that reached Home. Rows are kept for everyone's first four and any in their first week, so someone who connected and later revoked every key never re-enters the window. Later is stored per sign-in.
  • Following along (packages/portal/src/guide.ts, /guide/steps, /assets/guide.js):
    • The steps come back as HTML from the same renderer as the page. They're swapped only when their state changes, every 3 s while the tab is visible.
    • Polling stops at the end or after 30 minutes, which offers Check again.
    • It reads machine tokens and the person's own patches directly, never DeviceLogins.lookup's budget.
    • There's no spinner.
  • The shell's modal slot (AppShell.overlay in packages/core/src/html.ts): the app card goes inert and blurs statically, with no animation. On a phone the panel is a bottom sheet.
  • Each state in a real browser, as Ben on a dev instance: a device login confirmed in a second tab, collected by its poll, then a publish with that key. The panel moved on by itself each time.
Copied Device page's new ending Connected, no reload
copied device confirmed connected
Welcome page live, in the panel Panel closed before publishing: Home takes the note itself Phone
live in the panel home watch phone

How it was verified

  • pnpm exec vitest run packages/portal packages/auth/src/DevicePages.test.ts packages/core apps/server/src/migrations.test.ts: 204 tests pass. New tests cover:
    • the panel over Home, with Later per sign-in, a cross-site POST refused, and a form from another account refused;
    • the first-week and first-three-sign-ins rule, including a connected person's sign-ins counting;
    • /guide and /guide/steps going waiting, then connected, then live, plus the watch mode;
    • the first-patch note's Open it.
  • pnpm typecheck and pnpm lint pass.
  • Not run locally: pnpm verify and the rollback rehearsal. CI runs both.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

Additive migration (one new table), new routes, and portal pages.

  • What does a revert leave behind? The setup_prompt_sign_ins table and its rows: sign-in ids and times for people's first few sign-ins.
  • Does the release before it still work with that? Yes. Nothing before this reads the table.

Before and after, as Ben Ortiz (member)

Before is bb0fd60 (where this branch left feat/setup-ends-on-welcome-page) and after is 8c388de (feat/final-step-panel), both on the team scenario, from pnpm dev compare.

Every page answered 200 with no browser errors.

/

1280px, after

After: / at 1280px

1280px, before

Before: / at 1280px

Width Before After
390px Before: / at 390px After: / at 390px

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:core Touches the core area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines labels Oct 23, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol (xhigh) reviewed this. One blocker and seven should-fixes, all fixed in 5756507:

  1. Blocker. On a phone, connecting left no visible way out of the panel. You're set and Go to now sit outside the steps list, so they show on every width. The live state keeps a Go button too. Phone, connected while open: focus moves to Go, and the announcer says "You're set".

connected on a phone

  1. Later before connecting lost the watch for the first publication. Home now watches after Later.
  2. Two new sign-ins arriving at once could both rank third. A new sign-in now takes a per-person advisory lock. A concurrency test covers it.
  3. The first publication was measured from the newest key's age and current ownership. It's now found by the publishing key (Patches.publishedWith), so a reassigned patch never counts.
  4. Focus starts on the first visible control (Send on a phone). It moves into the new state when the old control goes away, and the heading is focusable.
  5. One stable aria-live announcer, updated once per transition. You're set has role=status.
  6. Polling is one loop: no overlapping ticks, so no stale or out-of-order replies.
  7. The first-week Later test now posts with the sid it rendered. It asserts that sign-in stays dismissed while a fifth sign-in still shows.

allisonmahmood and others added 3 commits October 24, 2026 02:45
The guide was Home itself in an empty company and a separate page
elsewhere, read as seven steps on a phone, asked people to invent a
first patch, and never moved on without a reload. Now, until someone
has a live machine token, Home sits blurred behind one panel headed
Final step with two steps: give your agent the line and confirm it's
you. It follows Patchy's records every few seconds, says You're set
when the computer connects, and Home shows the first publication after
that without a reload. Later puts it off for the rest of a sign-in; it
comes back at each sign-in for the first week or three sign-ins,
whichever lasts longer. On a phone it's a bottom sheet that sends the
address to the person's computer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…long in one loop

From review: connected on a phone left no visible way out; Later lost
the watch for the first publication; two new sign-ins at once could both
rank third; the first publication followed the newest key's age and
current ownership rather than who published it; and the script could
double-poll, drop focus and announce nothing. The connected and live
states now keep Go outside the steps list, Home watches after Later, a
new sign-in takes a per-person advisory lock, publications are found by
the publishing key, and the script runs one loop with an announcer and
visible-first focus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit bd7eb8c into main Oct 24, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the feat/final-step-panel branch October 24, 2026 00:55
allisonmahmood added a commit that referenced this pull request Oct 24, 2026
…erson's Final step panel (#917)

Stacked on #916 (then #914, #913). Merge those first; the onboarding
stack ships together.

## What changed

The Final step panel could only notice the end of each step: any new
computer of the person's, then a patch of theirs. Nothing moved for
about a minute after the paste, and any old laptop counted.

The panel's line now carries a one-time **setup link**: `Set up Patchy
using <instance>/llms.txt?s=<link>`.
- The agent's fetch marks the line picked up, within seconds of the
paste.
- `/llms.txt` prints `patchy login --setup <link>`.
- The first login that line starts binds to it; a second contests it.
- The mint records which key it made and who confirmed it.

The panel follows those facts. When a setup can't finish, it says why
and offers **Get a new line**. Events carry a separate setup id, so one
person's setup reads as a single funnel in PostHog.

Closes #910. Part of #906.

## Look at

- **`packages/auth/src/SetupLinks.ts` and migration 0027.**
- A link is 128 random bits as 26 base32 characters, one live per person
for 30 minutes, reused across reloads.
- It keeps how its login ended: pending, denied, expired, contested,
connected, or confirmed by another account. Device logins are deleted
when they finish, so the outcome has to live here. A login that mints
after its line ran out ends expired.
  - `device_logins.setup_link_id` is nullable and `ON DELETE SET NULL`.
- **`DeviceLogins`.** `start` binds, `deny` marks denied, a login that
runs out marks expired before it is deleted, and the mint records the
key and the confirming user in its own transaction. `token.minted` gains
`setupId`.
- **The front door.** A narrow `SetupPickup` port, which
`apps/server/src/SetupPickup.ts` provides. The SDK gains no Auth
dependency. Pickups spend a per-address minute's budget
(`rate.setupPickup.perMinute`) before reaching the database. An unknown,
expired, over-budget or failing link serves the plain `/llms.txt`, so
setup never breaks.
- **The CLI.**
  - `patchy login --setup <link>` keeps the link in its pending login.
- A rerun with the same link resumes. A rerun with a different link (or
a link when none was pending) starts afresh and says the earlier code no
longer applies.
  - `--setup` with `--complete` is refused.
  - ADR-0004 and the README record this.
- **The panel's states, in a real browser.** Each moved on by itself on
a dev instance: the agent's fetch, then a login started with the link,
confirmed in another tab, then its key collected.

| Picked up | Login waiting | Confirmed, key not yet collected |
| --- | --- | --- |
| ![picked
up](https://github.com/user-attachments/assets/4fd0dec5-db9c-4c72-a746-5b2f22395887)
| ![login
pending](https://github.com/user-attachments/assets/995636cc-74e3-4647-a282-c6f89adc2ad9)
|
![confirming](https://github.com/user-attachments/assets/8fac1058-ed0d-40ee-b719-fb7abdee736f)
|

| Connected: this setup's key | Two logins used one line |
| --- | --- |
|
![connected](https://github.com/user-attachments/assets/bd9317de-11b7-4997-a218-14c03d1a3f5c)
|
![contested](https://github.com/user-attachments/assets/9cef85f9-7160-4342-a5e5-f53042d918b8)
|

## How it was verified

- `pnpm exec vitest run` across `packages/portal`, `packages/auth`, the
front door, the CLI's login, `packages/api`, `packages/limits`,
`packages/core`, Patches and the server's migration record: 1,121 tests
pass. New ones cover:
  - links: one live per person, pickup once, retire;
- binding, contested, denied, expired (by poll, and by a mint after the
line ran out), a contested line's mint, and the owner's mint against
another account's;
  - `token.minted`'s `setupId`;
- the front door's live, unknown and failing links, and the pickup
budget per address;
  - the CLI's same-link, new-link and legacy reruns;
- the panel following a line through every state, including a login that
runs out with nothing polling, plus Get a new line's origin and
stale-account refusals.
- `pnpm typecheck` and `pnpm lint` pass. `docs/API.md` and
`docs/limits.md` are regenerated, and the skill's lock hash is
refreshed.
- Not run locally: `pnpm verify` and the rollback rehearsal. CI runs
both.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

The API field and the CLI flag are optional and additive. The migration
adds a table and a nullable column.

- **What does a revert leave behind?** The `setup_links` table and
`device_logins.setup_link_id`. Old code never reads them.
- **Does the release before it still work with that?** Yes. Agents
holding the new `--setup` command would need the matching CLI, but
`/llms.txt` installs the instance's own release first.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 24, 2026
## What changed

This PR adds release 18's What's new entry, written from `b23e6ad`. It
covers everything merged since release 17's `through` (`5dd94f3`), and
it sets the `patchy` release to `0.18.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`. With this release,
onboarding ends in a Final step on Home that follows the person's agent
through setup and lets them confirm it right there (#906).

| Change | PRs |
| --- | --- |
| New: A Final step to connect your AI agent | #916, #917 |
| New: Confirm your computer without leaving Home | #918 |
| Improved: Setting up ends with your first page | #914 |
| Improved: The logo takes you Home | #913 |
| Behind the scenes: the first time someone opens a colleague's tool is
counted, for activation | #915 |

One merged PR gets no line: #905 is release 17's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. Its labels are the pages' own: Final
step, Later, Not me, Home, Patches.
- **Rollback safety, from the live commit `a049a3c` to `b23e6ad`.**
- No PR in the range is labelled `one-way`, and every PR answers both
Release impact questions with "Yes".
- Migrations 0026 and 0027 are additive: the `setup_prompt_sign_ins` and
`setup_links` tables, and a nullable `device_logins.setup_link_id` with
`ON DELETE SET NULL`. Release 17 never reads them.
  - `rollback-rehearsal` exercised both migrations on the landed heads:
- #916: `Exercised rollback paths passed: a049a3c → 6037d86 → a049a3c →
6037d86, in 234s.`
- #917: `Exercised rollback paths passed: a049a3c → d03a5bf → a049a3c →
d03a5bf, in 217s.`
- #918 and #915 change no migration or handler descriptor, so they had
nothing to rehearse.
- A rollback takes the Final step panel and setup links away. Home goes
back to the old guide, and a CLI at `0.18.0` stays usable against
release 17: `--setup` is only sent when `/llms.txt` prints it, and
release 17's `/llms.txt` doesn't.

## How it was verified

- `pnpm typecheck` and `pnpm lint` pass, and so do `packages/core`,
`packages/api`, `packages/portal` and the skill lock test (245 tests),
including `whatsNew.test.ts`, `schemas.test.ts` and
`WhatsNewPages.test.ts`.
- The live commit was pinned from `/healthz/deep`: `a049a3c`, release
17. The Deploy run updated last succeeded, and none is unfinished.
- Each PR in the range was read, including its Release impact answers.
All six landed with the reviewed trees: each squash left `main`'s tree
identical to its PR's reviewed head.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

This PR changes only the changelog text and the `patchy` version. As
with every release, a CLI installed before this deploy is told to
upgrade.

- **What does a revert leave behind?** Nothing. People whose seen marker
reached 18 would just see no new release.
- **Does the release before it still work with that?** Yes.

If this release misbehaves, roll back to
`a049a3cf544ae89691eec547dea46773febfdf05` (release 17).

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Touches the core area area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ui): Final step, a panel over Home until your agent is connected

1 participant