Skip to content

OpenBot Mobile: the app on Expo SDK 58, signed in with OAuth so it works on OpenBot Cloud - #2188

Merged
AlemTuzlak merged 15 commits into
mobilefrom
mobile-app
Nov 25, 2026
Merged

AlemTuzlak merged 15 commits into
mobilefrom
mobile-app

Conversation

@AlemTuzlak

Copy link
Copy Markdown
Contributor

The shared branch for OpenBot Mobile work, into mobile. Every session working on the app pushes here.

What's on it so far:

  • Expo SDK 58. Xcode 27 doesn't build SDK 55.
  • Sign-in with OAuth. The app signed in with Better Auth's cookie session and Google, Microsoft or Okta. OpenBot Cloud has none of those providers, and its CopilotKit sign-in can't hand a cookie back to the app, so the signed-out screen offered nothing to tap. Now:
    • The app signs in as the server's openbot-mobile OAuth client: authorization code with PKCE (S256), in the system browser's sign-in session, back to openbotmobile://oauth/callback.
    • The access token stays in memory. The refresh token is kept in SecureStore and rotates on every use, one refresh at a time.
    • Every API request sends Authorization: Bearer. A request refused with 401 is sent again once with a new token before the person is signed out.
    • Sign-out revokes both tokens.
    • /api/me says who is signed in. It is one of the four addresses outside /api/v2 that the API's token scheme names. It's added to STAYS in api/client-boundary.allow.ts, because it also answers somebody in no organization.
    • authClient.useSession() keeps its shape, so only Home's sign-in changed.

The UI work (Uniwind, HeroUI Native, the new screens) lands here next.

Needs openbot-backend mobile-app. OpenBot Cloud refuses the app's redirect until EXPO_PROJECT_ID is set there (config.push.projectId).

Checks

  • tsc, Biome, api/client-boundary.test.ts, and the copy tests pass. expo export for iOS and Android passes too (run on SDK 55, before the rebase).
  • 10 new protocol tests in mobile/tests/oauth.test.ts, plus a test for refreshing and resending a refused request.
  • 7 tests in mobile/tests already fail on mobile without this change: the version, organization-pick and renewal tests.

🤖 Generated with Claude Code

AlemTuzlak and others added 10 commits November 25, 2026 10:04
The app was on SDK 55, which Xcode 27 does not build, and the guidelines move it to the template's
SDK in a change of its own before any Uniwind work.

- Every Expo package at SDK 58's version, React Native 0.88 and React 19.3.
- expo-symbols is a direct dependency at the SDK's version: expo-router asks for it as an optional
  peer, and npm otherwise refused the install.
- TypeScript 6 lists no global types by default, so tsconfig names Node's for app.config.ts.
- StyleSheet.absoluteFillObject is gone in 0.88; the two gates use absoluteFill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app signed in with Better Auth's cookie session and social sign-in. OpenBot
Cloud has no social providers, and its hosted sign-in can't hand a cookie back
to the app, so the app showed nothing to tap there.

It now signs in as the server's `openbot-mobile` OAuth client: authorization
code with PKCE (S256) in the system browser's sign-in session, back to
openbotmobile://oauth/callback. The access token stays in memory for its hour.
The refresh token is kept in the secure store and rotates on every use, one
refresh at a time. Every API request sends the token as a bearer, and a
request refused with 401 is sent again once with a new token before the
person is signed out. Sign-out revokes both tokens. Who is signed in is read
from /api/me.

`authClient` keeps the `useSession` shape, so the screens are unchanged
except Home, which has one Sign in button in place of the provider buttons
and the SSO email field.

The server accepts the app's redirect only where EXPO_PROJECT_ID is set
(openbot-backend: config.push.projectId on OpenBot Cloud).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
….css

The styling stack docs/app-guidelines.md names for the phone app, added to mobile/ (no template
app generated):

- Uniwind and Tailwind 4, with Metro compiling mobile/global.css, the one stylesheet.
- HeroUI Native and what it draws with: Reanimated, Worklets, Gesture Handler, SVG, Keyboard
  Controller, tailwind-variants and tailwind-merge, expo-blur and True Sheet.
- @expo/ui for the platform's own switch and segmented control, react-native-drawer-layout for
  the app's menu, Inter (@expo-google-fonts/inter) and Tabler icons, the web app's face and set.
