diff --git a/app/src/assets/brands/github.svg b/app/src/assets/brands/github.svg deleted file mode 100644 index e3be0e551c..0000000000 --- a/app/src/assets/brands/github.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - GitHub - - - - - - - - - diff --git a/app/src/components/app-sidebar/conversations-panel.tsx b/app/src/components/app-sidebar/conversations-panel.tsx index ee67462ad7..73a6c92c5d 100644 --- a/app/src/components/app-sidebar/conversations-panel.tsx +++ b/app/src/components/app-sidebar/conversations-panel.tsx @@ -477,24 +477,6 @@ export function ConversationsPanel({ hidden = false }: { hidden?: boolean }) { - {/* - * What Bots made in these conversations, kept as things of their own: the Artifacts - * page, the one destination in this panel that is not a conversation. - */} - - ( - - - Artifacts - - )} - /> - {searching ? ( diff --git a/app/src/components/bot-profile/routines-summary.tsx b/app/src/components/bot-profile/routines-summary.tsx index 8618bfb4b4..0b10c9ca11 100644 --- a/app/src/components/bot-profile/routines-summary.tsx +++ b/app/src/components/bot-profile/routines-summary.tsx @@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { Link } from "@tanstack/react-router"; import { Fragment } from "react"; import { PageRows, PageSection } from "@/components/layout/page-shell"; -import { RoutineRow, routineCount } from "@/components/routines/routine-row"; +import { RoutineRow } from "@/components/routines/routine-row"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import { loadFailure } from "@/lib/load-failure"; @@ -47,9 +47,13 @@ export function BotRoutinesSummary({ agentId }: { agentId: string }) { return ( - {routineCount(listed.length)} - + } title="Routines" > @@ -76,14 +80,6 @@ export function BotRoutinesSummary({ agentId }: { agentId: string }) { Every goal this Bot had is completed.

)} -
); } diff --git a/app/src/components/browser/teach-steps.tsx b/app/src/components/browser/teach-steps.tsx index b8a6fc020d..d23f5de725 100644 --- a/app/src/components/browser/teach-steps.tsx +++ b/app/src/components/browser/teach-steps.tsx @@ -4,7 +4,7 @@ import { Link } from "@tanstack/react-router"; import { type ReactNode, useEffect, useState } from "react"; import { ComputerBlocked } from "@/components/computer/computer-blocked"; import { IconArrowLeft } from "@/components/icons"; -import { PageRows } from "@/components/layout/page-shell"; +import { PageCard, PageRows } from "@/components/layout/page-shell"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Item, ItemContent } from "@/components/ui/item"; @@ -121,7 +121,7 @@ export function TeachSteps({ state }: { state: BrowserApiState }) { } > - + - + ); } else if (live) { @@ -161,7 +161,7 @@ export function TeachSteps({ state }: { state: BrowserApiState }) { title="Recording in your browser" description="Do the task in your browser. When you're done, press Stop at the top of the tab and save." > - + setStep(2)}>Record another} > - + @@ -298,7 +298,7 @@ function SavedStep({ } > - + {learning.loaded ? ( <> diff --git a/app/src/components/connections/apps-toolbar.tsx b/app/src/components/connections/apps-toolbar.tsx index f40eb357d3..848ba870ef 100644 --- a/app/src/components/connections/apps-toolbar.tsx +++ b/app/src/components/connections/apps-toolbar.tsx @@ -7,8 +7,8 @@ import { InputGroupAddon, InputGroupInput, } from "@/components/ui/input-group"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import type { PluginsProvider } from "@/lib/plugins/provider-vocabulary"; -import { cn } from "@/lib/utils"; export function browseAppsLink(provider: PluginsProvider | null) { if (!provider) @@ -31,30 +31,41 @@ export function AppsNavigation({ provider: PluginsProvider | null; browsing?: boolean; }) { - const style = (active: boolean) => - cn( - "border-b-2 border-transparent px-1 pb-2 text-sm font-medium text-muted-foreground", - active && "border-foreground text-foreground", - ); return ( - + } + value={browsing ? "browse" : "yours"} + > + + + } + value="yours" + > + Your apps + + + } + value="browse" + > + Browse apps + + + ); } @@ -62,19 +73,23 @@ export function AppsToolbar({ search, onSearch, mayAdd, + ref, + count, placeholder = "Search apps", children, }: { search: string; onSearch: (value: string) => void; mayAdd: boolean; + ref?: React.Ref; + count?: string; placeholder?: string; children?: ReactNode; }) { return ( -
+
- + @@ -86,6 +101,11 @@ export function AppsToolbar({ onChange={(event) => onSearch(event.target.value)} /> + {count && ( + + {count} + + )} {mayAdd && ( @@ -222,13 +210,19 @@ export function SkillPage({ ) : undefined } backButton={back} - description={skillByline(skill, me?.id, paths.edition)} + description={ + <> + {skill.summary && ( + {skill.summary} + )} + + {skillByline(skill, me?.id, paths.edition)} + + + } title={skill.title} > -
- {skill.summary ?

{skill.summary}

: null} - -
+ {error ? (

@@ -238,7 +232,7 @@ export function SkillPage({ {/* Their own skill on their own Bots: what a person may grant in the team edition. */} {!manages && yours ? ( - + ) : null} @@ -316,34 +310,21 @@ export function SkillPage({ )} - {/* A row that opens the confirmation, as deleting a Bot is on its own page. */} - {/* Teams are the team edition's: with one person there is nobody to grant a skill to. */} - {paths.edition === "team" ? ( + {paths.edition === "team" && ( - ) : null} - setRemoving(true)} type="button" /> - } - size="sm" - > - - Delete - - People can't run it any more, and no Bot offers it. You - can't undo this. - - - - - - + )} + setRemoving(true)} + /> 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}

- - +
); } @@ -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 f677ab7129..1776f9e507 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,76 +334,85 @@ 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. + */} +
-
- {categories.map((name) => ( - - ))} + {categories.map((name) => ( -
- -
+ ))} + + + )} + {!showFeatured && total !== null && !pending && ( + + {total.toLocaleString()}{" "} + {query + ? total === 1 + ? "match" + : "matches" + : total === 1 + ? "app" + : "apps"} + + )} + +
+ ) : undefined + } description={discover ? undefined : description.search} - title={discover ? undefined : "Apps"} + id={discover ? RESULTS_ID : undefined} + title={ + discover + ? (category ?? + (query + ? "Search results" + : showFeatured + ? "Popular apps" + : "All apps")) + : "Apps" + } > - {discover && ( -
-

- {category ?? - (query - ? "Search results" - : showFeatured - ? "Popular apps" - : "All apps")} -

- {!showFeatured && ( - - {total !== null && !pending - ? `${total.toLocaleString()} ${query ? (total === 1 ? "match" : "matches") : "apps"}` - : null} - - )} - -
- )} {press.error ? (

@@ -481,7 +498,7 @@ export function BrokerDirectory({

{listed.map((entry, index) => { @@ -508,17 +525,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", - }) - } - /> - -
- ) - } - 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" - /> - - -

diff --git a/app/src/components/routines/delete-row.tsx b/app/src/components/routines/delete-row.tsx index f10efb22a4..b7bafd97ac 100644 --- a/app/src/components/routines/delete-row.tsx +++ b/app/src/components/routines/delete-row.tsx @@ -6,9 +6,9 @@ import { } from "@/components/ui/item"; /** - * Delete a goal, a schedule or a check-in, after a confirmation the page opens. A row in a card of - * its own, in the last section of the page: away from the everyday controls, so it is never pressed - * on the way to Run now, and still a row, never a button left on its own under the page. + * The last row of a goal's, a schedule's or a check-in's actions card: delete it, after a + * confirmation the page opens. A row in the card with the page's other actions, never a button left + * on its own under the page, which reads as something that fell out of the layout. */ export function DeleteRow({ title, diff --git a/app/src/components/routines/edit-routine-dialog.tsx b/app/src/components/routines/edit-routine-page.tsx similarity index 73% rename from app/src/components/routines/edit-routine-dialog.tsx rename to app/src/components/routines/edit-routine-page.tsx index 345bb07b45..06e52e4024 100644 --- a/app/src/components/routines/edit-routine-dialog.tsx +++ b/app/src/components/routines/edit-routine-page.tsx @@ -1,6 +1,11 @@ import { useSelector } from "@tanstack/react-form"; -import { useMutation } from "@tanstack/react-query"; -import { useEffect, useId, useRef, useState } from "react"; +import { useMutation, useQuery } from "@tanstack/react-query"; +import { Link, linkOptions, useNavigate } from "@tanstack/react-router"; +import { useEffect, useRef, useState } from "react"; +import { IconCalendarTime } from "@/components/icons"; +import { PageCard, PageShell } from "@/components/layout/page-shell"; +import { routinesOf } from "@/components/routines/new-routine-page"; +import { RoutineDetailMissing } from "@/components/routines/routine-detail-missing"; import { ScheduleWhen, useRoutineForm, @@ -14,15 +19,6 @@ import { ComboboxItem, ComboboxList, } from "@/components/ui/combobox"; -import { - Dialog, - DialogBody, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; import { Field, FieldDescription, @@ -33,6 +29,7 @@ import { import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import type { UpdateRoutineRequest } from "@/lib/api/generated/model"; +import { failureSaid } from "@/lib/load-failure"; import { browserTimeZone, cronFrom, @@ -42,17 +39,19 @@ import { scheduleFrom, } from "@/lib/routines/form"; import { updateRoutineMutationOptions } from "@/lib/routines/mutations"; -import type { RoutineRecord } from "@/lib/routines/queries"; +import { + type RoutineRecord, + routinesQueryOptions, +} from "@/lib/routines/queries"; import { queryClient } from "@/query-client"; -import { failureSaid } from "@/lib/load-failure"; -/** The fields this dialog draws, each with the first rule its answer breaks. */ +/** The fields this page draws, each with the first rule its answer breaks. */ type Edited = "title" | "instruction" | "time"; type Messages = Partial>; const EDITED: readonly Edited[] = ["title", "instruction", "time"]; -/** The rules New routine holds a routine on, for the fields this dialog draws. */ +/** The rules New routine holds a routine on, for the fields this page draws. */ function brokenRules(values: RoutineFormValues): Messages { const messages: Messages = {}; const parsed = routineFormSchema.safeParse(values); @@ -75,7 +74,7 @@ function sameMessages(a: Messages, b: Messages): boolean { /** * Every time zone the browser knows, with the routine's own and the person's first. A zone the * browser doesn't list (an older alias the routine was saved with) is still offered, so opening the - * dialog never changes it. + * page never changes it. */ function timeZones(current: string): string[] { let known: string[] = []; @@ -88,54 +87,60 @@ function timeZones(current: string): string[] { } /** - * Edit routine: its name, what the Bot does, when it runs and the time zone that's read in. The same - * fields and the same schedule picker as New routine, prefilled with what it is now. Saving changes - * only what was changed, and the routine keeps its id, its conversation and its runs. + * Edit routine at `/routines/schedules/$routineId/edit`, reached from Edit on the routine's page. It + * was a dialog over that page; more than one value is edited, so it is a screen of its own. * - * A schedule the picker can't express (a Bot wrote "every other Tuesday") is offered first, by the - * words its row uses, and kept unless another is picked. A routine that runs a goal does what its - * goal says, so it has no What to do here. + * Read from the routines list, as the routine's page is. `agentId` is the Bot whose Routines page it + * came from, kept on the way back to the routine so the routine's own back link still returns there. */ -export function EditRoutineDialog({ - routine, - open, - onOpenChange, +export function EditRoutineRoutePage({ + routineId, + agentId, }: { - routine: RoutineRecord; - open: boolean; - onOpenChange: (open: boolean) => void; + routineId: string; + agentId?: string; }) { + const routines = useQuery(routinesQueryOptions()); + const routine = routines.data?.routines.find((row) => row.id === routineId); + if (!routine) + return ( + + ); return ( - - - - Edit routine - - It keeps its runs and its conversation. - - - {/* Mounted per opening, so each one starts from the routine as it is now. */} - {open ? ( - onOpenChange(false)} - routine={routine} - /> - ) : null} - - + ); } -function EditRoutineForm({ +/** + * Edit routine: its name, what the Bot does, when it runs and the time zone that's read in. The same + * fields and the same schedule picker as New routine, prefilled with what it is now, in one card. + * Saving changes only what was changed, and the routine keeps its id, its conversation and its runs. + * Save and Cancel both return to the routine's page. + * + * A schedule the picker can't express (a Bot wrote "every other Tuesday") is offered first, by the + * words its row uses, and kept unless another is picked. A routine that runs a goal does what its + * goal says, so it has no What to do here. + */ +export function EditRoutinePage({ routine, - onDone, + agentId, }: { routine: RoutineRecord; - onDone: () => void; + agentId?: string; }) { - const formId = useId(); + const navigate = useNavigate(); + const toRoutine = linkOptions({ + to: "/routines/schedules/$routineId", + params: { routineId: routine.id }, + search: agentId ? { agentId } : {}, + }); const update = useMutation(updateRoutineMutationOptions(queryClient)); - // Taken once, when the dialog opened: a refetch landing while it is open must not reset the answers. + // Taken once, when the page opened: a refetch landing while it is open must not reset the answers. const [opened] = useState(() => { const schedule = scheduleFrom(routine.cron); return { @@ -154,6 +159,7 @@ function EditRoutineForm({ const [timeZone, setTimeZone] = useState(routine.timezone); const [zones] = useState(() => timeZones(routine.timezone)); const runsGoal = routine.goalId !== null; + const done = () => navigate(toRoutine); const form = useRoutineForm(opened.values, async (value) => { if (Object.keys(brokenRules(value)).length > 0) return; @@ -168,18 +174,18 @@ function EditRoutineForm({ if (cron !== routine.cron) changes.cron = cron; } if (timeZone !== routine.timezone) changes.timezone = timeZone; - // Nothing changed is not a save: close as Cancel would. + // Nothing changed is not a save: go back as Cancel would. if (Object.keys(changes).length === 0) { - onDone(); + await done(); return; } try { await update.mutateAsync({ id: routine.id, changes }); } catch { - // Said under the fields, from `update.error`. Staying open says it wasn't saved. + // Said under the fields, from `update.error`. Staying here says it wasn't saved. return; } - onDone(); + await done(); }); // A message shows once its field was worked on, or on every field once Save was pressed. @@ -212,16 +218,40 @@ function EditRoutineForm({ const saving = update.isPending; return ( - <> - -
{ - event.preventDefault(); - if (!saving) void form.handleSubmit(); - }} - ref={formRef} + + { + event.preventDefault(); + if (!saving) void form.handleSubmit(); + }} + ref={formRef} + > + + {saving ? ( + + ) : ( + + )} + + + } > @@ -350,28 +380,15 @@ function EditRoutineForm({ The schedule's times are read in this time zone. + + {update.error ? ( +

+ {failureSaid(update.error)} +

+ ) : null}
- - {update.error ? ( -

- {failureSaid(update.error)} -

- ) : null} -
- - - - - + + + ); } diff --git a/app/src/components/routines/routine-page.tsx b/app/src/components/routines/routine-page.tsx index efd8d6849e..ab759a2e28 100644 --- a/app/src/components/routines/routine-page.tsx +++ b/app/src/components/routines/routine-page.tsx @@ -11,13 +11,11 @@ import { } from "@/components/icons"; import { LoadingRows } from "@/components/layout/loading-rows"; import { - PageCard, PageRows, PageSection, PageShell, } from "@/components/layout/page-shell"; import { DeleteRow } from "@/components/routines/delete-row"; -import { EditRoutineDialog } from "@/components/routines/edit-routine-dialog"; import { routinesOf } from "@/components/routines/new-routine-page"; import { RoutineDetailMissing, @@ -238,6 +236,7 @@ export function RoutineRoutePage({ const botName = listed ?? alone.data?.name; return ( - {/* Binary and immediate: it takes effect when switched, there is no save. */} - - setEnabled.mutate({ id: routine.id, enabled }) - } - /> - - {/* More than one value, so a dialog: the same fields New routine asks for. */} - - + // More than one value, so a screen of its own: the same fields New routine asks for. + } 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..14e7c0489d 100644 --- a/app/src/components/routines/routines-home.tsx +++ b/app/src/components/routines/routines-home.tsx @@ -64,7 +64,12 @@ export function RoutinesHome() { return ( header]:items-center [&>header]:text-center [&_[data-slot=page-title]]:text-3xl" + : undefined + } + title={empty ? "Give your Bots some work" : "Routines"} > source.unavailable); // Sources that share a label are one group: the same words to the person, one Learn now. const groups: { + kind: "recordings" | "conversations"; label: string; containers: string[]; latestRun: LearningRunSummary | null; @@ -230,6 +231,7 @@ export function LearningReview({ let group = groups.find((candidate) => candidate.label === source.label); if (!group) { group = { + kind: source.kind, label: source.label, containers: [], latestRun: null, @@ -248,22 +250,9 @@ export function LearningReview({ if (proposal.status === "pending_review") group.waiting.push({ container: source.containerId, proposal }); } - const anyWaiting = groups.some((group) => group.waiting.length > 0); - // With automatic approval on, an empty list says nothing the switch doesn't. - const showList = autoApproveOn !== true || anyWaiting; - // The heading says something waits only when a skill does: not while Learning runs, and not with nothing left to approve. - const heading = !anyWaiting - ? { title: "New skills", description: undefined } - : canReview - ? { - title: "Waiting for your review", - description: "Approve a skill to publish it to your Bots.", - } - : { - title: "Waiting for an admin", - description: - "An admin reviews these. You can read what Learning proposes here.", - }; + const description = canReview + ? "Approve a skill to publish it to your Bots." + : "An admin reviews these. You can read what Learning proposes here."; const learnNowFor = async (group: { label: string; containers: string[]; @@ -295,13 +284,101 @@ export function LearningReview({ })); }; + const waiting = groups.flatMap((group) => group.waiting); return ( - - {stale ? ( -

- {stale} -

- ) : null} + <> + {canReview && groups.length > 0 && ( + + {groups.map((group, index) => { + const title = + group.kind === "recordings" + ? "Learn from saved recordings" + : "Learn from finished conversations"; + const busy = learningInProgress(group, starting[group.label]); + const needsLabel = groups.some( + (other) => + other.kind === group.kind && other.label !== group.label, + ); + return ( + + {index > 0 && } + learnNowFor(group)} + /> + } + > + + {group.kind === "recordings" ? ( + + ) : ( + + )} + + + + {title} + {needsLabel && ` · ${group.label}`} + + + {group.kind === "recordings" + ? "Check tasks you’ve already recorded for reusable skills." + : "Check completed chats for reusable skills."} + {busy && ( + Learning in progress… + )} + {group.latestRun && ( + + {latestRunLine(group.latestRun)} + + )} + + + + + + ); + })} + + )} + {waiting.length > 0 && ( + + + {waiting.map(({ container, proposal }, index) => ( + + {index > 0 && } + setOpen({ container, id: proposal.id })} + type="button" + /> + } + size="sm" + > + + + {skillTitle(proposal.title, proposal.description)} + + {proposal.description} + + + + {operationLabel(proposal)} + + + + + + ))} + + + )} {autoApproveOn !== null && ( @@ -322,79 +399,11 @@ export function LearningReview({ )} - {groups - .filter((group) => canReview || group.waiting.length > 0) - .map((group) => ( - - - - - {group.label} - {canReview && ( - - {group.latestRun - ? latestRunLine(group.latestRun) - : "No run yet."} - - )} - - {canReview && ( - - - - )} - - {group.waiting.map(({ container, proposal }) => ( - - - setOpen({ container, id: proposal.id })} - type="button" - /> - } - size="sm" - > - - - {skillTitle(proposal.title, proposal.description)} - - {proposal.description} - - - - {operationLabel(proposal)} - - - - - - ))} - - {canReview && } - - ))} - {showList && !anyWaiting && !unreadable && !unavailable && ( - - {autoApprove !== null - ? "New proposals show up here after Learning analyses your recordings and conversations." - : "New proposals show up here after Learning analyses your recordings."} - - )} + {stale ? ( +

+ {stale} +

+ ) : null} {saveAutoApprove.error && (

{failureSaid(saveAutoApprove.error)} @@ -445,6 +454,6 @@ export function LearningReview({ publishedNote="Published. Your Bots use it from their next conversation." /> )} - + ); } diff --git a/app/src/components/skills/skill-agents.tsx b/app/src/components/skills/skill-agents.tsx index 9749a10486..65fb90f12b 100644 --- a/app/src/components/skills/skill-agents.tsx +++ b/app/src/components/skills/skill-agents.tsx @@ -1,8 +1,8 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Button } from "@/components/ui/button"; import { agentListQueryOptions } from "@/lib/agents/queries"; -import { setPluginGrantMutationOptions } from "@/lib/plugins/mutations"; import { failureSaid } from "@/lib/load-failure"; +import { setPluginGrantMutationOptions } from "@/lib/plugins/mutations"; /** * Which of your Agents carry this skill. @@ -36,8 +36,7 @@ export function SkillAgents({ grant.mutate({ agentId, granted: !on, kind: "skill", ref: slug }); return ( -

-

Bots

+
{mine.length === 0 ? (

You don't have a Bot of your own yet. diff --git a/app/src/components/skills/skill-overview.tsx b/app/src/components/skills/skill-overview.tsx index 1f7f89bc18..7b87f95003 100644 --- a/app/src/components/skills/skill-overview.tsx +++ b/app/src/components/skills/skill-overview.tsx @@ -1,7 +1,15 @@ +import { appKey } from "@openbot/shared/audit-filters"; import { RESEARCH_ROLES } from "@openbot/shared/research"; import { useQuery } from "@tanstack/react-query"; -import { PageCard } from "@/components/layout/page-shell"; +import { IconTool } from "@/components/icons"; +import { + appVendorLogo, + appVendorMark, + GithubMark, + PluginLogo, +} from "@/components/plugins/plugin-logo"; import { toolTitle } from "@/components/skills/skill-tools"; +import { Card, CardTitle } from "@/components/ui/card"; import { appsQueryOptions } from "@/lib/apps/queries"; import type { Skill } from "@/lib/skills/queries"; @@ -64,7 +72,7 @@ function toolGroups( const list = (groups: Map) => [...groups].map(([title, tools]) => ({ title, - tools: tools.filter(Boolean), + tools: [...new Set(tools.filter(Boolean))], })); return { connected: list(connected), missing: list(missing) }; } @@ -72,16 +80,39 @@ function toolGroups( function ToolGroups({ groups }: { groups: ToolGroup[] }) { return (

    - {groups.map((group) => ( -
  • -
    {group.title}
    - {group.tools.length > 0 ? ( -
    - {group.tools.join(", ")} + {groups.map((group) => { + const vendor = appKey(group.title); + const mark = vendor === "github" ? GithubMark : appVendorMark(vendor); + return ( +
  • +
    + + {vendor === "googledrive" ? "Google Drive" : group.title}
    - ) : null} -
  • - ))} + {group.tools.length > 0 && ( +
      + {group.tools.map((tool) => ( +
    • +
    • + ))} +
    + )} + + ); + })}
); } @@ -120,18 +151,22 @@ function SkillToolList({ refs }: { refs: string[] }) { export function SkillOverview({ skill }: { skill: Skill }) { return (
-
- -

Tools it needs

+ +
+ +

Tools it needs

+
- -
-

Instructions

+
+
+ +

Instructions

+

{skill.instructions}

-
+
); } diff --git a/app/src/components/skills/skills-settings-page.tsx b/app/src/components/skills/skills-settings-page.tsx index e7c9bdbf4f..cb77f6ea8c 100644 --- a/app/src/components/skills/skills-settings-page.tsx +++ b/app/src/components/skills/skills-settings-page.tsx @@ -1,8 +1,11 @@ import { useMutation, useQuery } from "@tanstack/react-query"; import { Link, useNavigate } from "@tanstack/react-router"; import { useState } from "react"; -import { TEACH_A_BOT } from "@/components/browser/browser-nav-item"; -import { IconChevronRight, IconDots } from "@/components/icons"; +import { + IconChalkboardTeacher, + IconChevronRight, + IconDots, +} from "@/components/icons"; import { DetailPanel } from "@/components/layout/detail-panel"; import { PageAddButton, @@ -29,6 +32,7 @@ import { ItemActions, ItemContent, ItemDescription, + ItemMedia, ItemTitle, } from "@/components/ui/item"; import { Separator } from "@/components/ui/separator"; @@ -57,10 +61,10 @@ import { NewSkill } from "./new-skill"; * skill someone wrote opens its own screen, read first, with Edit for the form * (`/skills/$slug`); learned ones open their dialog and keep the team edition's sharing switches * (`LearningSharing`). - * 2. Workspace skills, team edition only: the admin's. Each opens the same screen, with no Edit. - * 3. Who else's Bots use your skills, team edition only: after the lists, so both are read first. - * 4. Waiting for your review: what OpenBot proposes, with Learn now and automatic approval. - * 5. Teach a Bot: one row to the recording page, where OpenBot can run a browser for you. + * 2. Teach a Bot: record a task. + * 3. Proposed skills: review what OpenBot suggests. + * 4. Workspace skills, team edition only: the admin's. Each opens the same screen, with no Edit. + * 5. Who else's Bots use your skills, team edition only: after the lists, so both are read first. * * Writing a new skill in the team edition is a search parameter, as it was on Capabilities, so the * list stays behind the panel and the panel is linkable and closed by Back. @@ -71,9 +75,9 @@ export function SkillsSettingsPage({ creating }: { creating: boolean }) { const personal = paths.edition === "personal"; const skillList = useQuery(skillListQueryOptions()); const me = useQuery(currentUserQueryOptions()); + const browser = useQuery(browserStateQueryOptions()); const { data: agents } = useQuery(agentListQueryOptions()); const { data: hiddenAgents } = useQuery(agentListQueryOptions(true)); - const browser = useQuery(browserStateQueryOptions()); // The error itself, not its words, so a hold is drawn calmly (lib/load-failure.tsx). const [error, setError] = useState(null); const removeSkill = useMutation({ @@ -102,9 +106,13 @@ export function SkillsSettingsPage({ creating }: { creating: boolean }) { const writtenRow = (skill: Skill) => ( - {/* The row opens the skill's screen; the menu sits beside that link, not inside it. */} + {/* + * The name and summary open the skill's screen. The menu sits beside that link, not inside + * it, so the row can't be one link through `render`, and has no chevron: a chevron outside + * the link would open nothing. + */} @@ -158,7 +166,6 @@ export function SkillsSettingsPage({ creating }: { creating: boolean }) { - ); @@ -242,8 +249,6 @@ export function SkillsSettingsPage({ creating }: { creating: boolean }) { > + + {browser.data?.available && ( + + } size="sm"> + + + + + Record a task + + Show a Bot a task once in your browser. When Learning + is on, OpenBot automatically checks your recording for + skills. + + + + + + + + )} + + + {workspace} + + } heldAbove={heldAbove} written={written} writtenKnown={writtenKnown} /> - - - - {/* Only where OpenBot can run a browser for this person. */} - {browser.data?.available ? ( - - - } size="sm"> - - Record a task - - Show a Bot a task once in your browser, and OpenBot turns - the steps into a skill. - - - - - - - - - ) : null} ); diff --git a/app/src/components/suggestions/check-in-page.tsx b/app/src/components/suggestions/check-in-page.tsx index 12870186fc..6c0542f369 100644 --- a/app/src/components/suggestions/check-in-page.tsx +++ b/app/src/components/suggestions/check-in-page.tsx @@ -123,9 +123,8 @@ export function CheckInRoutePage({ } /** - * Everything about one check-in: whether it is on (on the title's line), running it now, how often - * it looks, and removing it. Each takes effect at once; Remove, in its own section at the bottom, - * asks first, then returns to the list. + * Everything about one check-in: whether it is on, running it now, how often it looks, and removing + * it. Each takes effect at once; Remove, the last row, asks first, then returns to the list. */ export function CheckInPage({ setting, @@ -162,33 +161,13 @@ export function CheckInPage({ return ( - {/* Binary and immediate: it takes effect when switched, there is no save. */} - { - if (next !== setting.enabled) - change.mutate({ setting, change: { kind: "toggle" } }); - }} - /> - -
- } 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 ? ( +

+ {failureSaid(change.error)} +

+ ) : null}
diff --git a/app/src/components/ui/badge.tsx b/app/src/components/ui/badge.tsx new file mode 100644 index 0000000000..ec6f5fa28d --- /dev/null +++ b/app/src/components/ui/badge.tsx @@ -0,0 +1,61 @@ +import { mergeProps } from "@base-ui/react/merge-props"; +import { useRender } from "@base-ui/react/use-render"; +import { cva, type VariantProps } from "class-variance-authority"; + +import { cn } from "@/lib/utils"; + +/* + * shadcn's Badge, in its Base UI flavor. Two edits, both to the look (docs/app-guidelines.md): + * the corner is `rounded-full`, the step for round things, where shadcn writes `rounded-4xl`; and + * the `dark:` overrides are gone, since every token already carries its dark value. + * + * `muted` and `warning` are ours, beside shadcn's variants and never in place of one: `muted` for a + * quiet state ("Paused"), `warning` for one that wants a look ("needs review"). + */ +const badgeVariants = cva( + "inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80", + secondary: + "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80", + destructive: + "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 [a]:hover:bg-destructive/20", + outline: + "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground", + ghost: "hover:bg-muted hover:text-muted-foreground", + link: "text-primary underline-offset-4 hover:underline", + muted: "bg-muted text-muted-foreground", + warning: "bg-warning/10 text-warning", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); + +function Badge({ + className, + variant = "default", + render, + ...props +}: useRender.ComponentProps<"span"> & VariantProps) { + return useRender({ + defaultTagName: "span", + props: mergeProps<"span">( + { + className: cn(badgeVariants({ className, variant })), + }, + props, + ), + render, + state: { + slot: "badge", + variant, + }, + }); +} + +export { Badge, badgeVariants }; diff --git a/app/src/components/what-if/what-if-result.tsx b/app/src/components/what-if/what-if-result.tsx index 204eb23739..5bea706e29 100644 --- a/app/src/components/what-if/what-if-result.tsx +++ b/app/src/components/what-if/what-if-result.tsx @@ -213,10 +213,9 @@ export function WhatIfResultView({ }) { const outcome = OUTCOMES[result.outcome]; const decider = result.layers.find((layer) => layer.decides); - const rows = cn(inDialog && "bg-muted dark:bg-muted"); return (
- + {outcome.label} @@ -228,7 +227,7 @@ export function WhatIfResultView({ - + {result.layers.map((layer, index) => (
{index > 0 ? : null} diff --git a/app/src/routeTree.gen.ts b/app/src/routeTree.gen.ts index af92cfb307..d1f3cc991b 100644 --- a/app/src/routeTree.gen.ts +++ b/app/src/routeTree.gen.ts @@ -160,6 +160,7 @@ import { Route as AuthedAppBotsAgentIdSetupFieldRouteImport } from './routes/_au import { Route as AuthedAppBotsAgentIdSetupKeyRouteImport } from './routes/_authed/_app/bots.$agentId.setup_.key' import { Route as AuthedAppConnectionsKeyBotsAgentIdRouteImport } from './routes/_authed/_app/connections.$key_.bots.$agentId' import { Route as AuthedAppConnectionsKeyToolsToolRouteImport } from './routes/_authed/_app/connections.$key_.tools.$tool' +import { Route as AuthedAppRoutinesSchedulesRoutineIdEditRouteImport } from './routes/_authed/_app/routines_.schedules.$routineId_.edit' import { Route as AuthedAdminPluginsKeyBotsAgentIdRouteImport } from './routes/_authed/admin/plugins/$key_.bots.$agentId' import { Route as AuthedAdminPluginsKeyToolsToolRouteImport } from './routes/_authed/admin/plugins/$key_.tools.$tool' @@ -983,6 +984,12 @@ const AuthedAppConnectionsKeyToolsToolRoute = path: '/connections/$key/tools/$tool', getParentRoute: () => AuthedAppRoute, } as any) +const AuthedAppRoutinesSchedulesRoutineIdEditRoute = + AuthedAppRoutinesSchedulesRoutineIdEditRouteImport.update({ + id: '/routines_/schedules/$routineId_/edit', + path: '/routines/schedules/$routineId/edit', + getParentRoute: () => AuthedAppRoute, + } as any) const AuthedAdminPluginsKeyBotsAgentIdRoute = AuthedAdminPluginsKeyBotsAgentIdRouteImport.update({ id: '/plugins/$key_/bots/$agentId', @@ -1145,6 +1152,7 @@ export interface FileRoutesByFullPath { '/bots/$agentId/setup/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/connections/$key/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute '/connections/$key/tools/$tool': typeof AuthedAppConnectionsKeyToolsToolRoute + '/routines/schedules/$routineId/edit': typeof AuthedAppRoutinesSchedulesRoutineIdEditRoute '/admin/plugins/$key/bots/$agentId': typeof AuthedAdminPluginsKeyBotsAgentIdRoute '/admin/plugins/$key/tools/$tool': typeof AuthedAdminPluginsKeyToolsToolRoute } @@ -1295,6 +1303,7 @@ export interface FileRoutesByTo { '/bots/$agentId/setup/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/connections/$key/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute '/connections/$key/tools/$tool': typeof AuthedAppConnectionsKeyToolsToolRoute + '/routines/schedules/$routineId/edit': typeof AuthedAppRoutinesSchedulesRoutineIdEditRoute '/admin/plugins/$key/bots/$agentId': typeof AuthedAdminPluginsKeyBotsAgentIdRoute '/admin/plugins/$key/tools/$tool': typeof AuthedAdminPluginsKeyToolsToolRoute } @@ -1451,6 +1460,7 @@ export interface FileRoutesById { '/_authed/_app/bots/$agentId/setup_/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/_authed/_app/connections/$key_/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute '/_authed/_app/connections/$key_/tools/$tool': typeof AuthedAppConnectionsKeyToolsToolRoute + '/_authed/_app/routines_/schedules/$routineId_/edit': typeof AuthedAppRoutinesSchedulesRoutineIdEditRoute '/_authed/admin/plugins/$key_/bots/$agentId': typeof AuthedAdminPluginsKeyBotsAgentIdRoute '/_authed/admin/plugins/$key_/tools/$tool': typeof AuthedAdminPluginsKeyToolsToolRoute } @@ -1605,6 +1615,7 @@ export interface FileRouteTypes { | '/bots/$agentId/setup/key' | '/connections/$key/bots/$agentId' | '/connections/$key/tools/$tool' + | '/routines/schedules/$routineId/edit' | '/admin/plugins/$key/bots/$agentId' | '/admin/plugins/$key/tools/$tool' fileRoutesByTo: FileRoutesByTo @@ -1755,6 +1766,7 @@ export interface FileRouteTypes { | '/bots/$agentId/setup/key' | '/connections/$key/bots/$agentId' | '/connections/$key/tools/$tool' + | '/routines/schedules/$routineId/edit' | '/admin/plugins/$key/bots/$agentId' | '/admin/plugins/$key/tools/$tool' id: @@ -1910,6 +1922,7 @@ export interface FileRouteTypes { | '/_authed/_app/bots/$agentId/setup_/key' | '/_authed/_app/connections/$key_/bots/$agentId' | '/_authed/_app/connections/$key_/tools/$tool' + | '/_authed/_app/routines_/schedules/$routineId_/edit' | '/_authed/admin/plugins/$key_/bots/$agentId' | '/_authed/admin/plugins/$key_/tools/$tool' fileRoutesById: FileRoutesById @@ -2983,6 +2996,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthedAppConnectionsKeyToolsToolRouteImport parentRoute: typeof AuthedAppRoute } + '/_authed/_app/routines_/schedules/$routineId_/edit': { + id: '/_authed/_app/routines_/schedules/$routineId_/edit' + path: '/routines/schedules/$routineId/edit' + fullPath: '/routines/schedules/$routineId/edit' + preLoaderRoute: typeof AuthedAppRoutinesSchedulesRoutineIdEditRouteImport + parentRoute: typeof AuthedAppRoute + } '/_authed/admin/plugins/$key_/bots/$agentId': { id: '/_authed/admin/plugins/$key_/bots/$agentId' path: '/plugins/$key/bots/$agentId' @@ -3256,6 +3276,7 @@ interface AuthedAppRouteChildren { AuthedAppBotsAgentIdSetupKeyRoute: typeof AuthedAppBotsAgentIdSetupKeyRoute AuthedAppConnectionsKeyBotsAgentIdRoute: typeof AuthedAppConnectionsKeyBotsAgentIdRoute AuthedAppConnectionsKeyToolsToolRoute: typeof AuthedAppConnectionsKeyToolsToolRoute + AuthedAppRoutinesSchedulesRoutineIdEditRoute: typeof AuthedAppRoutinesSchedulesRoutineIdEditRoute } const AuthedAppRouteChildren: AuthedAppRouteChildren = { @@ -3327,6 +3348,8 @@ const AuthedAppRouteChildren: AuthedAppRouteChildren = { AuthedAppConnectionsKeyBotsAgentIdRoute: AuthedAppConnectionsKeyBotsAgentIdRoute, AuthedAppConnectionsKeyToolsToolRoute: AuthedAppConnectionsKeyToolsToolRoute, + AuthedAppRoutinesSchedulesRoutineIdEditRoute: + AuthedAppRoutinesSchedulesRoutineIdEditRoute, } const AuthedAppRouteWithChildren = AuthedAppRoute._addFileChildren( diff --git a/app/src/routes/_authed/_app/connections.index.tsx b/app/src/routes/_authed/_app/connections.index.tsx index 25af5ded52..3c32b36da8 100644 --- a/app/src/routes/_authed/_app/connections.index.tsx +++ b/app/src/routes/_authed/_app/connections.index.tsx @@ -510,7 +510,7 @@ function RouteComponent() { open === undefined; return ( - + {/* * BOTH APP READS DECIDE THIS. Apps that loaded (listApps, the catalogue, getAppSetup) beside a * listConnections that failed would leave the `connected` set empty and every row @@ -619,60 +624,46 @@ function RouteComponent() { ) : null}
+ ) : matching.length > 0 ? ( + + ) : query ? ( + + Nothing matches “{search.trim()}”. + ) : ( - <> -
-

- {browsing ? "Available apps" : "Your connections"} -

- - {matching.length} {matching.length === 1 ? "app" : "apps"} - -
- {matching.length > 0 ? ( - - ) : query ? ( - - Nothing matches “{search.trim()}”. - - ) : ( - - } - variant="outline" - > - Browse apps - - ) : !canBrowse && personal ? ( - - ) : undefined - } - > - {browsing - ? "Apps you can connect will appear here." - : canBrowse - ? "Browse apps to connect your first account." - : personal - ? "Open Setup to configure apps for this OpenBot." - : "Apps show up here once an admin turns them on."} - - )} - + + } + variant="outline" + > + Browse apps + + ) : !canBrowse && personal ? ( + + ) : undefined + } + > + {browsing + ? "Apps you can connect will appear here." + : canBrowse + ? "Browse apps to connect your first account." + : personal + ? "Open Setup to configure apps for this OpenBot." + : "Apps show up here once an admin turns them on."} + )} {/* * OpenBot holding off (a move, a brief outage) is said once: when the list above already @@ -746,7 +737,7 @@ function ConnectionGrid({ */ const appPage = useOpenAppPage(); return ( -
+
{rows.map((row) => { // An app of the person's own to reconnect; a linked account (GitHub, Slack) opens its page. const reconnects = @@ -778,7 +769,7 @@ function ConnectionGrid({ } /** - * The page's shape before the apps and your accounts have both answered: the search box and a grid + * The page's shape before the apps and your accounts have both answered: 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. */ @@ -786,8 +777,7 @@ function ConnectionsLoading() { return (