Skip to content

Fix the flaky audit filter browser test: style the menu before pressing Bot - #2177

Merged
davidmckayv merged 1 commit into
mainfrom
fix/audit-filter-submenu-stays-open
Nov 25, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
fix/audit-filter-submenu-stays-open

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The browser test "each says the server's sentence calmly, in chromium, 1440, light" in app/tests/organization-unavailable-chat.test.tsx failed now and then in CI: on main's run 45542599809 and on #2171's run 45545231902. When it failed, the audit log's Bot filter read as the page's own text instead of "OpenBot is moving this organization. Try again in a moment."

The cause was the test, not the app. The test harness styles the page only for the classes it draws at the moment it styles. So a menu that has just opened is drawn unstyled until the next styling pass. The test pressed Bot in the unstyled Add filter menu, then styled the page to take its screenshot. That made the Add filter menu move and shrink under the pointer. The browser told the menu the pointer had left, and Bot's choices closed, just as they do when a person moves off them. The test then read the choices while they were fading out (about 200 ms). It passed when the machine was faster than the fade and failed when it was slower.

The earlier note that a submenu opened by a press closes when its choices fail is the same effect, not an app bug. With the menu styled as the app draws it, Bot's choices stay open when they fail. I checked a held read and a failed read, each answering 1.2 seconds after the press while the menu showed "Loading…". In Chromium the choices closed 0 times in 8 runs for each. In WebKit, the held read closed 0 times in 8. The app is unchanged.

What changed in the test:

  • The Add filter menu is styled as soon as it opens, so Bot is pressed where the app draws it.
  • The test waits for the menu to say the sentence, and reads it from that wait. The fixed 300 ms pause, the three-attempt reopen loop and the read that fell back to the page's text are gone.
  • The hover on Bot before measuring the red failure is gone.
  • Both audit filter checks now also require Bot's choices to still be open after the page is styled and measured (aria-expanded on Bot). With the old order (styling after the press), that check fails every time at 1440 wide. Three of the five Chromium cases fail on open: false: the calm check at 1440 light and dark, and the red check. At 390 wide the menu doesn't move off the pointer. With the new order all five pass.

Proof, from headless runs on a Mac, each in its own process:

main's test this test
Chromium, 1440 light, 50 runs 0 failed 0 failed
WebKit, 1440 light, 50 runs 0 failed 0 failed
Chromium, 1440 light, 52 runs with 8 at a time, as CI runs 8 files at once 1 failed 0 failed

On an idle Mac the read lands inside the fade, so main's test passes. Under load it failed the way CI did, with the page's text ("Activity / Review Bot actions… / Ask / View / Everything…") in place of the sentence. The new open check doesn't depend on timing: it catches the closed menu on every run. In CI, the changed-file job ran all 18 cases of this file in Chromium and WebKit, and all passed.

@davidmckayv
davidmckayv force-pushed the fix/audit-filter-submenu-stays-open branch from d9ab90b to a434f45 Compare November 25, 2026 05:10
@davidmckayv
davidmckayv merged commit c7d0380 into main Nov 25, 2026
18 checks passed
@davidmckayv
davidmckayv deleted the fix/audit-filter-submenu-stays-open branch November 25, 2026 05:17
AlemTuzlak pushed a commit that referenced this pull request Nov 25, 2026
…its choices stay open to be read (#2177)

(cherry picked from commit c7d0380)
AlemTuzlak added a commit that referenced this pull request Nov 25, 2026
…rks on OpenBot Cloud (#2188)

* OpenBot Mobile: move to Expo SDK 58

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]>

* OpenBot Mobile: sign in with OAuth, so it works on OpenBot Cloud

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]>

* OpenBot Mobile: Uniwind, HeroUI Native and the color scheme in global.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]>

* OpenBot Mobile: a component library, and a gallery of it

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]>

* OpenBot Mobile: the screens in Tyler's plan, drawn with the new components

- 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]>

* Mark a conversation read only while the person can see it

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]>

* OpenBot Mobile: stay registered for notifications, and stay quiet about 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]>

* OpenBot Mobile: follow the phone's light or dark setting

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]>

* OpenBot Mobile: fields stay above the keyboard, and the app opens on 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]>

* Audit filter test: style the Add filter menu before pressing Bot, so its choices stay open to be read (#2177)

(cherry picked from commit c7d0380)

* OpenBot Mobile: plain header buttons, the web's message box, and the 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]>

* OpenBot Mobile: open from the icon to Welcome in one movement

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]>

* OpenBot Mobile: the launch orb breathes from the first frame

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]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: David McKay <[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.

1 participant