Skip to content

App guidelines, and one color scheme every app is written from - #2070

Draft
guidovizoso wants to merge 5 commits into
mainfrom
guido/app-guidelines
Draft

guidovizoso wants to merge 5 commits into
mainfrom
guido/app-guidelines

Conversation

@guidovizoso

Copy link
Copy Markdown
Collaborator

What this changes

Guidelines for the people starting on the phone app and working on the web app and OpenBot Desktop, plus the color work the guidelines rest on. Three commits; each stands on its own.

  1. Warning and success are theme tokens. There is a new --warning token, light and dark, for what needs the person: something waits on them, or may not go as they expect.
    • 225 amber and emerald classes across the web app and the Recorder become warning and success classes (text-warning, bg-success/10 and so on). Their dark: overrides go, because the token carries the dark value.
    • app/tests/color-scheme.test.ts fails on an amber or green class anywhere. It also fails on any other Tailwind palette class in a file that didn't already have one. The 12 files that still have one are listed, and the list only gets shorter.
  2. @openbot/tokens: one color scheme, written into every app's copy.
    • tokens/src/scheme.ts holds every color, light and dark, and what each one means.
    • bun run tokens:generate writes it into the copies of the apps that can't import the package:
      • the web app's theme.css, and the live orb in styles.css;
      • OpenBot Desktop's setup window, its sign-in page and its first paint;
      • the phone app's new src/scheme.ts, in hex, since React Native can't draw oklch().
    • In a hand-written file, the generator writes only between two marker comments.
    • tokens/tests/generated.test.ts fails when a copy differs from what the scheme writes. It runs with the normal test suite.
    • The Recorder's in-page notice imports the package directly.
    • The phone app's colors.ts reads the scheme, except for one blue kept for tappable words.
  3. docs/app-guidelines.md, linked from AGENTS.md, mobile/AGENTS.md and docs/README.md:
    • The color scheme: every app draws with the scheme's tokens only, mostly neutral, and each color means one thing. The page lists where the copies live, the tests that enforce them, and the two known exceptions.
    • The phone app: it is not a clone of the desktop app. For launch it covers Bot screens, conversations and routines, and a Bot's computer shows as a tool call.
    • Its stack: what mobile/ has today, plus Uniwind and HeroUI Native. The move to Expo's newest SDK comes first, as a change of its own. The platform draws the chrome and HeroUI Native draws the content, and a table maps HeroUI Native's color names to the scheme's.

Only the web app's color values are the same as before. The phone app's red, gray, border, green and amber are now the scheme's values. The light warning is a darker amber than text-amber-600, which was hard to read on white.

Where it runs

Nothing on the server changes.

  • New state that outlives a request? None.
  • What happens on the second replica? Nothing different: no server code changes.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: no change.
  • New refusals and new failures each write a row: there are none.
  • Nothing new is trusted from the client.

API and database

  • This changes nothing under api/, no app's requests, no database change and no release-policy.json.

Changelog

  • A line in CHANGELOG.md under Unreleased, Smaller changes: warnings and successes are drawn with the theme's colors.

Proof

  • bun test on the new and changed tests: the tokens package, the color-scheme, design-token and skins tests, the Recorder's notice tests and the five tests that check the new classes. 141 pass, 0 fail after rebasing on main.
  • The test files that read theme.css (theme preference, reduced motion, onboarding) pass.
  • bun run typecheck: every workspace passes, including tokens.
  • bunx biome format . and bunx biome lint --error-on-warnings . are clean.
  • bun install --frozen-lockfile accepts the lockfile. It only adds the new workspace.
  • rustfmt --check passes on the two Rust files. The first paint's RGB values are the same as before, byte for byte.

Not done yet, which is why this is a draft:

  • I haven't looked at the recolored screens in a browser, light and dark, or at the phone app on a device.
  • I haven't run the phone app's typecheck, because its npm packages weren't installed in my checkout.
  • mobile/global.css isn't generated yet: it gets added to tokens/src/targets.ts when Uniwind goes in.
  • On the full suite, app/tests/add-model-key-link.test.tsx failed once. It passes on its own, and this branch doesn't touch it.

… tokens, never amber or green

A new --warning token, light and dark, for what needs the person: something waits on them, or may
not go as they expect. 225 amber and emerald classes across the web app and the Recorder become
the warning and success tokens, and their dark: overrides go, since the token carries the dark
value. app/tests/color-scheme.test.ts fails on an amber or green class anywhere, and on any other
palette class in a file that didn't already have one; those files are listed, and the list only
gets shorter.
tokens/src/scheme.ts holds every color, light and dark, and what each one means. bun run
tokens:generate writes it into the copies of the apps that can't import it: the web app's
theme.css and the live orb, OpenBot Desktop's setup window, sign-in page and first paint, and the
phone app's src/scheme.ts in hex. In a hand-written file it writes only between two marker
comments. tokens/tests/generated.test.ts fails when a copy isn't what the scheme writes. The
Recorder's in-page notice imports the package. The phone app's colors come from the scheme but one
blue, kept until its screens move to Uniwind.

The values are the ones theme.css had; the desktop's first paint comes out byte for byte the same.
…ne app is for, and its stack

docs/app-guidelines.md, pointed to from AGENTS.md, mobile/AGENTS.md and docs/README.md. Every app
draws with the scheme's tokens only, mostly neutral, a color meaning one thing. The phone app is
not a clone of the desktop app: for launch it is Bot screens, conversations and routines, and a
Bot's computer is a tool call. Its stack is what mobile/ has, plus Uniwind and HeroUI Native, after
moving to Expo's newest SDK on its own; the platform draws the chrome and HeroUI Native the content.
…he management agent's image copies its manifest for the frozen install

This branch has not been deployed

No deployments
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