- global.css takes OpenBot's scheme under HeroUI Native's names, light and dark, written by
  `bun run tokens:generate`. The generator learns one more entry form, `--surface=card`: a CSS
  property under another library's name holding one of the scheme's tokens.
- Buttons are the web app's rounded rectangles, not HeroUI's pills, and fields have a hairline.
- src/uniwind-types.d.ts is what Uniwind writes for className's types; Biome leaves it alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mobile/src/components, drawn with Uniwind and HeroUI Native from the scheme, in the web app's look:

- Text (Inter, the type scale), Icon (Tabler at a 1.75 line), IconButton.
- BotOrb: a Bot's sphere in the palette its seed picks, the web app's own palettes
  (src/orb-palette.ts, held to app/src/lib/orb-palette.ts by a test), breathing while it works.
- Rows and Row: one card with hairline dividers, 32px icon tiles, a chevron or a control.
- ConversationRow, BotTile, PersonAvatar, Section, EmptyState, Notice.
- Message, MessageEvent and MessageDay: the person's words in a quiet bubble, a Bot's as plain
  text, as the web app draws them. Composer: the message box, lit while someone types in it.
- SearchBar, Toggle and Segmented (the platform's own), Screen, ScrollScreen and Refresh.

Icons come from src/icons.ts, each from its own file: Tabler's index put every one of its 6,000
icons in the bundle (13MB against 3.6MB). The development build shows every component at /gallery,
in light and dark. docs/app-guidelines.md and mobile/AGENTS.md say where the library is and its
rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nents

- Sign in: OpenBot's orb, a welcome, a button for each way this OpenBot lets people in, and
  email for a company's sign-in.
- Conversations (Home): each conversation with its Bot's orb, the Bots' names, its name and the
  last message; search and New conversation at the bottom. The organization, company sign-in,
  renewal and older-pages logic Home had stays; somebody held out or in no organization sees only
  the way forward.
- A conversation: the Bot in the header with its settings beside it, the day and time over
  messages after a pause, tool calls as quiet lines, a Bot picker when several are in it, and the
  message box over the keyboard. A message that fails to send goes back in the box.
- The menu from the left: Conversations, Bots, Routines, Memory, Skills, Connections, then Needs
  you and Approvals, and the person and their organization at the foot, which opens their account
  (organizations, notifications on this phone, sign out).
- Bots: two to a row, and New Bot (name, what it does, instructions). A Bot's page: its orb and
  name, then Conversations by day with New conversation, or Settings: Active, what needs you,
  its routines with their switches and Add routine, Memory, Skills, Apps and Approvals.
- Routines, every Bot's, under each Bot; Skills; Connections, which points to the computer.

The root layout loads Inter and wraps the app in Gesture Handler, Keyboard Controller and HeroUI
Native. Signed out shows only Sign in (Stack.Protected). The native header takes the scheme's
colors. No Computer screen is linked: for launch a Bot's computer is a tool call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Sign in is one Sign in button that runs signIn() (OAuth with PKCE in the system browser) and
  says a SignInError's sentence; closing the browser says nothing. The provider buttons and the
  work email field are gone with signInEnterprise.
- oauth/callback sits outside the signed-in guard, so a code that arrives while signed out still
  finds its way back.
- The account sheet signs out with authClient.signOut(), which no longer returns a result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A conversation open in OpenBot was marked read the moment a Bot replied,
even in a window behind others, or in OpenBot Desktop with nobody at the
computer. The reply then counted as seen, so nothing could tell the person
about it on their phone.

It is now marked read only while OpenBot is in sight (its page shown and its
window focused), and as soon as the person comes back to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ut the conversation on screen

Notifications were registered only when the person pressed Notifications in
Account, and the row said they were off again after every restart. A phone
whose push token Expo changed stopped getting them.

- A phone the person turned notifications on for registers again each time
  the app starts signed in, so a changed token replaces the old one. It never
  asks for permission there. Signing out forgets the phone's id, so it is not
  registered again until turned on.
- Account says whether notifications are on for this phone as it is now, and
  that Bots tell you when they finish as well as when they need you.
- A notification about the conversation on screen shows no banner and plays no
  sound; the conversation brings in what it says at once.
- A conversation open on the phone is marked read while the app is in front,
  as the web app does, so what the person read there is not told about again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Expo's default interface style is light only, so on a phone set to dark the app stayed light,
though every color in global.css has a dark value. Found on the iOS simulator: with the phone in
dark the app drew light until the gallery forced the dark theme. app.config.ts now asks for
"automatic"; a native build picks it up.

The gallery opens one part at a time, /gallery?only=messages&theme=dark, for a screenshot
without scrolling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AlemTuzlak and others added 5 commits November 25, 2026 11:19
…Home

Checked on the iPhone simulator, signed in to a stand-in OpenBot:

- Conversations: the search bar was hidden under the keyboard. The list and the bar now sit in a
  KeyboardAvoidingView, so the bar rides on the keyboard.
- A conversation: the message box rose with the keyboard but kept the home indicator's space under
  it, leaving a gap. KeyboardBar shrinks that space as the keyboard comes up, for both bars.
- New Bot and every other form: the page didn't make room for the keyboard, so Create sat under it
  and couldn't be scrolled to. ScrollScreen, and the older screens' Screen, are now
  KeyboardAwareScrollViews: the field in use stays above the keyboard, the rest can be scrolled to,
  and dragging down puts the keyboard away.
- Opening the app signed in landed on the component gallery in a development build: the screens
  were drawn while the session was still pending, with the signed-in ones guarded out. They now
  wait for the first answer about the session.

Swiping back, the menu's edge swipe, and swiping a sheet away already worked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…its choices stay open to be read (#2177)

(cherry picked from commit c7d0380)
…Bot's introduction

Compared with the web app at phone width, which the desktop app shows:

- Header buttons are plain icons, as the web app's header has them. On iOS 26 a custom header item
  sat in a glass bubble that read as a gray disc on OpenBot's background; plainHeaderLeft and
  plainHeaderRight hide it. The system's back button can't lose its bubble, so iOS gets a plain
  chevron in its place; swiping back works as before, and sheets have no back button.
- A conversation's header has the Bot's computer beside its settings, as on the web.
- The message box takes the web's shape: the text across the full width, attach on the left and
  speak and send on the right under it, in a rounder box.
- A conversation opens with the Bot it is with, its orb, name and what it does, as the web app's
  conversation does, in place of "Say hello".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app had no icon or splash of its own, and opening it showed up to five
screens in turn: Expo's splash, a blank frame while the fonts loaded, a white
cover while the security floor was read, a blank frame while the session was
checked, and a white spinner for up to 8 s while the version was checked.

- The icon and the phone's splash are OpenBot's orb, the desktop app's icon,
  on the scheme's background, light and dark.
- The app draws the splash's frame again over everything (src/launch.tsx) and
  keeps it until the fonts, the floor, the session and the version check have
  answered. The orb breathes while it waits, and a wait past 1.5 s says
  "Connecting to OpenBot…".
- Signed out, the orb glides into its place on Welcome and the words rise in
  after it. Signed in, or when the floor or the version check stops the app,
  the orb swells and fades. With Reduce Motion on, the cover fades and nothing
  moves.
- The screens wait for the first answer about the session, and each guard says
  where it sends a person: without redirectTo, expo-router picked the first
  unguarded screen by file name, so a start opened on the gallery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The breathing started in a passive effect, which waited for the JavaScript
thread while it loaded the app, so the orb sat still for most of a quick
start. It starts in a layout effect now, a little deeper, with a softer glow.

The cover also stays at least 700 ms, one breath out, so a quick start reads
as breathing then moving rather than a flicker, and it holds 120 ms after
everything has answered, so the glide doesn't start while the first screen's
native views are being drawn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AlemTuzlak
AlemTuzlak merged commit 7f79948 into mobile Nov 25, 2026
23 checks passed
@AlemTuzlak
AlemTuzlak deleted the mobile-app branch November 25, 2026 10:44
AlemTuzlak added a commit that referenced this pull request Nov 26, 2026
Conflicts:
- mark-read.ts: main's version, the reviewed form of what #2188 carried early (#2192).
- mobile-build.yml: mobile's version (#2203: production builds and store upload) over main's
  preview-only one (#2180).
- app-guidelines.md: mobile's rows for OpenBot Mobile, plus main's web manifest row.
- client-version cases and the mobile test: main's 9.0.0 minimums, with mobile's name OpenBot Mobile.
- CHANGELOG.md: both entries.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants