Skip to content

App: agree to the OpenBot Cloud terms before using it - #2002

Merged
davidmckayv merged 2 commits into
mainfrom
cloud-terms-screens
Nov 22, 2026
Merged

davidmckayv merged 2 commits into
mainfrom
cloud-terms-screens

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

OpenBot Cloud asks people to agree to its Terms of Service and Acceptable Use Policy before they use it, and again when the version changes. This adds the screen and the gate in the app, on the operations from #2000 (getServiceTerms, acceptServiceTerms).

  • The gate (_authed beforeLoad): right after the signed-in check and before onboarding, a person who has to agree is sent to /terms from anywhere, with where they were headed in ?next=. While they have to agree, /terms is let through past the gates after it (onboarding today, anything added later), so it is never bounced to onboarding.
  • The screen (/terms): onboarding's frame with a single step, so it reads as the first step of signing up. A heading, one sentence, and an unticked box: "I agree to the Terms of Service and Acceptable Use Policy", both names linking to the addresses the server gives, in a new tab (OpenBot Desktop opens those in the person's browser). Continue waits for the tick and shows it is sending; Sign out is the way out. Somebody who agreed to an earlier version sees "The terms have changed".
  • After agreeing: on to the page they were headed to, or home, which hands a new person to onboarding as before. next is followed only when it is a path in this app: an address with a scheme, //host or a backslash goes home.
  • Terms that change while the screen is open (409 SERVICE_TERMS_CHANGED): the terms are read again, the new version shows unticked, and the server's sentence says why.
  • When the read fails: an OpenBot without the operation (a 404 that isn't PERSON_NOT_FOUND) reads as no terms. Any other failure holds the person at the terms screen, which says it couldn't load them and offers Try again. A failed read never lets anybody past.
  • Self-hosted and the personal edition: current is null and acceptanceNeeded false, so the gate never fires and no screen is added.

Also in the shared onboarding frame: on a phone, scrolled to the end, a step's last line sat under the 32px fade above the pinned buttons, so Welcome's carousel dots (and the terms step's) were half hidden behind the first button. The footer now keeps 32px above it on a phone, the fade's own height. Desktop is unchanged.

Reads and writes go through the generated client, in lib/service-terms/queries.ts and mutations.ts. Accepting re-reads the terms with refetchType: "all", so the gate, which reads them through ensureQueryData, never sees a stale "has to agree".

Screenshots

The new test saves every screen with OPENBOT_APP_SHOTS=<dir>: the terms screen unticked and ticked, the changed version, and the Welcome step after agreeing, in Chromium and WebKit, light and dark, at 1440 and 390 wide, beside onboarding's Welcome from before to compare. Checked side by side with Welcome: same frame, heading, type, outlined row and buttons; at a phone's width both document names stay whole on their line.

OPENBOT_APP_BROWSER=1 OPENBOT_APP_ENGINES=chromium,webkit OPENBOT_APP_SHOTS=/tmp/terms-shots bun test app/tests/service-terms.test.tsx

Tests

app/tests/service-terms.test.tsx, in a real browser through the app's own _authed gate, the terms route and onboarding, with the server answering the spec's own examples and every body checked against the generated schemas:

  • a new Cloud person is sent to the terms from Settings, onboarding and home; the box starts unticked, Continue waits for it, both links point at the published pages in a new tab; ticking and Continue send {version: "2026-11-21"} with an Idempotency-Key, and onboarding's Welcome follows
  • a changed version (ServiceTermsChangedExample) asks again and then returns them to the page they were headed to
  • a 409 SERVICE_TERMS_CHANGED shows the new version unticked with the server's sentence, and agreeing sends the new version
  • a failed read holds the person at the terms with Try again
  • a forged next (https://evil.example/, //evil.example/) never leaves the app
  • self-hosted (ServiceTermsNoneExample) never shows the screen, /terms opened there goes home, and a new person goes to onboarding as before
  • an OpenBot without the operation (404) never shows it
  • on a phone, scrolled to the end, nothing on the terms step or on Welcome sits under the fade above the buttons (32px under it before the fix, for both)

It runs in CI's WebKit job (Chromium and WebKit). Locally: the new test in both engines, the whole app/ suite, lint, format check and typecheck.

OpenBot Cloud asks people to agree to its Terms of Service and
Acceptable Use Policy before they use it, and again when the version
changes. The signed-in gate now sends a person who has to agree to
/terms from anywhere, before onboarding, remembering where they were
headed. The screen is onboarding's frame with one step: an unticked box
naming both documents as links, Continue that waits for it, and Sign
out. Agreeing sends the version shown; terms that changed meanwhile
show the new version unticked with the server's sentence.

An OpenBot without the operation reads as having no terms. Any other
failed read holds the person at the terms screen with Try again, so a
failure never lets anybody past. Self-hosted and the personal edition
have no terms and never see the screen.
On a phone the buttons are pinned to the bottom with a 32px fade above
them, which says the step scrolls on. Scrolled to the end there is
nothing more, yet the step's last line still sat under the fade:
Welcome's carousel dots, and the terms step's, were half hidden behind
the first button. The footer now keeps 32px above it on a phone, the
fade's own height, so the last line stops above it.
@davidmckayv
davidmckayv merged commit 71a1152 into main Nov 22, 2026
34 checks passed
@davidmckayv
davidmckayv deleted the cloud-terms-screens branch November 22, 2026 02:03
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