+ {/* The one-liner and the overview: two blocks of one group, 12px apart (the Rhythm table). */}
+
{skill.summary ?
{skill.summary}
: null}
diff --git a/app/src/components/memory/memories.tsx b/app/src/components/memory/memories.tsx
index 121ceca4a6..3eaf769f14 100644
--- a/app/src/components/memory/memories.tsx
+++ b/app/src/components/memory/memories.tsx
@@ -8,6 +8,7 @@ import {
PageRows,
PageSection,
} from "@/components/layout/page-shell";
+import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -201,9 +202,9 @@ function dayOf(iso: string, now: Date = new Date()): string | null {
/** "Needs review", as a label: the fact waits on the person, so it is drawn in `warning`. */
function NeedsReview() {
return (
-
+
Needs review
-
+
);
}
diff --git a/app/src/components/organizations/organization-settings-page.tsx b/app/src/components/organizations/organization-settings-page.tsx
index 5f47e28cd9..76947b97af 100644
--- a/app/src/components/organizations/organization-settings-page.tsx
+++ b/app/src/components/organizations/organization-settings-page.tsx
@@ -234,42 +234,34 @@ function PlanRow() {
) : null}
{/*
- * An employee admin can pay for the members who aren't employees. Under the bar, not
- * beside it, so the bar keeps its width in a narrow window.
+ * An employee admin can pay for the members who aren't employees. Whole on a phone
+ * too: a row's description stops at two lines.
*/}
{employeePaysForOthers(plan) && plan.addCardUrl ? (
- <>
- {/* Whole on a phone too: a row's description stops at two lines. */}
-
- {OTHERS_NEED_A_CARD}
-
-
- {cardAction(plan)}
-
- >
+
+ {OTHERS_NEED_A_CARD}
+
) : null}
- {/*
- * Once most of it is used, where the server sent the way to add a card. Under the bar,
- * as the employee's button is, so the bar keeps its width in a narrow window.
- */}
- {trialRunningLow(plan) && plan.addCardUrl ? (
+
+ {/*
+ * The way to add a card, where the server sent one: once most of the trial is used, or
+ * for an employee admin, who can pay for the members who aren't employees. In the row's
+ * actions, on the right, on a line of their own under the bar, so the bar keeps its width
+ * in a narrow window.
+ */}
+ {(employeePaysForOthers(plan) || trialRunningLow(plan)) &&
+ plan.addCardUrl ? (
+
{cardAction(plan)}
- ) : null}
-
+
+ ) : null}
>
);
diff --git a/app/src/components/plan/card-needed-dialog.tsx b/app/src/components/plan/card-needed-dialog.tsx
index ffe1ddeba4..475412173f 100644
--- a/app/src/components/plan/card-needed-dialog.tsx
+++ b/app/src/components/plan/card-needed-dialog.tsx
@@ -4,6 +4,7 @@ import sentry from "@/assets/sentry.webp";
import { AbstractAvatar } from "@/components/agents/abstract-avatar";
import { IconCheck, IconPlayerPause } from "@/components/icons";
import { PersonAvatar } from "@/components/organizations/person-avatar";
+import { Badge } from "@/components/ui/badge";
import { Button, buttonVariants } from "@/components/ui/button";
import {
Dialog,
@@ -74,7 +75,7 @@ import { queryClient } from "@/query-client";
/**
* Bots can't run until a card is added: the free trial is used up, or the last payment failed.
- * Top to bottom: the person's Bots, faded, marked Paused; the title, and a line with the size of
+ * Top to bottom: the person's Bots, marked Paused; the title, and a line with the size of
* the trial the server sent, how many Bots that paused and that nothing is lost; the trial's bar,
* full. An admin then gets a plan card (the price and what adding the card does) and the one way
* on (`addCardUrl`, the server's verdict on who may add a card) with Not now beside it. A member gets the owners and admins to ask, as rows
@@ -217,8 +218,9 @@ export function CardNeededDialog() {
const BOTS_SHOWN = 4;
/**
- * The person's Bots, faded and overlapping, with a Paused pill: what the stop means, shown. Up to
- * four, and the rest counted.
+ * The person's Bots, overlapping, with a Paused badge: what the stop means, shown. Up to four, and
+ * the rest counted on a circle the size of an avatar. The badge says they are paused, so the
+ * avatars keep their own colors rather than a faded shade of their own.
*/
function PausedBots({ bots }: { bots: readonly AgentProfile[] }) {
const shown = bots.slice(0, BOTS_SHOWN);
@@ -229,7 +231,7 @@ function PausedBots({ bots }: { bots: readonly AgentProfile[] }) {
{shown.map((bot, index) => (
0 && "-ml-2.5",
)}
key={bot.id}
@@ -243,10 +245,10 @@ function PausedBots({ bots }: { bots: readonly AgentProfile[] }) {
) : null}
-
-
+
+
Paused
-
+
);
}
@@ -265,7 +267,7 @@ function PlanCard() {
-
+
{PRICE_AMOUNT}
{" "}
{PRICE_PER}
@@ -316,6 +318,11 @@ function AdminsToAsk({
{shown.map((admin, index) => (
{index > 0 ? : null}
+ {/*
+ * Flush with the label above and the dialog's title: every `Item` size pads 10px or more
+ * in from the sides, and none has no inset. These rows are read, not pressed, so there is
+ * no hover fill for the padding to make room for.
+ */}
diff --git a/app/src/components/plugins/broker-directory.tsx b/app/src/components/plugins/broker-directory.tsx
index 8a6a3fa3ca..f2f93862c7 100644
--- a/app/src/components/plugins/broker-directory.tsx
+++ b/app/src/components/plugins/broker-directory.tsx
@@ -102,6 +102,9 @@ import { connectionsQueryOptions } from "@/lib/plugins/queries";
/** Placeholder rows while the directory loads: enough to fill the view, not to suggest a count. */
const LOADING_ROWS = ["a", "b", "c", "d", "e", "f"];
+/** The results' section on Browse apps, which a category or "Browse all apps" scrolls back to. */
+const RESULTS_ID = "directory-results";
+
/** Where the directory was opened from: a person's Connections, or Admin's Apps. */
export type DirectoryPlace = "connections" | "admin";
@@ -207,17 +210,18 @@ export function BrokerDirectory({
enabled: !showFeatured,
});
const toolbar = React.useRef(null);
- const results = React.useRef(null);
function choose(next: DiscoveryCategory | null, showAll = false) {
setCategory(next);
setAll(showAll);
setSearch("");
setQuery("");
- if (results.current && toolbar.current) {
+ // Back to the results' title when it has scrolled up under the stuck toolbar.
+ const results = document.getElementById(RESULTS_ID);
+ if (results && toolbar.current) {
const bottom = toolbar.current.getBoundingClientRect().bottom;
- if (results.current.getBoundingClientRect().top < bottom) {
- results.current.style.scrollMarginTop = `${toolbar.current.offsetHeight}px`;
- results.current.scrollIntoView({ block: "start" });
+ if (results.getBoundingClientRect().top < bottom) {
+ results.style.scrollMarginTop = `${toolbar.current.offsetHeight}px`;
+ results.scrollIntoView({ block: "start" });
}
}
}
@@ -272,6 +276,11 @@ export function BrokerDirectory({
...entries.filter((entry) => entry.appId !== null),
]
: entries;
+ /*
+ * Browse apps lays the directory out as a grid of separate cards, not one `PageRows` list: the
+ * layout skill's accepted Connections tiles precedent, because apps are picked out by their mark
+ * rather than read down a list. Admin's directory stays a list of rows.
+ */
const Rows = discover ? "div" : PageRows;
/*
* WHERE AN ADDED KEY VERSION'S PAGE IS, beside the sign-in it was offered under. Its key form opens
@@ -314,7 +323,6 @@ export function BrokerDirectory({
return (
header+nav+*]:mt-0" : undefined}
backButton={
discover
? undefined
@@ -326,58 +334,39 @@ export function BrokerDirectory({
{discover && (
<>
-
-
+ {/*
+ * The chosen category is `secondary`, pressed: the filled main variant stays the
+ * toolbar's Add, the page's one filled button.
+ */}
+
-
@@ -472,7 +479,7 @@ export function BrokerDirectory({
{listed.map((entry, index) => {
@@ -499,17 +506,8 @@ export function BrokerDirectory({
>
-
- {entry.title}
-
-
+ {entry.title}
+
{entry.summary}
diff --git a/app/src/components/plugins/plugin-logo.tsx b/app/src/components/plugins/plugin-logo.tsx
index 8c86a3f882..87c3249b06 100644
--- a/app/src/components/plugins/plugin-logo.tsx
+++ b/app/src/components/plugins/plugin-logo.tsx
@@ -1,16 +1,16 @@
import { appKey } from "@openbot/shared/audit-filters";
import type * as React from "react";
import { useState } from "react";
-import githubLogo from "@/assets/brands/github.svg";
import notionLogo from "@/assets/brands/notion.svg";
import { IconBrandGoogleDrive, IconPlug } from "@/components/icons";
import { cn } from "@/lib/utils";
/**
- * ON A WHITE TILE IN DARK MODE, BECAUSE SOME MARKS DISAPPEAR WITHOUT ONE. GitHub's mark is black,
- * and on the dark page it all but vanished. A vendor's artwork is never recoloured, so dark mode
- * gives every mark a white tile instead: the same rule the framework marks follow
- * (`agents/harness-mark.tsx`). Every mark reads on white.
+ * ON A WHITE TILE IN DARK MODE, BECAUSE SOME MARKS DISAPPEAR WITHOUT ONE. A logo loaded from an
+ * address is a picture with its colors baked in, and a black one all but vanished on the dark page.
+ * A vendor's artwork is never recoloured, so dark mode gives every loaded mark a white tile instead:
+ * the same rule the framework marks follow (`agents/harness-mark.tsx`). Every mark reads on white.
+ * A mark bundled in the code (`BundledMark`) takes `currentColor` and needs no tile.
*/
export const LOGO_TILE = "rounded-sm dark:bg-white dark:p-0.5";
@@ -25,18 +25,45 @@ export function appVendorLogo(id: string): string | undefined {
}
/**
- * GitHub's mark for its account tile and page, bundled like Notion's, so it is the same in every
- * organization and loads nothing from outside. Slack has none bundled yet: its tile keeps its own
- * icon, which a logo address loaded from the directory left blank in WebKit.
+ * A mark drawn in the code rather than loaded as a picture: an SVG that takes `currentColor`, so it
+ * follows light and dark, a skin and a customer's theme, and needs no white tile.
+ */
+export type BundledMark = (props: { className?: string }) => React.ReactNode;
+
+/**
+ * GitHub's Invertocat, from GitHub_Logos.zip at https://brand.github.com/foundations/logo, drawn
+ * in `currentColor`. It was a black picture on a white tile in dark mode; as a shape it takes the
+ * tile's own text color in either theme, as every other glyph on these tiles does.
+ */
+export function GithubMark({ className }: { className?: string }) {
+ return (
+
+ );
+}
+
+/**
+ * GitHub's mark for its account tile and page, bundled, so it is the same in every organization and
+ * loads nothing from outside. Slack has none bundled yet: its tile keeps its own icon, which a logo
+ * address loaded from the directory left blank in WebKit.
*/
export function identityVendorLogo(
provider: "github" | "slack",
-): string | undefined {
- return provider === "github" ? githubLogo : undefined;
+): BundledMark | undefined {
+ return provider === "github" ? GithubMark : undefined;
}
/**
- * An app's logo, or its initial where it has none.
+ * An app's logo, or its initial where it has none. The logo is an address to load, or a mark
+ * bundled in the code (`BundledMark`), which draws in the text color with no tile.
*
* The initial rather than a generic plug because a list of apps that all show the same plug is a
* column of identical tiles, which tells nobody anything; "T" and "G" at least tell Todoist from
@@ -47,12 +74,16 @@ export function PluginLogo({
name,
fallback,
}: {
- logo?: string | null;
+ logo?: string | BundledMark | null;
name?: string;
/** Drawn instead of the initial when there is no logo or it fails: a vendor's own icon. */
fallback?: React.ReactNode;
}) {
const [failedUrl, setFailedUrl] = useState(null);
+ if (typeof logo === "function") {
+ const Mark = logo;
+ return ;
+ }
if (!logo || failedUrl === logo) {
if (fallback) return fallback;
return name ? : ;
diff --git a/app/src/components/responsibilities/goal-page.tsx b/app/src/components/responsibilities/goal-page.tsx
index 90640ff4ef..195855a58b 100644
--- a/app/src/components/responsibilities/goal-page.tsx
+++ b/app/src/components/responsibilities/goal-page.tsx
@@ -262,45 +262,41 @@ export function GoalPage({
return (
-
- action.mutate({
- id: goal.id,
- action: active ? "resume" : "pause",
- })
- }
- />
-
- {goal.status === "active" ? "On" : "Paused"}
-
-
- )
- }
- description={
- <>
-
- {summaryFor(goal, triggers.data, routines)}
-
- {/* What starts it. A paused goal's summary already says nothing does. */}
- {goal.status === "active" ? (
- {`Its ${starters} start it.`}
- ) : null}
- >
- }
+ description={summaryFor(goal, triggers.data, routines)}
title={goal.title}
>
- {/* What else can be done to it. The page title names it, so this first section has no heading. */}
+ {/* What can be done to it now. The page title names it, so this first section has no heading. */}
+ {goal.status !== "completed" ? (
+ <>
+
+
+ On
+
+ {goal.status === "active"
+ ? `Its ${starters} start it.`
+ : `Paused. Its ${starters} won't start it.`}
+
+
+
+ {/* Binary and immediate: it takes effect when switched, there is no save. */}
+
+ action.mutate({
+ id: goal.id,
+ action: active ? "resume" : "pause",
+ })
+ }
+ />
+
+
+
+ >
+ ) : null}
{goal.status === "active" ? (
<>
+
+ {
+ remove.reset();
+ setConfirmingDelete(true);
+ }}
+ title="Delete goal"
+ />
{action.error ? (
@@ -528,21 +534,6 @@ export function GoalPage({
- {/* Away from the everyday controls, at the bottom. */}
-
-
- {
- remove.reset();
- setConfirmingDelete(true);
- }}
- title="Delete goal"
- />
-
-
-
+ // More than one value, so a screen of its own: the same fields New routine asks for.
+
+ }
+ size="lg"
+ variant="outline"
+ >
+
+ Edit
+
}
backButton={{ label: "Routines", linkProps: back }}
description={
@@ -354,15 +343,42 @@ export function RoutinePage({
>
{/* What it does, word for word: New routine's What to do. */}
-
-
{does}
-
+
+
+
+
+ {does}
+
+
+
+
- {/* What can be done with it besides switching and editing. The page title names it, so this
- section has no heading. */}
+ {/* What can be done to it now. The page title names it, so this section has no heading. */}
+
+
+ On
+
+ {routine.enabled
+ ? "It runs on its schedule."
+ : "Paused. It won't run on its schedule."}
+
+
+
+ {/* Binary and immediate: it takes effect when switched, there is no save. */}
+
+ setEnabled.mutate({ id: routine.id, enabled })
+ }
+ />
+
+
+
>
) : null}
+
+ {
+ remove.reset();
+ setConfirming(true);
+ }}
+ title="Delete routine"
+ />
{setEnabled.error || runNow.error ? (
@@ -494,27 +520,6 @@ export function RoutinePage({
- {/* Away from the everyday controls, at the bottom, as Delete is on every other settings page. */}
-
-
- {
- remove.reset();
- setConfirming(true);
- }}
- title="Delete routine"
- />
-
-
-
-
-
{/* It names the routine as its heading and its row do, never its schedule, which two can share. */}
diff --git a/app/src/components/routines/routines-home.tsx b/app/src/components/routines/routines-home.tsx
index 6a129f76ce..b91874f741 100644
--- a/app/src/components/routines/routines-home.tsx
+++ b/app/src/components/routines/routines-home.tsx
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { AnimatePresence } from "motion/react";
import { LoadingRows } from "@/components/layout/loading-rows";
-import { PageShell } from "@/components/layout/page-shell";
+import { PageSection, PageShell } from "@/components/layout/page-shell";
import { BotGroupSection } from "@/components/routines/bot-group";
import { RoutineBox } from "@/components/routines/routine-box";
import { Unfold } from "@/components/routines/unfold";
@@ -71,10 +71,10 @@ export function RoutinesHome() {
examples={empty ? EXAMPLES : undefined}
/>
-
- {/* One read failing leaves the others listed, and says which part is missing. */}
- {failed.length > 0 ? (
-
+ {/* One read failing leaves the others listed, and says which part is missing. */}
+ {failed.length > 0 ? (
+
+
{loadFailure(
[
routines.error,
@@ -86,21 +86,24 @@ export function RoutinesHome() {
`Couldn't load your ${failed.join(" and ")}. Try again in a moment.`,
)}
- ) : null}
- {/* Pending draws the list's shape; rows already read stay while they refetch. */}
- {pending ? (
+
+ ) : null}
+ {/* Pending draws the list's shape; rows already read stay while they refetch. Each Bot's group
+ is a section of the page, 48px under what is above it. */}
+ {pending ? (
+
- ) : (
- // A Bot's first routine opens its group; its last one removed folds it away.
-
- {groups.map((group) => (
-
-
-
- ))}
-
- )}
-
+
+ ) : (
+ // A Bot's first routine opens its group; its last one removed folds it away.
+
+ {groups.map((group) => (
+
+
+
+ ))}
+
+ )}
);
}
diff --git a/app/src/components/routines/schedule-when.tsx b/app/src/components/routines/schedule-when.tsx
index fea1eb95c4..d4ef085a04 100644
--- a/app/src/components/routines/schedule-when.tsx
+++ b/app/src/components/routines/schedule-when.tsx
@@ -67,7 +67,6 @@ export function ScheduleWhen({
describe,
keep,
label = "When",
- lead,
}: {
form: RoutineForm;
/** The picker's label: When on New routine, Schedule where it changes one. */
@@ -77,8 +76,6 @@ export function ScheduleWhen({
timeError?: string;
/** What follows the sentence under the picker: where the time is read, and anything else to say. */
describe?: ReactNode;
- /** A control drawn first on the picker's line, as New routine's Starts is. */
- lead?: ReactNode;
keep?: {
/** The schedule as its row says it. */
words: string;
@@ -93,8 +90,8 @@ export function ScheduleWhen({
return (
{label}
+ {/* One line of controls: how often, the day and the time are one answer. */}
- {lead}
{(field) => (
- }
backButton={{ label: "Routines", linkProps: back }}
description={[setting.subject ? botName : null, setting.focus]
.filter(Boolean)
.join(" · ")}
title={setting.subject || `${botName}'s check-ins`}
>
- {/* Where it stands and how often it looks. The page title names it, so this section has no heading. */}
+ {/* What can be done to it now. The page title names it, so this section has no heading. */}
@@ -211,6 +190,29 @@ export function CheckInPage({
+
+
+ On
+
+ {setting.enabled
+ ? "It looks on its own, and tells you when something needs you."
+ : "Paused. It won't look until you turn it on."}
+
+
+
+ {/* Binary and immediate: it takes effect when switched, there is no save. */}
+ {
+ if (next !== setting.enabled)
+ change.mutate({ setting, change: { kind: "toggle" } });
+ }}
+ />
+
+
+
-
- {change.error && !confirming ? (
-
- {failureSaid(change.error)}
-
- ) : null}
-
-
- {/* Away from the everyday controls, at the bottom. */}
-
-
+ {
@@ -292,6 +284,11 @@ export function CheckInPage({
title="Remove check-in"
/>
+ {change.error && !confirming ? (
+
+ /*
+ * 8px under a section's title, as every section's content sits; first in a section with no
+ * title, nothing: the section's own gap is the space above it.
+ */
+
{rows.map((row) => {
const entry = row.directoryEntryId
? directory.find((candidate) => candidate.id === row.directoryEntryId)
@@ -973,16 +986,15 @@ function SignInNote({
}
/**
- * The page's shape before the apps and your accounts have both answered: the search box and a grid
- * of tiles as tall as real ones. No tile says Connect or Connected until both reads are in, so an
- * account you have is never shown as one you don't.
+ * The page's shape before the apps and your accounts have both answered: a grid of tiles as tall as
+ * real ones, under the toolbar's own search. No tile says Connect or Connected until both reads are
+ * in, so an account you have is never shown as one you don't.
*/
function ConnectionsLoading() {
return (
-
-
+
{["a", "b", "c", "d"].map((key) => (
-
- {row.title}
-
+ {row.title}
{row.summary ? (
): { agentId?: string } =>
+ searchTextEntry("agentId", search.agentId),
+ component: EditRoutineRoute,
+});
+
+function EditRoutineRoute() {
+ const { routineId } = Route.useParams();
+ const { agentId } = Route.useSearch();
+ return ;
+}
diff --git a/app/src/routes/_authed/admin/identity-providers.tsx b/app/src/routes/_authed/admin/identity-providers.tsx
index fc523ec602..4a0ed62ec5 100644
--- a/app/src/routes/_authed/admin/identity-providers.tsx
+++ b/app/src/routes/_authed/admin/identity-providers.tsx
@@ -1,9 +1,8 @@
import { useMutation, useQuery } from "@tanstack/react-query";
-import { createFileRoute, redirect } from "@tanstack/react-router";
-import { useId, useState } from "react";
+import { createFileRoute, Link, redirect } from "@tanstack/react-router";
import { SignInSection } from "@/components/admin/controls/sign-in-section";
import { TeamPage } from "@/components/edition/for-a-team";
-import { IconBuildingBank, IconTrash } from "@/components/icons";
+import { IconBuildingBank, IconPlus, IconTrash } from "@/components/icons";
import {
PageAddButton,
PageEmpty,
@@ -13,15 +12,6 @@ import {
} from "@/components/layout/page-shell";
import { StaggerItem } from "@/components/layout/stagger";
import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogBody,
- DialogContent,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
import {
Item,
ItemActions,
@@ -29,15 +19,9 @@ import {
ItemDescription,
ItemTitle,
} from "@/components/ui/item";
-import { Label } from "@/components/ui/label";
import { Separator } from "@/components/ui/separator";
-import { Textarea } from "@/components/ui/textarea";
import { deploymentCapabilitiesQueryOptions } from "@/lib/deployment/queries";
-import {
- deleteIdentityProviderMutationOptions,
- type IdentityProviderInput,
- registerIdentityProviderMutationOptions,
-} from "@/lib/identity-providers/mutations";
+import { deleteIdentityProviderMutationOptions } from "@/lib/identity-providers/mutations";
import { identityProviderListQueryOptions } from "@/lib/identity-providers/queries";
import { identityProviderWords } from "@/lib/identity-providers/words";
import { failureSaid, loadFailure } from "@/lib/load-failure";
@@ -62,16 +46,8 @@ export const Route = createFileRoute("/_authed/admin/identity-providers")({
component: IdentityProvidersPageInEveryEdition,
});
-const EMPTY = {
- protocol: "saml" as "saml" | "oidc",
- providerId: "",
- domain: "",
- issuer: "",
- entryPoint: "",
- metadata: "",
- clientId: "",
- clientSecret: "",
-};
+/** Adding one is a screen of its own, `identity-providers_.new.tsx`. */
+const NEW_PROVIDER = { to: "/admin/identity-providers/new" } as const;
function IdentityProvidersPage() {
const organization = useCurrentOrganizationId();
@@ -83,18 +59,10 @@ function IdentityProvidersPage() {
useQuery(deploymentCapabilitiesQueryOptions()).data?.hostedSignIn === true;
const words = identityProviderWords(organizationOnly, hosted);
const providers = useQuery(identityProviderListQueryOptions());
- const register = useMutation(
- registerIdentityProviderMutationOptions(queryClient),
- );
const remove = useMutation(
deleteIdentityProviderMutationOptions(queryClient),
);
- const [open, setOpen] = useState(false);
- const [draft, setDraft] = useState(EMPTY);
- const formId = useId();
-
- // A removal failure belongs on the page: there is no dialog to put it in. A registration failure
- // is shown inside the dialog instead, where the person who caused it is looking.
+ // A removal failure belongs on the page. A registration failure shows on the Add page instead.
const failure = remove.error;
/*
@@ -119,43 +87,12 @@ function IdentityProvidersPage() {
const registered = listed.filter((provider) => !provider.deployment);
const deploymentWide = listed.filter((provider) => provider.deployment);
- function submit(submission: React.FormEvent) {
- submission.preventDefault();
- const input: IdentityProviderInput =
- draft.protocol === "saml"
- ? {
- protocol: "saml",
- providerId: draft.providerId,
- domain: draft.domain,
- issuer: draft.issuer,
- entryPoint: draft.entryPoint,
- metadata: draft.metadata,
- }
- : {
- protocol: "oidc",
- providerId: draft.providerId,
- domain: draft.domain,
- issuer: draft.issuer,
- clientId: draft.clientId,
- clientSecret: draft.clientSecret,
- };
-
- register.mutate(input, {
- onSuccess: () => {
- setDraft(EMPTY);
- setOpen(false);
- },
- });
- }
-
return (
setOpen(true)}>
- Add a provider
-
+ Add a provider
) : undefined
}
description={words.description}
@@ -177,7 +114,12 @@ function IdentityProvidersPage() {
) : registered.length === 0 ? (
setOpen(true)} size="sm" variant="outline">
+
}
@@ -268,169 +210,6 @@ function IdentityProvidersPage() {
{providers.isPending ? null : (
)}
-
-
-
-
- Add an identity provider
-
-
- {/* The submit button is in the footer and reaches this form by id, so DialogBody stays a
- direct child of DialogContent and keeps scrolling. */}
-
-
-
- setDraft({ ...draft, domain: event.target.value })
- }
- placeholder="acme.com"
- required
- value={draft.domain}
- />
- {/* Said out loud because it is the field that decides who this applies to. */}
-
- {/*
- Here as well as on the page behind, because while this is open the page behind it is
- not visible. A registration refused by the identity provider or by Better Auth left
- the dialog sitting there unchanged, which reads as the button not working.
- */}
- {register.error ? (
-
- {failureSaid(register.error)}
-
- ) : null}
-
-
-
-
-
-
-
);
}
diff --git a/app/src/routes/_authed/admin/identity-providers_.new.tsx b/app/src/routes/_authed/admin/identity-providers_.new.tsx
new file mode 100644
index 0000000000..84de24bb3b
--- /dev/null
+++ b/app/src/routes/_authed/admin/identity-providers_.new.tsx
@@ -0,0 +1,286 @@
+import { useMutation, useQuery } from "@tanstack/react-query";
+import {
+ createFileRoute,
+ Link,
+ redirect,
+ useNavigate,
+} from "@tanstack/react-router";
+import { useState } from "react";
+import { TeamPage } from "@/components/edition/for-a-team";
+import { PageCard, PageShell } from "@/components/layout/page-shell";
+import { Button } from "@/components/ui/button";
+import {
+ Field,
+ FieldDescription,
+ FieldGroup,
+ FieldLabel,
+ FieldLegend,
+ FieldSet,
+} from "@/components/ui/field";
+import { Input } from "@/components/ui/input";
+import { Textarea } from "@/components/ui/textarea";
+import { deploymentCapabilitiesQueryOptions } from "@/lib/deployment/queries";
+import {
+ type IdentityProviderInput,
+ registerIdentityProviderMutationOptions,
+} from "@/lib/identity-providers/mutations";
+import { identityProviderWords } from "@/lib/identity-providers/words";
+import { failureSaid } from "@/lib/load-failure";
+import { useCurrentOrganizationId } from "@/lib/organizations/current";
+import { ONLY_ORGANIZATION } from "@/lib/organizations/queries";
+import { queryClient } from "@/query-client";
+
+export const Route = createFileRoute("/_authed/admin/identity-providers_/new")({
+ /*
+ * As the list's own guard (`identity-providers.tsx`): on OpenBot by CopilotKit (`hostedSignIn`) an
+ * organization has no identity provider of its own to add, so an old link lands on the Admin overview.
+ */
+ beforeLoad: async ({ context }) => {
+ const deployment = await context.queryClient
+ .ensureQueryData(deploymentCapabilitiesQueryOptions())
+ .catch(() => undefined);
+ if (deployment?.hostedSignIn)
+ throw redirect({ to: "/admin", replace: true });
+ },
+ component: NewIdentityProviderPageInEveryEdition,
+});
+
+const LIST = { to: "/admin/identity-providers" } as const;
+const BACK = { label: "Identity providers", linkProps: LIST };
+const TITLE = "Add identity provider";
+
+const EMPTY = {
+ protocol: "saml" as "saml" | "oidc",
+ providerId: "",
+ domain: "",
+ issuer: "",
+ entryPoint: "",
+ metadata: "",
+ clientId: "",
+ clientSecret: "",
+};
+
+/**
+ * Adding an identity provider, on a screen of its own rather than in a dialog over the list.
+ *
+ * The form takes five or six fields, one of them a whole metadata file, so it gets a page's room, a
+ * back button and an address that can be linked to (`openbot-screen-layout`, Procedure 5). The fields,
+ * the browser's own checks on them and the write are the ones the dialog had.
+ */
+function NewIdentityProviderPage() {
+ const organization = useCurrentOrganizationId();
+ // Outside `default`, an organization's providers are its own: they apply to its members.
+ const organizationOnly =
+ organization !== undefined && organization !== ONLY_ORGANIZATION;
+ const hosted =
+ useQuery(deploymentCapabilitiesQueryOptions()).data?.hostedSignIn === true;
+ const words = identityProviderWords(organizationOnly, hosted);
+ const navigate = useNavigate();
+ const register = useMutation(
+ registerIdentityProviderMutationOptions(queryClient),
+ );
+ const [draft, setDraft] = useState(EMPTY);
+
+ function submit(submission: React.FormEvent) {
+ submission.preventDefault();
+ const input: IdentityProviderInput =
+ draft.protocol === "saml"
+ ? {
+ protocol: "saml",
+ providerId: draft.providerId,
+ domain: draft.domain,
+ issuer: draft.issuer,
+ entryPoint: draft.entryPoint,
+ metadata: draft.metadata,
+ }
+ : {
+ protocol: "oidc",
+ providerId: draft.providerId,
+ domain: draft.domain,
+ issuer: draft.issuer,
+ clientId: draft.clientId,
+ clientSecret: draft.clientSecret,
+ };
+
+ register.mutate(input, { onSuccess: () => navigate(LIST) });
+ }
+
+ return (
+
+
+
+
+ Name
+
+ setDraft({ ...draft, providerId: event.target.value })
+ }
+ placeholder="acme-okta"
+ required
+ value={draft.providerId}
+ />
+
+
+
+ Email domain
+ {/* Said out loud because it is the field that decides who this applies to. */}
+ {words.domainHelp}
+
+ setDraft({ ...draft, domain: event.target.value })
+ }
+ placeholder="acme.com"
+ required
+ value={draft.domain}
+ />
+
+
+
+ Issuer
+
+ setDraft({ ...draft, issuer: event.target.value })
+ }
+ placeholder="https://acme.okta.com"
+ required
+ type="url"
+ value={draft.issuer}
+ />
+
+
+ {draft.protocol === "saml" ? (
+ <>
+
+ Sign-on URL
+
+ setDraft({ ...draft, entryPoint: event.target.value })
+ }
+ placeholder="https://acme.okta.com/app/.../sso/saml"
+ required
+ type="url"
+ value={draft.entryPoint}
+ />
+
+
+ Metadata XML
+
+ The file from your identity team. It includes the signing
+ certificate.
+
+
+ >
+ ) : (
+ <>
+
+ Client ID
+
+ setDraft({ ...draft, clientId: event.target.value })
+ }
+ required
+ value={draft.clientId}
+ />
+
+
+ Client secret
+
+ setDraft({ ...draft, clientSecret: event.target.value })
+ }
+ required
+ type="password"
+ value={draft.clientSecret}
+ />
+
+ >
+ )}
+
+ {/*
+ * A registration refused by the identity provider or by Better Auth leaves the form as it was,
+ * which reads as the button not working without this line.
+ */}
+ {register.error ? (
+
+ {failureSaid(register.error)}
+
+ ) : null}
+
+
+
+ );
+}
+
+/** The personal edition shows this page's title, and that it applies to a team. */
+function NewIdentityProviderPageInEveryEdition() {
+ return (
+
+
+
+ );
+}
diff --git a/app/src/theme.css b/app/src/theme.css
index 6bc3c73c7a..1e5af47e22 100644
--- a/app/src/theme.css
+++ b/app/src/theme.css
@@ -32,7 +32,7 @@
--success: oklch(0.514 0.1 167.2);
--warning: oklch(0.521 0.143 47.7);
--border: oklch(0.108 0.042 264.7 / 10%);
- --input: oklch(0.108 0.042 264.7 / 10%);
+ --input: oklch(0.108 0.042 264.7 / 20%);
--ring: oklch(0.638 0.167 276.1);
--chart-1: oklch(0.46 0.2 264);
--chart-2: oklch(0.66 0.146 66);
@@ -85,7 +85,7 @@
--success: oklch(0.832 0.13 170.1);
--warning: oklch(0.828 0.189 84.4);
--border: oklch(0.956 0.004 252 / 12%);
- --input: oklch(0.956 0.004 252 / 12%);
+ --input: oklch(0.956 0.004 252 / 16%);
--ring: oklch(0.713 0.151 277.7);
--chart-1: oklch(0.58 0.2 264);
--chart-2: oklch(0.76 0.168 66);
diff --git a/app/tests/approvals-rules.test.tsx b/app/tests/approvals-rules.test.tsx
index eeb1c862f4..cee02540d6 100644
--- a/app/tests/approvals-rules.test.tsx
+++ b/app/tests/approvals-rules.test.tsx
@@ -186,12 +186,13 @@ function draw(
test("organization rules are locked for members, enforced auto-review is shown as required, and the host cap is named", async () => {
const view = draw();
await view.findByText("Ask before taking action (organization rule)");
- // The organization's rule is a select like the member's own, so every row has one kind of
- // control. Only the member's can be changed.
- const team = view
- .getAllByRole("combobox")
- .find((select) => select.textContent?.includes("(organization rule)"));
- expect(team?.hasAttribute("disabled")).toBe(true);
+ // The organization's rule states its value, with nothing to press: a read-only row. Only the
+ // member's own has a select.
+ expect(
+ view
+ .getAllByRole("combobox")
+ .some((select) => select.textContent?.includes("(organization rule)")),
+ ).toBe(false);
const mine = view.getByRole("combobox", {
name: "Behaviour for Any action on Gmail",
});
@@ -225,12 +226,10 @@ test("a member changes a saved rule in place", async () => {
body: { behaviour: "hand_off" },
}),
);
- // The organization's rule is shown, and can't be changed.
+ // The organization's rule is shown as its value, with no control to change it.
expect(
- view
- .getByRole("combobox", { name: "Behaviour for Share on Drive" })
- .hasAttribute("disabled"),
- ).toBe(true);
+ view.queryByRole("combobox", { name: "Behaviour for Share on Drive" }),
+ ).toBeNull();
});
test("a member adds a rule with one of the four behaviours", async () => {
diff --git a/app/tests/bot-routines-summary.test.tsx b/app/tests/bot-routines-summary.test.tsx
index 0afc2c864e..d17df0684d 100644
--- a/app/tests/bot-routines-summary.test.tsx
+++ b/app/tests/bot-routines-summary.test.tsx
@@ -83,8 +83,9 @@ const rowNames = (view: ReturnType) =>
(link) => link.textContent,
);
+/** The section's title: "Routines", then its count. */
const heading = (view: ReturnType) =>
- view.findByRole("heading", { name: "Routines" });
+ view.findByRole("heading", { name: /^Routines/ });
test("running first, then what starts soonest, then what is paused, counted, with All routines to the Bot's Routines", async () => {
const view = draw([
@@ -99,12 +100,17 @@ test("running first, then what starts soonest, then what is paused, counted, wit
routine({ id: "paused", title: "Paused", enabled: false }),
routine({ id: "other", title: "Someone else's", botId: "scout" }),
]);
- await heading(view);
- expect(view.getByText("4 routines")).toBeTruthy();
+ const title = await heading(view);
+ // The count is the section's own, after its title.
+ expect(
+ title.querySelector('[data-slot="page-section-count"]')?.textContent,
+ ).toBe("4");
expect(rowNames(view)).toEqual(["Running", "Soon", "Late", "Paused"]);
expect(view.getByText("Running now")).toBeTruthy();
const seeAll = view.getByRole("button", { name: "All routines (4)" });
expect(seeAll.getAttribute("href")).toBe("/bots/atlas/routines");
+ // On the section's title line, on the right: never a button left on its own under the rows.
+ expect(seeAll.parentElement).toBe(title.parentElement);
});
test("at most five, then All routines with the total", async () => {
@@ -155,7 +161,7 @@ test("a routine that is on has its switch on, and switching it off pauses it", a
test("a Bot with no routines has no Routines section", async () => {
const view = draw([routine({ botId: "scout" })]);
await settleReactWork();
- expect(view.queryByRole("heading", { name: "Routines" })).toBeNull();
+ expect(view.queryByRole("heading", { name: /^Routines/ })).toBeNull();
});
test("a read that fails is said, and All routines still goes to the Bot's Routines", async () => {
diff --git a/app/tests/check-in-row.test.tsx b/app/tests/check-in-row.test.tsx
index 1584e95532..cdd07bd077 100644
--- a/app/tests/check-in-row.test.tsx
+++ b/app/tests/check-in-row.test.tsx
@@ -298,3 +298,15 @@ test("Remove asks first, and only then removes the check-in", async () => {
await user.click(within(confirm).getByRole("button", { name: "Remove" }));
await waitFor(() => expect(writes).toEqual([`DELETE ${CHECK_INS_PATH}/p1`]));
});
+
+test("the check-in's switch and Remove are rows of its actions, not in the header", async () => {
+ const view = page();
+ const remove = await view.findByRole("button", { name: /^Remove check-in/ });
+ const header = view.getByRole("heading", { level: 1 }).closest("header");
+ expect(header?.querySelector('[role="switch"]')).toBeNull();
+ const actions = view
+ .getByRole("switch", { name: "Check-ins on" })
+ .closest('[data-slot="page-rows"]');
+ expect(remove.closest('[data-slot="page-rows"]')).toBe(actions);
+ expect(actions?.lastElementChild).toBe(remove);
+});
diff --git a/app/tests/github-sources-settings.test.tsx b/app/tests/github-sources-settings.test.tsx
index 2c1dd0ea3c..33b743d6bc 100644
--- a/app/tests/github-sources-settings.test.tsx
+++ b/app/tests/github-sources-settings.test.tsx
@@ -1,13 +1,27 @@
import { afterAll, afterEach, beforeAll, expect, test } from "bun:test";
import { GlobalRegistrator } from "@happy-dom/global-registrator";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import {
+ createMemoryHistory,
+ createRootRoute,
+ createRoute,
+ createRouter,
+ Outlet,
+ RouterProvider,
+} from "@tanstack/react-router";
import { cleanup, fireEvent, render, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
-import { GithubSources } from "@/components/settings/github-sources";
+import {
+ AddGithubRepositoryPage,
+ GithubSources,
+} from "@/components/settings/github-sources";
import { GITHUB_EVENT_SOURCES_PATH, pathOf } from "./schedules-api";
import { settleReactWork } from "./settle-react-work";
-/** Settings → Connected accounts: the repositories whose events can start a responsibility. */
+/**
+ * GitHub's page under Apps: the repositories whose events can start a responsibility, and the
+ * screen of its own a repository is added on.
+ */
beforeAll(() => GlobalRegistrator.register());
afterEach(cleanup);
@@ -60,15 +74,33 @@ function serving() {
}) as unknown as typeof fetch;
}
-function draw() {
+/** GitHub's page and its Add a repository screen, at their addresses, opened on `start`. */
+function draw(start = "/connections/github") {
const client = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
- return render(
+ const root = createRootRoute({ component: Outlet });
+ const githubPage = createRoute({
+ getParentRoute: () => root,
+ path: "/connections/$key",
+ component: GithubSources,
+ });
+ const addPage = createRoute({
+ getParentRoute: () => root,
+ path: "/connections/$key/repositories/new",
+ component: AddGithubRepositoryPage,
+ });
+ const history = createMemoryHistory({ initialEntries: [start] });
+ const router = createRouter({
+ routeTree: root.addChildren([githubPage, addPage]),
+ history,
+ });
+ const view = render(
-
+ ,
);
+ return Object.assign(view, { history });
}
test("a connected repository copies the webhook address the server answers, to paste into GitHub", async () => {
@@ -146,14 +178,27 @@ test("a webhook address that can't be copied is shown, to copy by hand", async (
}
});
-test("connecting a repository sends it with its secret", async () => {
+test("Add a repository opens a screen of its own, which sends the repository with its secret and goes back", async () => {
serving();
const view = draw();
const user = userEvent.setup({ document });
await view.findByText("acme/app");
await user.click(view.getByRole("button", { name: "Add a repository" }));
+ await waitFor(() =>
+ expect(view.history.location.pathname).toBe(
+ "/connections/github/repositories/new",
+ ),
+ );
+ // A screen, not a dialog: a heading of its own and a way back to GitHub's page.
+ expect(view.queryByRole("dialog")).toBeNull();
+ expect(
+ await view.findByRole("heading", { name: "Add a repository" }),
+ ).toBeTruthy();
+ expect(
+ view.getByRole("button", { name: "GitHub" }).getAttribute("href"),
+ ).toBe("/connections/github");
await user.type(
- await view.findByRole("textbox", { name: "Repository" }),
+ view.getByRole("textbox", { name: "Repository" }),
"acme/web",
);
await user.type(view.getByLabelText("Webhook secret"), "s3cret");
@@ -164,4 +209,20 @@ test("connecting a repository sends it with its secret", async () => {
body: { repository: "acme/web", secret: "s3cret" },
}),
);
+ // Added, it goes back to GitHub's page and its list.
+ await waitFor(() =>
+ expect(view.history.location.pathname).toBe("/connections/github"),
+ );
+ expect(await view.findByText("acme/app")).toBeTruthy();
+});
+
+test("Cancel on Add a repository goes back to GitHub's page without sending anything", async () => {
+ serving();
+ const view = draw("/connections/github/repositories/new");
+ const user = userEvent.setup({ document });
+ await user.click(await view.findByRole("button", { name: "Cancel" }));
+ await waitFor(() =>
+ expect(view.history.location.pathname).toBe("/connections/github"),
+ );
+ expect(writes).toEqual([]);
});
diff --git a/app/tests/goal-page-starts.test.tsx b/app/tests/goal-page-starts.test.tsx
index 7c71ff9d9b..75c8d757d2 100644
--- a/app/tests/goal-page-starts.test.tsx
+++ b/app/tests/goal-page-starts.test.tsx
@@ -184,7 +184,7 @@ test("a goal whose routines couldn't be read doesn't claim it runs when asked",
expect(
view
.getByRole("heading", { level: 1 })
- .parentElement?.parentElement?.querySelector("p > span")?.textContent,
+ .parentElement?.parentElement?.querySelector("p")?.textContent,
).toBe("Active"),
);
fireEvent.click(
@@ -202,19 +202,19 @@ test("a goal whose only schedule is off says the schedule is off", async () => {
expect(await header(view)).toBe("Active · Schedule off");
});
-test("the description says schedules start it when the goal has them", async () => {
+test("the On row says schedules start it when the goal has them", async () => {
const view = open([routine()]);
await triggersLoaded();
await view.findByText("Its schedules, events and triggers start it.");
});
-test("the description says events and triggers start it when the goal has no schedules", async () => {
+test("the On row says events and triggers start it when the goal has no schedules", async () => {
const view = open([]);
await triggersLoaded();
await view.findByText("Its events and triggers start it.");
});
-test("the description leaves schedules out when the only schedule is off", async () => {
+test("the On row leaves schedules out when the only schedule is off", async () => {
const view = open([routine({ enabled: false })]);
expect(await header(view)).toBe("Active · Schedule off");
await view.findByText("Its events and triggers start it.");
@@ -225,6 +225,9 @@ test("a paused goal's schedule rows do not say they start it", async () => {
const view = open([routine()], "paused");
await triggersLoaded();
await view.findByText("Paused · Nothing starts it until you resume it");
+ await view.findByText(
+ "Paused. Its schedules, events and triggers won't start it.",
+ );
await view.findByText("Starts it again when you resume it · UTC");
expect(view.queryByText(/Starts it on a schedule/)).toBeNull();
});
@@ -415,7 +418,7 @@ test("a refused delete is said in the confirmation, and the confirmation stays",
});
test("a goal whose routines couldn't be read says its schedules couldn't be loaded", async () => {
- // A failed read is not "no schedules": the section says so, and the Active row leaves none out.
+ // A failed read is not "no schedules": the section says so, and the On row leaves none out.
const view = open(undefined);
await triggersLoaded();
await view.findByText(
@@ -442,3 +445,18 @@ test("a completed goal's schedules have no switch, and say why", async () => {
view.getByRole("button", { name: "Delete the schedule Weekdays at 09:00" }),
).toBeTruthy();
});
+
+test("the goal's switch and Delete are rows of its actions, not in the header", async () => {
+ const view = open([routine()]);
+ await triggersLoaded();
+ const header = view.getByRole("heading", { level: 1 }).closest("header");
+ expect(header?.querySelector('[role="switch"]')).toBeNull();
+ const actions = view
+ .getByRole("switch", { name: "On" })
+ .closest('[data-slot="page-rows"]');
+ const remove = view.getByRole("button", {
+ name: "Delete the goal Watch the queue",
+ });
+ expect(remove.closest('[data-slot="page-rows"]')).toBe(actions);
+ expect(actions?.lastElementChild).toBe(remove);
+});
diff --git a/app/tests/identity-vendor-logo.test.ts b/app/tests/identity-vendor-logo.test.ts
index 2e4e173e2c..d2139bb07c 100644
--- a/app/tests/identity-vendor-logo.test.ts
+++ b/app/tests/identity-vendor-logo.test.ts
@@ -1,15 +1,17 @@
import { expect, test } from "bun:test";
-import githubLogo from "@/assets/brands/github.svg";
-import { identityVendorLogo } from "@/components/plugins/plugin-logo";
+import {
+ GithubMark,
+ identityVendorLogo,
+} from "@/components/plugins/plugin-logo";
/*
* FROM DAVE'S REVIEW OF THE APPS POLISH: GitHub's and Slack's tiles took a logo from the directory
* app's address, so the same row looked different from one organization to the next, and Slack's
- * never loaded in WebKit. GitHub's mark is bundled, like Notion's; Slack keeps its own icon.
+ * never loaded in WebKit. GitHub's mark is bundled; Slack keeps its own icon.
*/
-test("GitHub's account tile uses the bundled GitHub mark, the same everywhere", () => {
- expect(identityVendorLogo("github")).toBe(githubLogo);
- expect(String(identityVendorLogo("github"))).not.toMatch(/^https?:/);
+test("GitHub's account tile uses the bundled GitHub mark, the same everywhere, loading nothing", () => {
+ expect(identityVendorLogo("github")).toBe(GithubMark);
+ expect(typeof identityVendorLogo("github")).toBe("function");
});
test("Slack's account tile has no logo to load, so it keeps its own icon", () => {
diff --git a/app/tests/new-identity-provider-page.test.tsx b/app/tests/new-identity-provider-page.test.tsx
new file mode 100644
index 0000000000..62b6f95fc4
--- /dev/null
+++ b/app/tests/new-identity-provider-page.test.tsx
@@ -0,0 +1,261 @@
+import {
+ afterAll,
+ afterEach,
+ beforeAll,
+ beforeEach,
+ describe,
+ expect,
+ test,
+} from "bun:test";
+import { GlobalRegistrator } from "@happy-dom/global-registrator";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import {
+ createMemoryHistory,
+ createRootRoute,
+ createRoute,
+ createRouter,
+ isRedirect,
+ type RouteComponent,
+ RouterProvider,
+} from "@tanstack/react-router";
+import { cleanup, render, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { deploymentKeys } from "@/lib/deployment/queries";
+import { setCurrentOrganization } from "@/lib/organizations/current";
+import { queryClient as appQueryClient } from "@/query-client";
+import { Route as IdentityProvidersRoute } from "@/routes/_authed/admin/identity-providers";
+import { Route as NewIdentityProviderRoute } from "@/routes/_authed/admin/identity-providers_.new";
+import { settleReactWork } from "./settle-react-work";
+
+/**
+ * Adding an identity provider is a screen of its own, `/admin/identity-providers/new`, not a dialog
+ * over the list (`openbot-screen-layout`, Procedure 5). The list's Add a provider opens it; the screen
+ * sends the same registration the dialog did and goes back to the list once it lands.
+ */
+
+const PROVIDERS_PATH = "/api/v2/organizations/default/identity-providers";
+const TEAM = {
+ generativeUi: true,
+ selfHostBanner: false,
+ localEvaluation: false,
+ edition: "team",
+ authProviders: ["google"],
+ ssoConfigured: false,
+ ssoRequired: false,
+};
+
+const originalFetch = globalThis.fetch;
+let posted: unknown[] = [];
+let keys: (string | null)[] = [];
+let refuse: { status: number; detail: string } | undefined;
+
+beforeAll(() => GlobalRegistrator.register({ url: "http://127.0.0.1:3010/" }));
+beforeEach(() => {
+ setCurrentOrganization("default");
+ globalThis.fetch = Object.assign(
+ async (input: RequestInfo | URL, init?: RequestInit) => {
+ const url = new URL(
+ input instanceof Request ? input.url : String(input),
+ "http://127.0.0.1:3010",
+ );
+ if (url.pathname !== PROVIDERS_PATH)
+ return Response.json({ error: "not served" }, { status: 404 });
+ const method = input instanceof Request ? input.method : init?.method;
+ if (method === "POST") {
+ const body =
+ input instanceof Request ? await input.text() : String(init?.body);
+ posted.push(JSON.parse(body));
+ keys.push(
+ new Headers(
+ input instanceof Request ? input.headers : init?.headers,
+ ).get("idempotency-key"),
+ );
+ if (refuse)
+ return new Response(
+ JSON.stringify({
+ type: "https://open.bot/errors/validation-failed",
+ title: "Validation failed.",
+ code: "VALIDATION_FAILED",
+ retryable: false,
+ ...refuse,
+ }),
+ {
+ status: refuse.status,
+ headers: { "content-type": "application/problem+json" },
+ },
+ );
+ const sent = JSON.parse(body) as Record;
+ return Response.json(
+ {
+ id: sent.id,
+ issuer: sent.issuer,
+ domain: sent.domain,
+ protocol: sent.protocol,
+ registeredBy: "admin",
+ deployment: false,
+ },
+ { status: 201 },
+ );
+ }
+ return Response.json({ identityProviders: [], nextCursor: null });
+ },
+ { preconnect: originalFetch.preconnect },
+ );
+});
+afterEach(() => {
+ cleanup();
+ globalThis.fetch = originalFetch;
+ appQueryClient.clear();
+ posted = [];
+ keys = [];
+ refuse = undefined;
+});
+afterAll(async () => {
+ await settleReactWork();
+ GlobalRegistrator.unregister();
+});
+
+/** The list and the Add screen at their Admin addresses, opened at `at`. */
+function draw(at: string) {
+ const client = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ client.setQueryData(deploymentKeys.capabilities(), TEAM);
+ const root = createRootRoute();
+ const router = createRouter({
+ routeTree: root.addChildren([
+ createRoute({
+ path: "/admin/identity-providers",
+ getParentRoute: () => root,
+ component: () =>
The list
,
+ }),
+ createRoute({
+ path: "/admin/identity-providers/new",
+ getParentRoute: () => root,
+ component: NewIdentityProviderRoute.options.component as RouteComponent,
+ }),
+ ]),
+ history: createMemoryHistory({ initialEntries: [at] }),
+ });
+ return render(
+
+
+ ,
+ );
+}
+
+test("the list's Add a provider opens the Add screen, with no dialog over the list", async () => {
+ const client = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ client.setQueryData(deploymentKeys.capabilities(), TEAM);
+ const root = createRootRoute({
+ component: IdentityProvidersRoute.options.component as RouteComponent,
+ });
+ const router = createRouter({
+ routeTree: root,
+ history: createMemoryHistory({ initialEntries: ["/"] }),
+ });
+ const view = render(
+
+
+ ,
+ );
+ await view.findByText("No identity providers yet");
+ const adds = view.getAllByText("Add a provider");
+ // The header's and the empty state's, each a link to the screen.
+ expect(adds).toHaveLength(2);
+ for (const add of adds)
+ expect(add.closest("a")?.getAttribute("href")).toBe(
+ "/admin/identity-providers/new",
+ );
+ expect(view.queryByRole("dialog")).toBeNull();
+});
+
+test("an OIDC provider is registered with the fields the dialog had, and the screen goes back to the list", async () => {
+ const view = draw("/admin/identity-providers/new");
+ await view.findByRole("heading", { name: "Add identity provider" });
+ // Back to the list, and Cancel goes there too.
+ for (const back of ["Identity providers", "Cancel"])
+ expect(view.getByText(back).closest("a")?.getAttribute("href")).toBe(
+ "/admin/identity-providers",
+ );
+
+ const user = userEvent.setup({ document });
+ await user.click(view.getByRole("button", { name: "OIDC" }));
+ await user.type(view.getByLabelText("Name"), "acme-okta");
+ await user.type(view.getByLabelText("Email domain"), "acme.com");
+ await user.type(view.getByLabelText("Issuer"), "https://acme.okta.com");
+ await user.type(view.getByLabelText("Client ID"), "client-1");
+ await user.type(view.getByLabelText("Client secret"), "shh");
+ await user.click(view.getByRole("button", { name: "Add provider" }));
+
+ await waitFor(() => expect(posted).toHaveLength(1));
+ expect(posted[0]).toEqual({
+ id: "acme-okta",
+ protocol: "oidc",
+ domain: "acme.com",
+ issuer: "https://acme.okta.com",
+ clientId: "client-1",
+ clientSecret: "shh",
+ });
+ expect(keys[0]).toBeTruthy();
+ expect(await view.findByText("The list")).toBeTruthy();
+});
+
+test("a refused registration says why and keeps the screen as it was", async () => {
+ refuse = {
+ status: 422,
+ detail:
+ "That metadata isn't valid SAML. Ask your identity team for it again.",
+ };
+ const view = draw("/admin/identity-providers/new");
+ await view.findByRole("heading", { name: "Add identity provider" });
+
+ const user = userEvent.setup({ document });
+ await user.type(view.getByLabelText("Name"), "acme-okta");
+ await user.type(view.getByLabelText("Email domain"), "acme.com");
+ await user.type(view.getByLabelText("Issuer"), "https://acme.okta.com");
+ await user.type(
+ view.getByLabelText("Sign-on URL"),
+ "https://acme.okta.com/sso/saml",
+ );
+ await user.type(view.getByLabelText("Metadata XML"), "not xml");
+ await user.click(view.getByRole("button", { name: "Add provider" }));
+
+ const alert = await view.findByRole("alert");
+ expect(alert.textContent).toContain("That metadata isn't valid SAML.");
+ expect(posted[0]).toMatchObject({ id: "acme-okta", protocol: "saml" });
+ expect(view.queryByText("The list")).toBeNull();
+ expect((view.getByLabelText("Name") as HTMLInputElement).value).toBe(
+ "acme-okta",
+ );
+});
+
+describe("an old link to Add identity provider", () => {
+ const beforeLoad = NewIdentityProviderRoute.options.beforeLoad as (
+ match: unknown,
+ ) => Promise;
+
+ function withDeployment(hostedSignIn: boolean) {
+ const queryClient = new QueryClient();
+ queryClient.setQueryData(deploymentKeys.capabilities(), {
+ ...TEAM,
+ hostedSignIn,
+ });
+ return { context: { queryClient } };
+ }
+
+ test("lands on the Admin overview on OpenBot by CopilotKit, as the list does", async () => {
+ const thrown = await beforeLoad(withDeployment(true)).then(
+ () => undefined,
+ (error: unknown) => error,
+ );
+ expect(isRedirect(thrown)).toBe(true);
+ expect((thrown as { options: { to: string } }).options.to).toBe("/admin");
+ });
+
+ test("opens the screen on a self-hosted OpenBot", async () => {
+ await expect(beforeLoad(withDeployment(false))).resolves.toBeUndefined();
+ });
+});
diff --git a/app/tests/plugin-logo.test.tsx b/app/tests/plugin-logo.test.tsx
index 83def38d10..a786b37ffd 100644
--- a/app/tests/plugin-logo.test.tsx
+++ b/app/tests/plugin-logo.test.tsx
@@ -1,7 +1,7 @@
import { afterAll, afterEach, beforeAll, expect, test } from "bun:test";
import { GlobalRegistrator } from "@happy-dom/global-registrator";
import { cleanup, fireEvent, render } from "@testing-library/react";
-import { PluginLogo } from "@/components/plugins/plugin-logo";
+import { GithubMark, PluginLogo } from "@/components/plugins/plugin-logo";
beforeAll(() => GlobalRegistrator.register({ url: "http://localhost/" }));
afterEach(cleanup);
@@ -23,7 +23,7 @@ test("a missing or broken logo uses the plug, and a new URL can load", () => {
);
});
-test("an app's logo sits on a white tile in dark mode, so a black mark like GitHub's still shows", () => {
+test("a loaded logo sits on a white tile in dark mode, so a black mark still shows", () => {
const view = render();
expect(view.container.querySelector("img")?.className).toContain(
"dark:bg-white",
@@ -40,3 +40,23 @@ test("a logo loads at once, never lazily", () => {
"eager",
);
});
+
+/*
+ * "Draw with tokens, not with pictures": GitHub's bundled mark is a shape in the text color, so it
+ * follows light and dark without the white tile a black picture needed.
+ */
+test("GitHub's bundled mark draws in the text color, with no picture and no white tile", () => {
+ const view = render(
+ fallback}
+ logo={GithubMark}
+ name="GitHub"
+ />,
+ );
+ expect(view.container.querySelector("img")).toBeNull();
+ const mark = view.container.querySelector("[data-slot=github-mark]");
+ expect(mark?.getAttribute("fill")).toBe("currentColor");
+ expect(mark?.querySelector("[fill]:not([fill=currentColor])")).toBeNull();
+ expect(view.container.innerHTML).not.toContain("dark:bg-white");
+ expect(view.queryByText("fallback")).toBeNull();
+});
diff --git a/app/tests/routine-edit.test.tsx b/app/tests/routine-edit.test.tsx
index 200b41c43a..e6348796b2 100644
--- a/app/tests/routine-edit.test.tsx
+++ b/app/tests/routine-edit.test.tsx
@@ -10,6 +10,7 @@ import {
} from "@tanstack/react-router";
import { cleanup, render, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
+import { EditRoutineRoutePage } from "@/components/routines/edit-routine-page";
import { RoutineRoutePage } from "@/components/routines/routine-page";
import { cronFrom, scheduleFrom } from "@/lib/routines/form";
import type { RoutineRecord } from "@/lib/routines/queries";
@@ -19,9 +20,9 @@ import { pathOf, ROUTINES_PATH, routineRunsPath } from "./schedules-api";
import { settleReactWork } from "./settle-react-work";
/*
- * Edit routine, on a routine's page. A routine could only be deleted and made again, which lost its
- * runs. Now its name, what it does, its schedule and its time zone change in place, through the
- * API's updateRoutine, and the page shows what was saved.
+ * Edit routine, a screen opened from Edit on a routine's page. A routine could only be deleted and
+ * made again, which lost its runs. Now its name, what it does, its schedule and its time zone change
+ * in place, through the API's updateRoutine, and the routine's page shows what was saved.
*/
beforeAll(() => GlobalRegistrator.register());
@@ -132,6 +133,11 @@ function draw(routine: RoutineRecord = ROUTINE) {
path: "/routines/schedules/$routineId",
component: () => ,
}),
+ createRoute({
+ getParentRoute: () => root,
+ path: "/routines/schedules/$routineId/edit",
+ component: () => ,
+ }),
]),
});
return render(
@@ -152,11 +158,23 @@ async function replaceText(
if (text) await user.type(field, text);
}
+/** Edit, on the routine's page, opens Edit routine: a screen of its own, not a dialog. */
async function openEdit(view: ReturnType) {
const user = userEvent.setup({ document });
await user.click(await view.findByRole("button", { name: /^Edit routine/ }));
- const dialog = await view.findByRole("dialog", { name: "Edit routine" });
- return { user, dialog: within(dialog) };
+ await view.findByRole("heading", { level: 1, name: "Edit routine" });
+ expect(view.queryByRole("dialog")).toBeNull();
+ return { user, page: within(view.container) };
+}
+
+/** Back on the routine's page, which Save returns to. */
+async function backOnRoutine(view: ReturnType) {
+ await waitFor(() =>
+ expect(
+ view.queryByRole("heading", { level: 1, name: "Edit routine" }),
+ ).toBeNull(),
+ );
+ await view.findByRole("button", { name: /^Edit routine/ });
}
test("the picker reads back exactly the schedules it writes, and no others", () => {
@@ -184,20 +202,18 @@ test("the picker reads back exactly the schedules it writes, and no others", ()
test("Edit routine opens with what the routine is now", async () => {
serving();
const view = draw();
- const { dialog } = await openEdit(view);
- expect((dialog.getByLabelText("Name") as HTMLInputElement).value).toBe(
+ const { page } = await openEdit(view);
+ expect((page.getByLabelText("Name") as HTMLInputElement).value).toBe(
"Morning leads",
);
- expect(
- (dialog.getByLabelText("What to do") as HTMLTextAreaElement).value,
- ).toBe(ROUTINE.instruction);
- expect(dialog.getByLabelText("Schedule").textContent).toContain(
- "Every weekday",
+ expect((page.getByLabelText("What to do") as HTMLTextAreaElement).value).toBe(
+ ROUTINE.instruction,
);
- expect((dialog.getByLabelText("Time") as HTMLInputElement).value).toBe(
- "09:00",
+ expect(page.getByLabelText("Schedule").textContent).toContain(
+ "Every weekday",
);
- expect((dialog.getByLabelText("Time zone") as HTMLInputElement).value).toBe(
+ expect((page.getByLabelText("Time") as HTMLInputElement).value).toBe("09:00");
+ expect((page.getByLabelText("Time zone") as HTMLInputElement).value).toBe(
"Europe/Madrid",
);
});
@@ -205,25 +221,23 @@ test("Edit routine opens with what the routine is now", async () => {
test("saving changes what to do and when it runs, and the page shows it", async () => {
const changes = serving();
const view = draw();
- const { user, dialog } = await openEdit(view);
+ const { user, page } = await openEdit(view);
await replaceText(
user,
- dialog.getByLabelText("What to do"),
+ page.getByLabelText("What to do"),
"Send me this week's new leads",
);
- await user.click(dialog.getByLabelText("Schedule"));
+ await user.click(page.getByLabelText("Schedule"));
await user.click(await view.findByRole("option", { name: "Every week" }));
await user.click(await view.findByLabelText("Day of the week"));
await user.click(await view.findByRole("option", { name: "Wednesday" }));
- await replaceText(user, dialog.getByLabelText("Time"), "07:30");
+ await replaceText(user, page.getByLabelText("Time"), "07:30");
expect(
- dialog.getByText("Every Wednesday at 7:30 AM", { exact: false }),
+ page.getByText("Every Wednesday at 7:30 AM", { exact: false }),
).toBeTruthy();
- await user.click(dialog.getByRole("button", { name: "Save changes" }));
+ await user.click(page.getByRole("button", { name: "Save" }));
- await waitFor(() =>
- expect(view.queryByRole("dialog", { name: "Edit routine" })).toBeNull(),
- );
+ await backOnRoutine(view);
// Only what changed was sent: the name and the time zone were left alone.
expect(changes).toEqual([
{ instruction: "Send me this week's new leads", cron: "30 7 * * 3" },
@@ -242,43 +256,75 @@ test("a schedule the picker can't say is kept unless another is picked", async (
};
const changes = serving(custom);
const view = draw(custom);
- const { user, dialog } = await openEdit(view);
- expect(dialog.getByLabelText("Schedule").textContent).toContain(
- "0 9,17 * * *",
- );
+ const { user, page } = await openEdit(view);
+ expect(page.getByLabelText("Schedule").textContent).toContain("0 9,17 * * *");
// No time to pick while it is kept: the schedule is the one it has.
- expect(dialog.queryByLabelText("Time")).toBeNull();
- await replaceText(user, dialog.getByLabelText("Name"), "Twice-daily leads");
- await user.click(dialog.getByRole("button", { name: "Save changes" }));
- await waitFor(() =>
- expect(view.queryByRole("dialog", { name: "Edit routine" })).toBeNull(),
- );
+ expect(page.queryByLabelText("Time")).toBeNull();
+ await replaceText(user, page.getByLabelText("Name"), "Twice-daily leads");
+ await user.click(page.getByRole("button", { name: "Save" }));
+ await backOnRoutine(view);
expect(changes).toEqual([{ title: "Twice-daily leads" }]);
});
-test("a refusal is said in the dialog, which stays open", async () => {
+test("a refusal is said on the page, which stays open", async () => {
const changes = serving(ROUTINE, {
status: 400,
detail: "Routines may run at most every 15 minutes.",
});
const view = draw();
- const { user, dialog } = await openEdit(view);
- await user.click(dialog.getByLabelText("Schedule"));
+ const { user, page } = await openEdit(view);
+ await user.click(page.getByLabelText("Schedule"));
await user.click(await view.findByRole("option", { name: "Every hour" }));
- await user.click(dialog.getByRole("button", { name: "Save changes" }));
- expect((await dialog.findByRole("alert")).textContent).toBe(
+ await user.click(page.getByRole("button", { name: "Save" }));
+ expect((await page.findByRole("alert")).textContent).toBe(
"Routines may run at most every 15 minutes.",
);
- expect(view.getByRole("dialog", { name: "Edit routine" })).toBeTruthy();
+ expect(
+ view.getByRole("heading", { level: 1, name: "Edit routine" }),
+ ).toBeTruthy();
expect(changes).toEqual([{ cron: "0 * * * *" }]);
});
test("an empty What to do is not saved", async () => {
const changes = serving();
const view = draw();
- const { user, dialog } = await openEdit(view);
- await replaceText(user, dialog.getByLabelText("What to do"), "");
- await user.click(dialog.getByRole("button", { name: "Save changes" }));
- expect(await dialog.findByText("Say what the Bot should do.")).toBeTruthy();
+ const { user, page } = await openEdit(view);
+ await replaceText(user, page.getByLabelText("What to do"), "");
+ await user.click(page.getByRole("button", { name: "Save" }));
+ expect(await page.findByText("Say what the Bot should do.")).toBeTruthy();
+ expect(changes).toEqual([]);
+});
+
+test("Cancel goes back to the routine's page and sends nothing", async () => {
+ const changes = serving();
+ const view = draw();
+ const { user, page } = await openEdit(view);
+ await replaceText(user, page.getByLabelText("Name"), "Evening leads");
+ await user.click(page.getByRole("button", { name: "Cancel" }));
+ await backOnRoutine(view);
expect(changes).toEqual([]);
+ expect(
+ view.getByRole("heading", { level: 1, name: "Morning leads" }),
+ ).toBeTruthy();
+});
+
+test("Edit is the page's one action, and the switch and Delete are rows of its actions", async () => {
+ serving();
+ const view = draw();
+ const edit = await view.findByRole("button", { name: /^Edit routine/ });
+ expect(edit.getAttribute("href")).toBe("/routines/schedules/routine-1/edit");
+ const header = view.getByRole("heading", { level: 1 }).closest("header");
+ expect(header?.contains(edit)).toBe(true);
+ expect(header?.querySelector('[role="switch"]')).toBeNull();
+ const actions = view
+ .getByRole("switch", {
+ name: "Enable the routine scheduled Weekdays at 09:00",
+ })
+ .closest('[data-slot="page-rows"]');
+ const remove = view.getByRole("button", {
+ name: "Delete the routine scheduled Weekdays at 09:00",
+ });
+ // Delete is the last row of the same card, never a section of its own under the page.
+ expect(remove.closest('[data-slot="page-rows"]')).toBe(actions);
+ expect(actions?.lastElementChild).toBe(remove);
});
diff --git a/app/tests/skills-settings-page.test.tsx b/app/tests/skills-settings-page.test.tsx
index ed7862acb5..ec4b563902 100644
--- a/app/tests/skills-settings-page.test.tsx
+++ b/app/tests/skills-settings-page.test.tsx
@@ -280,10 +280,18 @@ test("a skill you wrote opens its own screen, and a workspace skill too", async
const yours = section(view, "Your skills");
const written = within(yours).getByText("Weekly report").closest("a");
expect(written?.getAttribute("href")).toBe("/skills/weekly-report");
- // A chevron, as the learned and workspace rows have.
+ // Its menu sits beside the link, not inside it, and the row has no chevron: one outside the
+ // link would open nothing.
+ const row = written?.closest("[data-slot=item]");
expect(
- written?.parentElement?.querySelector("[data-slot=item-actions] > svg"),
+ written?.querySelector('[aria-label="More for Weekly report"]'),
+ ).toBeNull();
+ expect(
+ row?.querySelector(
+ '[data-slot=item-actions] [aria-label="More for Weekly report"]',
+ ),
).toBeTruthy();
+ expect(row?.querySelector("[data-slot=item-actions] > svg")).toBeNull();
const workspace = section(view, "Workspace skills");
expect(
within(workspace)
diff --git a/app/tests/ui-look-theme.test.ts b/app/tests/ui-look-theme.test.ts
index fd64a85bed..ea824f9668 100644
--- a/app/tests/ui-look-theme.test.ts
+++ b/app/tests/ui-look-theme.test.ts
@@ -53,27 +53,38 @@ describe("the look's theme values", () => {
* A hairline is the text color, at 10% in light and 12% in dark (Sam, 2026-12-01): about 1.25:1
* against a card in light and 1.38:1 in dark. At 20% and 16% (1.6:1) cards and rows read heavy and
* boxed beside ChatGPT, Claude and Grok, whose lines are 4% to 10%. One value for lines between
- * things, a field's edge and the sidebar's lines, so no line in the app is fainter than another.
- * An edge that must reach 3:1 (a checkbox's) is `muted-foreground`, never a line.
+ * things and the sidebar's lines, so no line in the app is fainter than another.
+ *
+ * A field's edge (`input`) stays at 20% and 16% (Guido, 2026-12-02). A field on a card is filled
+ * in the card's own color, so at rest its edge is the only thing that shows where it is, and at
+ * 1.25:1 it all but vanished. An edge that must reach 3:1 (a checkbox's) is `muted-foreground`,
+ * never a line.
*/
test.each([
- [":root", "10%"],
- [".dark", "12%"],
- ])("%s draws every line in the text color at %s", (selector, strength) => {
- const block =
- new RegExp(
- `(?:^|[};])\\s*${selector.replace(".", "\\.")}\\s*\\{([^}]*)\\}`,
- ).exec(withoutComments)?.[1] ?? "";
- const value = (name: string) =>
- new RegExp(`--${name}:\\s*([^;]+);`).exec(block)?.[1].trim();
- const foreground = value("foreground")?.replace(/\)$/, "");
- expect(foreground).toBeDefined();
- for (const name of ["border", "input", "sidebar-border"])
- expect({ name, value: value(name) }).toEqual({
- name,
- value: `${foreground} / ${strength})`,
- });
- });
+ [":root", "10%", "20%"],
+ [".dark", "12%", "16%"],
+ ])(
+ "%s draws every line in the text color at %s, and a field's edge at %s",
+ (selector, line, field) => {
+ const block =
+ new RegExp(
+ `(?:^|[};])\\s*${selector.replace(".", "\\.")}\\s*\\{([^}]*)\\}`,
+ ).exec(withoutComments)?.[1] ?? "";
+ const value = (name: string) =>
+ new RegExp(`--${name}:\\s*([^;]+);`).exec(block)?.[1].trim();
+ const foreground = value("foreground")?.replace(/\)$/, "");
+ expect(foreground).toBeDefined();
+ for (const [name, strength] of [
+ ["border", line],
+ ["sidebar-border", line],
+ ["input", field],
+ ])
+ expect({ name, value: value(name) }).toEqual({
+ name,
+ value: `${foreground} / ${strength})`,
+ });
+ },
+ );
/*
* A line is too faint for a mark someone has to find: the thumb that shows a list scrolls, and the
diff --git a/desktop/src-tauri/src/connected/sign_in.rs b/desktop/src-tauri/src/connected/sign_in.rs
index 6c3a15d8c4..635922fd5a 100644
--- a/desktop/src-tauri/src/connected/sign_in.rs
+++ b/desktop/src-tauri/src/connected/sign_in.rs
@@ -1353,12 +1353,13 @@ pub fn end_page_for(ending: Ending) -> String {
/**
The styles of the tab's page, inline: it is served by this app from 127.0.0.1 and loads nothing.
OpenBot's own tokens (written here from `tokens/src/scheme.ts` by `bun run tokens:generate`), in
-the sign-in pages' look: the page's background with a soft, still orb glow behind a card with 20px
-corners and a lavender shadow, the orb at 76px with its glow at the card's top, OpenBot's name at
-the top left, and the card rising in (still when less motion is asked for). The glow stands in for
-Home's animated orb field, which needs a script this page does not run. Light and dark follow the
-system. Figtree when the computer has it, the system's own face otherwise: a font is a file, and
-this page fetches none.
+the web app's look (docs/app-guidelines.md, "The look"): the panel's plain background, a card on it
+with a hairline border, no shadow and the `--radius` corner (`rounded-lg`), the orb at 76px at the
+card's top, OpenBot's name at the top left, type on Tailwind's scale (a 24px heading, 16px text),
+and the card rising in (still when less motion is asked for). Home's orb field is the app's one
+decoration, so nothing glows behind the card or around the orb. Light and dark follow the system.
+Figtree when the computer has it, the system's own face otherwise: a font is a file, and this page
+fetches none.
*/
const END_PAGE_STYLE: &str = r#"
:root {
@@ -1370,9 +1371,7 @@ const END_PAGE_STYLE: &str = r#"
--border: oklch(0.108 0.042 264.7 / 10%);
--sidebar: oklch(0.948 0.01 251.8);
/* end of tokens/src/scheme.ts */
- --shadow: 0 1px 2px oklch(0.108 0.042 264.7 / 4%), 0 24px 64px -16px oklch(0.45 0.12 276 / 22%);
- --glow: oklch(0.82 0.08 285 / 55%);
- --glow-2: oklch(0.86 0.07 340 / 35%);
+ --radius: 0.625rem;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
@@ -1385,9 +1384,6 @@ const END_PAGE_STYLE: &str = r#"
--border: oklch(0.956 0.004 252 / 12%);
--sidebar: oklch(0.156 0.017 252);
/* end of tokens/src/scheme.ts */
- --shadow: 0 1px 2px oklch(0 0 0 / 30%), 0 24px 64px -16px oklch(0 0 0 / 60%);
- --glow: oklch(0.45 0.12 280 / 28%);
- --glow-2: oklch(0.45 0.13 340 / 16%);
color-scheme: dark;
}
}
@@ -1400,13 +1396,10 @@ body {
align-items: center;
justify-content: center;
padding: 72px 16px 48px;
- background:
- radial-gradient(ellipse 34rem 26rem at 50% 50%, var(--glow), transparent 70%),
- radial-gradient(ellipse 22rem 16rem at 58% 62%, var(--glow-2), transparent 70%),
- var(--background);
+ background: var(--background);
color: var(--foreground);
font-family: "Figtree Variable", "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
- font-size: 15px;
+ font-size: 1rem;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
@@ -1417,10 +1410,11 @@ body {
left: 24px;
display: flex;
align-items: center;
- gap: 10px;
- font-size: 16px;
+ gap: 8px;
+ font-size: 0.875rem;
+ line-height: 1.25rem;
font-weight: 600;
- letter-spacing: -0.01em;
+ letter-spacing: -0.025em;
}
.brand .orb { width: 24px; height: 24px; margin: 0; }
main {
@@ -1430,8 +1424,7 @@ main {
padding: 36px 32px 32px;
background: var(--card);
border: 1px solid var(--border);
- border-radius: 20px;
- box-shadow: var(--shadow);
+ border-radius: var(--radius);
text-align: center;
animation: rise 700ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
@@ -1456,7 +1449,6 @@ main {
radial-gradient(circle at 62% 38%, var(--c4), transparent 62%);
filter: saturate(0.9);
}
-main .orb { box-shadow: 0 0 28px 4px oklch(70% 0.18 300 / 35%); overflow: visible; }
.orb::before {
content: "";
position: absolute;
@@ -1478,9 +1470,9 @@ main .orb { box-shadow: 0 0 28px 4px oklch(70% 0.18 300 / 35%); overflow: visibl
}
h1 {
margin: 0;
- font-size: 1.75rem;
- line-height: 1.2;
- font-weight: 650;
+ font-size: 1.5rem;
+ line-height: 2rem;
+ font-weight: 600;
letter-spacing: -0.025em;
text-wrap: balance;
}
diff --git a/desktop/src/styles.css b/desktop/src/styles.css
index f15a804dc0..d50c3e9eb9 100644
--- a/desktop/src/styles.css
+++ b/desktop/src/styles.css
@@ -33,7 +33,7 @@
--destructive: oklch(0.46 0.173 22.6);
--success: oklch(0.514 0.1 167.2);
--border: oklch(0.108 0.042 264.7 / 10%);
- --input: oklch(0.108 0.042 264.7 / 10%);
+ --input: oklch(0.108 0.042 264.7 / 20%);
--ring: oklch(0.638 0.167 276.1);
--sidebar: oklch(0.948 0.01 251.8);
--sidebar-accent: oklch(0.832 0.085 281.4 / 30%);
@@ -2528,7 +2528,7 @@ main > .sheet:has(.journey.handing-off) .self-contained-why {
--destructive: oklch(0.792 0.121 16.4);
--success: oklch(0.832 0.13 170.1);
--border: oklch(0.956 0.004 252 / 12%);
- --input: oklch(0.956 0.004 252 / 12%);
+ --input: oklch(0.956 0.004 252 / 16%);
--ring: oklch(0.713 0.151 277.7);
--sidebar: oklch(0.156 0.017 252);
--sidebar-accent: oklch(0.832 0.085 281.4 / 12%);
diff --git a/docs/app-guidelines.md b/docs/app-guidelines.md
index 0f1a0a6bf2..5456437169 100644
--- a/docs/app-guidelines.md
+++ b/docs/app-guidelines.md
@@ -228,10 +228,12 @@ changes, for every screen at once, in a change agreed first.
`rounded-xl` (14px), round things `rounded-full`. `rounded-none` squares a part off. No other
step and no corner of its own (`rounded-[20px]`).
4. **Surfaces.** The frame (`sidebar`), the panel the page sits in (`background`), cards on it
- (`card`). A card has a hairline border in light and in dark. Every line (`border`, a field's
- `input`, the sidebar's `sidebar-border`) is the text color at 10% in light and 12% in dark,
- about 1.25:1 against a card in light and 1.38:1 in dark, so no line in the app is fainter than
- another. A line is never the only cue of a control: a checkbox's edge is `muted-foreground`.
+ (`card`). A card has a hairline border in light and in dark. Every line (`border`, the
+ sidebar's `sidebar-border`) is the text color at 10% in light and 12% in dark, about 1.25:1
+ against a card in light and 1.38:1 in dark, so no line in the app is fainter than another. A
+ field's edge (`input`) is stronger, at 20% in light and 16% in dark (about 1.6:1): a field is
+ filled in the card's own color, so its edge is what shows where it is. A checkbox's edge is
+ `muted-foreground`.
5. **Shadows.** A shadow says how far something floats, as Linear draws it, and Tailwind's own
steps only:
- none for everything in the page: the panel, cards, rows, fields, the sidebar;
diff --git a/docs/design-system.md b/docs/design-system.md
index 08ae60b509..954deba92c 100644
--- a/docs/design-system.md
+++ b/docs/design-system.md
@@ -54,7 +54,9 @@ A screen is a few surfaces, one on another. Each level has its token, and the to
On a surface, a fill marks a part of it: `secondary` and `muted` for a button, a badge or a tile,
`accent` for the highlighted row of a menu. Each surface and fill has a `-foreground` for the text
on it. Every line is `border`, the text color at one strength (10% in light, 12% in dark), so no
-line is fainter than another.
+line is fainter than another. A field's edge, `input`, is the one exception: 20% in light and 16%
+in dark, because a field is filled in the color of the card it sits on and its edge is all that
+shows where it is.
- **Choose the level by what the thing is,** never by the shade you want. A form is a card. A
list of rows sits on the panel, split by lines, with no card. If a card looks wrong where you
@@ -204,7 +206,7 @@ A change to a token or a primitive changes every screen, so it lands differently
| [`app/tests/color-scheme.test.ts`](../app/tests/color-scheme.test.ts) | No class from Tailwind's palette in a screen. |
| [`app/tests/ui-look-guard.test.ts`](../app/tests/ui-look-guard.test.ts) | No corner, shadow, text size, `dark:` color or hand-drawn card of a screen's own. |
| [`app/tests/ui-primitives-look.test.ts`](../app/tests/ui-primitives-look.test.ts) | Every primitive keeps the look's corner and shadow steps, a copied shadcn one included. |
-| [`app/tests/ui-look-theme.test.ts`](../app/tests/ui-look-theme.test.ts) | The one radius, the icons' line, and every line at one strength. |
+| [`app/tests/ui-look-theme.test.ts`](../app/tests/ui-look-theme.test.ts) | The one radius, the icons' line, every line at one strength, and a field's edge at its own. |
| [`app/tests/icon-set.test.ts`](../app/tests/icon-set.test.ts) | One icon set in the web app, the extension and OpenBot Desktop, taken from its module. |
| [`tokens/tests/slate.test.ts`](../tokens/tests/slate.test.ts) | The grays are one family, in light and in dark. |
| [`tokens/tests/contrast.test.ts`](../tokens/tests/contrast.test.ts) | Text reads on the surfaces it is set on (4.5:1) and the focus ring shows (3:1), in light and in dark. |
diff --git a/mobile/src/scheme.ts b/mobile/src/scheme.ts
index 69e1a20777..935752a6da 100644
--- a/mobile/src/scheme.ts
+++ b/mobile/src/scheme.ts
@@ -21,7 +21,7 @@ export const scheme = {
success: "#12795b",
warning: "#a84900",
border: "#0103131a",
- input: "#0103131a",
+ input: "#01031333",
ring: "#727eef",
"chart-1": "#1949c5",
"chart-2": "#cd7d04",
@@ -57,7 +57,7 @@ export const scheme = {
success: "#5fe3bb",
warning: "#ffb900",
border: "#eef1f31f",
- input: "#eef1f31f",
+ input: "#eef1f329",
ring: "#8d97ff",
"chart-1": "#3a70ee",
"chart-2": "#f79807",
diff --git a/tokens/src/scheme.ts b/tokens/src/scheme.ts
index 53796c0e94..5d54555125 100644
--- a/tokens/src/scheme.ts
+++ b/tokens/src/scheme.ts
@@ -82,13 +82,14 @@ const light: Palette = {
success: "oklch(0.514 0.1 167.2)",
warning: "oklch(0.521 0.143 47.7)",
/*
- * Every line (`border`, `input`, `sidebar-border`) is the text color at one strength: 10% here,
- * 12% in dark. That is about 1.25:1 against a card in light and 1.38:1 in dark, as light as the
- * lines in ChatGPT, Claude and Grok. A line is never the only cue of a control: a checkbox's or a
- * radio's edge is `muted-foreground` (docs/design-system.md).
+ * A line (`border`, `sidebar-border`) is the text color at 10% here, 12% in dark: about 1.25:1
+ * against a card in light and 1.38:1 in dark, as light as the lines in ChatGPT, Claude and Grok.
+ * A field's edge (`input`) is the one exception, at 20% here and 16% in dark (about 1.6:1): a
+ * field sits on a card in the card's own color, so its edge is all that shows where it is. A
+ * checkbox's or a radio's edge is `muted-foreground` (docs/design-system.md).
*/
border: "oklch(0.108 0.042 264.7 / 10%)",
- input: "oklch(0.108 0.042 264.7 / 10%)",
+ input: "oklch(0.108 0.042 264.7 / 20%)",
ring: "oklch(0.638 0.167 276.1)",
/*
* The chart series are OpenBot's own hues: the brand blue, warning's amber, success's teal,
@@ -138,7 +139,7 @@ const dark: Palette = {
success: "oklch(0.832 0.13 170.1)",
warning: "oklch(0.828 0.189 84.4)",
border: "oklch(0.956 0.004 252 / 12%)",
- input: "oklch(0.956 0.004 252 / 12%)",
+ input: "oklch(0.956 0.004 252 / 16%)",
ring: "oklch(0.713 0.151 277.7)",
"chart-1": "oklch(0.58 0.2 264)",
"chart-2": "oklch(0.76 0.168 66)",