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/approvals/rules.tsx b/app/src/components/approvals/rules.tsx index d6dc686d9c..7449ddfc62 100644 --- a/app/src/components/approvals/rules.tsx +++ b/app/src/components/approvals/rules.tsx @@ -198,15 +198,11 @@ export function RuleRow({ {locked ? Locked : null} - {/* Locked, the same select, shown and not changeable: one control on every row. */} + {/* Locked, the row only states its value: no control that can't be used. */} {locked ? ( - undefined} - value={rule.behaviour} - /> + + {labels[rule.behaviour]} + ) : ( <> - {routineCount(listed.length)} - + } + count={listed.length} title="Routines" > {/* One read failing leaves the others listed, and says so. */} @@ -76,14 +81,6 @@ export function BotRoutinesSummary({ agentId }: { agentId: string }) { Every goal this Bot had is completed.

)} - ); } diff --git a/app/src/components/connections/apps-toolbar.tsx b/app/src/components/connections/apps-toolbar.tsx index a415fbee44..fa2bf1c03f 100644 --- a/app/src/components/connections/apps-toolbar.tsx +++ b/app/src/components/connections/apps-toolbar.tsx @@ -1,5 +1,5 @@ import { Link } from "@tanstack/react-router"; -import type { ReactNode } from "react"; +import type { ReactNode, Ref } from "react"; import { IconChevronDown, IconPlus, IconSearch } from "@/components/icons"; import { Button } from "@/components/ui/button"; import { @@ -13,8 +13,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 AppsNavigation({ provider, @@ -23,29 +23,45 @@ export function AppsNavigation({ provider: PluginsProvider; 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", - ); + /* + * The two pages as `Tabs`' line tabs, each a link to its route: the active one follows the address, + * not a click, so `value` is read from the route and nothing sets it. Rendered as the `nav` that + * `PageShell` spaces tabs by (24px under the title, 32px above what follows). + */ return ( - + } + value={browsing ? "browse" : "yours"} + > + + + } + value="yours" + > + Your apps + + + } + value="browse" + > + Browse apps + + + ); } @@ -96,6 +112,8 @@ export function AppsToolbar({ mayAdd, browse = null, placeholder = "Search apps", + count, + ref, children, }: { search: string; @@ -104,12 +122,16 @@ export function AppsToolbar({ /** The directory "Add" offers to browse, where it isn't the page already open. */ browse?: PluginsProvider | null; placeholder?: string; + /** How many the list under the search holds ("12 apps"), on the search's own row. */ + count?: ReactNode; + ref?: Ref; children?: ReactNode; }) { return ( -
+ // Opaque in the panel's own color, so the rows scrolling under the stuck bar don't show through. +
- + @@ -121,6 +143,11 @@ export function AppsToolbar({ onChange={(event) => onSearch(event.target.value)} /> + {count ? ( + + {count} + + ) : null} {mayAdd && }
{children} diff --git a/app/src/components/connections/identity-connection-page.tsx b/app/src/components/connections/identity-connection-page.tsx index b863332502..26c7520858 100644 --- a/app/src/components/connections/identity-connection-page.tsx +++ b/app/src/components/connections/identity-connection-page.tsx @@ -111,9 +111,9 @@ export function IdentityConnectionPage({ function IdentityMark({ provider }: { provider: LinkableProvider }) { const Icon = providerIcon(provider); return ( - + } + fallback={} logo={identityVendorLogo(provider)} name={linkableProviderTitle(provider)} /> diff --git a/app/src/components/layout/page-parts.tsx b/app/src/components/layout/page-parts.tsx index 84f4ebff44..3e55f5875f 100644 --- a/app/src/components/layout/page-parts.tsx +++ b/app/src/components/layout/page-parts.tsx @@ -225,7 +225,7 @@ export function PageSection({ className="ml-2 font-normal text-muted-foreground tabular-nums" data-slot="page-section-count" > - {count} + {count.toLocaleString()} )} diff --git a/app/src/components/manage/skill-page.tsx b/app/src/components/manage/skill-page.tsx index 0b97c49cc9..fab80542ad 100644 --- a/app/src/components/manage/skill-page.tsx +++ b/app/src/components/manage/skill-page.tsx @@ -185,8 +185,7 @@ export function SkillPage({ cancel: ( @@ -220,7 +219,8 @@ export function SkillPage({ description={skillByline(skill, me?.id, paths.edition)} title={skill.title} > -
+ {/* 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}
- - +
); } @@ -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. + */} +
-
- {categories.map((name) => ( - - ))} -
- -
+ {categories.map((name) => ( + + ))} + + )} - {discover && ( -
-

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

- {!showFeatured && ( - - {total !== null && !pending - ? `${total.toLocaleString()} ${query ? (total === 1 ? "match" : "matches") : "apps"}` - : null} - - )} + action={ + discover ? ( -
- )} + ) : undefined + } + count={ + discover && !showFeatured && total !== null && !pending + ? total + : undefined + } + description={discover ? undefined : description.search} + id={discover ? RESULTS_ID : undefined} + title={ + discover + ? (category ?? + (query + ? "Search results" + : showFeatured + ? "Popular apps" + : "All apps")) + : "Apps" + } + > {press.error ? (

@@ -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", - }) - } - /> - -
- ) - } - 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/bot-group.tsx b/app/src/components/routines/bot-group.tsx index d75de32942..b373694ba4 100644 --- a/app/src/components/routines/bot-group.tsx +++ b/app/src/components/routines/bot-group.tsx @@ -33,15 +33,19 @@ function useGroupName(group: BotGroup): string { } /** - * One Bot's routines on the Routines page: the Bot's orb, name and how many it has, then its rows in - * one card. The name opens the Bot's own Routines page, except for a Bot no list knows, which has none. + * One Bot's routines on the Routines page: the Bot's orb, name and how many it has, then its rows. + * The name opens the Bot's own Routines page, except for a Bot no list knows, which has none. + * + * A section of the page, spaced as `PageSection` spaces one (48px above it) and its rows under the + * label as `PageRows` puts them. Not a `PageSection` itself: its title is text only, and this one + * leads with the Bot's orb and links its name. */ export function BotGroupSection({ group }: { group: BotGroup }) { const name = useGroupName(group); return ( - // Spaced with padding, not margin: the group's height opens and folds, and a margin outside it - // would jump. -
+ // The margin is inside the group's `Unfold`, which clips while it moves, so it opens and folds + // with the group. +
{group.known ? ( @@ -57,7 +61,7 @@ export function BotGroupSection({ group }: { group: BotGroup }) { )} {routineCount(group.rows.length)}
- + {/* A routine made or removed while the page is open opens or folds; the rest just appear. */} {group.rows.map((row, index) => ( 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/new-routine-page.tsx b/app/src/components/routines/new-routine-page.tsx index b406175cb6..a1f1feac0f 100644 --- a/app/src/components/routines/new-routine-page.tsx +++ b/app/src/components/routines/new-routine-page.tsx @@ -40,10 +40,12 @@ import { channelListQueryOptions, } from "@/lib/channels/queries"; import { deploymentCapabilitiesQueryOptions } from "@/lib/deployment/queries"; +import { failureSaid } from "@/lib/load-failure"; import { proactiveAllowedQueryOptions, proactiveSettingsQueryOptions, } from "@/lib/proactive"; +import { draftValues } from "@/lib/routines/draft"; import { browserTimeZone, DOES, @@ -54,7 +56,6 @@ import { type RoutineFormValues, STARTS, } from "@/lib/routines/form"; -import { draftValues } from "@/lib/routines/draft"; import { CHECK_IN_INTERVALS } from "@/lib/routines/merged"; import { createFromPlanMutationOptions, @@ -68,8 +69,6 @@ import { } from "@/lib/routines/rules"; import { openingOf } from "@/lib/voice/cut"; import { queryClient } from "@/query-client"; -import { failureSaid } from "@/lib/load-failure"; -import { cn } from "@/lib/utils"; /** The conversations a routine for this Bot may post in: live ones the Bot is in. */ function conversationsWith( @@ -297,11 +296,7 @@ export function NewRoutinePage({ onValueChange={(value) => field.handleChange(value as Starts)} value={field.state.value} > - + @@ -389,9 +384,9 @@ export function NewRoutinePage({ }} > {/* - * One card, labels straight above their fields, so the whole form and its Create button fit - * a laptop window: who and how, what to do, when, as one line of compact controls. What most - * routines leave alone (when it's done, where it posts, its name) is behind Advanced settings. + * One card, its fields in a single column with labels straight above them: the Bot, what it + * should do, what to do, when it starts and what that start needs. What most routines leave + * alone (when it's done, where it posts, its name) is behind Advanced settings. */} @@ -400,13 +395,9 @@ export function NewRoutinePage({ // Not drawn without check-ins: a picker with only Act for you asks nothing. Still // drawn for an Only tell you picked before an admin turned them off, to say so. const asksDoes = allowed || does === "tell"; + // Stacked, one field under another, as every form's fields are. return ( -
+ <> {(field) => { const isInvalid = field.name in shown; @@ -536,7 +527,7 @@ export function NewRoutinePage({ }} ) : null} -
+ ); }} @@ -573,8 +564,9 @@ export function NewRoutinePage({ }} - {/* When, as one line: Starts, then what that start needs. Only tell you has no start of - its own, only how often it looks. */} + {/* Starts, then under it what that start needs: the schedule, as one line of controls + because it is one answer, or the event. Only tell you has no start of its own, only + how often it looks. */} [ state.values.does, @@ -618,21 +610,24 @@ export function NewRoutinePage({ )} - ) : starts === "schedule" ? ( - // The time is the browser's own, so its zone goes unsaid: it is the reader's. - ) : ( - - When -
+ <> + + Starts {startsSelect} - {starts === "event" ? ( - <> + + {starts === "schedule" ? ( + // The time is the browser's own, so its zone goes unsaid: it is the reader's. + + ) : starts === "event" ? ( + // Where it comes from and what it is, on one line: together they name one event. + + Event +
{(field) => ( - field.handleChange(String(value)) - } - value={ - field.state.value in items - ? field.state.value - : NEW_CONVERSATION - } + state.values.agentId}> + {(agentId) => { + const shared = conversationsWith(channels.data, agentId); + // The conversation the clock was pressed in, second and called what it is + // to the person who just left it, even when it is past the roster's first + // page. The server still checks the Bot is in it. + const here = + presetChannelId && agentId === presetAgentId + ? { [presetChannelId]: "This conversation" } + : {}; + const items: Record = { + [NEW_CONVERSATION]: "A new conversation", + ...here, + ...Object.fromEntries( + shared.map((channel) => [ + channel.id, + conversationName(channel), + ]), + ), + ...here, + }; + const choices = Object.entries(items); + return ( + + {(field) => ( + + + Posts in + + - - )} - - ); - }} - + + + + + {choices.map(([value, label]) => ( + + {label} + + ))} + + + + + )} + + ); + }} + - - {(field) => { - const isInvalid = field.name in shown; - return ( - - Name - - field.handleChange(event.target.value) - } - placeholder="Morning leads" - value={field.state.value} - /> - {isInvalid ? ( - - {shown[field.name]} - - ) : null} - - ); - }} - -
+ + {(field) => { + const isInvalid = field.name in shown; + return ( + + Name + + field.handleChange(event.target.value) + } + placeholder="Morning leads" + value={field.state.value} + /> + {isInvalid ? ( + + {shown[field.name]} + + ) : 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..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) => ( setRepository(event.target.value)} - placeholder="owner/repository" - required - value={repository} - /> - - - - Webhook secret - - setSecret(event.target.value)} - required - type="password" - value={secret} - /> - - - - {create.error ? ( -

- {failureSaid(create.error)} -

- ) : null} - - - - - - -
+ +
{ + event.preventDefault(); + create.mutate( + { repository, secret }, + { onSuccess: () => navigate(GITHUB_PAGE) }, + ); + }} + > + + + + + } + > + + + + Repository + + setRepository(event.target.value)} + placeholder="owner/repository" + required + value={repository} + /> + + + + Webhook secret + + setSecret(event.target.value)} + required + type="password" + value={secret} + /> + + {create.error ? ( + {failureSaid(create.error)} + ) : null} + + +
+
); } diff --git a/app/src/components/skills/skills-settings-page.tsx b/app/src/components/skills/skills-settings-page.tsx index e7c9bdbf4f..014c68bd6d 100644 --- a/app/src/components/skills/skills-settings-page.tsx +++ b/app/src/components/skills/skills-settings-page.tsx @@ -102,9 +102,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 +162,6 @@ export function SkillsSettingsPage({ creating }: { creating: boolean }) { - ); 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/lib/artifacts/tokens.css b/app/src/lib/artifacts/tokens.css index 1c1d3ce30e..d3ad547e9f 100644 --- a/app/src/lib/artifacts/tokens.css +++ b/app/src/lib/artifacts/tokens.css @@ -20,7 +20,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); @@ -59,7 +59,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/src/routeTree.gen.ts b/app/src/routeTree.gen.ts index 050590097b..93dfe06a4d 100644 --- a/app/src/routeTree.gen.ts +++ b/app/src/routeTree.gen.ts @@ -103,6 +103,7 @@ import { Route as AuthedAdminBoundariesNewRouteImport } from './routes/_authed/a import { Route as AuthedAdminComponentsIndexRouteImport } from './routes/_authed/admin/components/index' import { Route as AuthedAdminComponentsNameRouteImport } from './routes/_authed/admin/components/$name' import { Route as AuthedAdminCredentialsNewRouteImport } from './routes/_authed/admin/credentials_.new' +import { Route as AuthedAdminIdentityProvidersNewRouteImport } from './routes/_authed/admin/identity-providers_.new' import { Route as AuthedAdminPermissionsDescribeRouteImport } from './routes/_authed/admin/permissions_.describe' import { Route as AuthedAdminPluginsIndexRouteImport } from './routes/_authed/admin/plugins/index' import { Route as AuthedAdminPluginsKeyRouteImport } from './routes/_authed/admin/plugins/$key' @@ -153,7 +154,9 @@ import { Route as AuthedSettingsProvidersProviderChangeRouteImport } from './rou import { Route as AuthedAppBotsAgentIdSetupFieldRouteImport } from './routes/_authed/_app/bots.$agentId.setup_.$field' 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 AuthedAppConnectionsKeyRepositoriesNewRouteImport } from './routes/_authed/_app/connections.$key_.repositories.new' 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' @@ -646,6 +649,12 @@ const AuthedAdminCredentialsNewRoute = path: '/credentials/new', getParentRoute: () => AuthedAdminRouteRoute, } as any) +const AuthedAdminIdentityProvidersNewRoute = + AuthedAdminIdentityProvidersNewRouteImport.update({ + id: '/identity-providers_/new', + path: '/identity-providers/new', + getParentRoute: () => AuthedAdminRouteRoute, + } as any) const AuthedAdminPermissionsDescribeRoute = AuthedAdminPermissionsDescribeRouteImport.update({ id: '/permissions_/describe', @@ -937,12 +946,24 @@ const AuthedAppConnectionsKeyBotsAgentIdRoute = path: '/connections/$key/bots/$agentId', getParentRoute: () => AuthedAppRoute, } as any) +const AuthedAppConnectionsKeyRepositoriesNewRoute = + AuthedAppConnectionsKeyRepositoriesNewRouteImport.update({ + id: '/connections/$key_/repositories/new', + path: '/connections/$key/repositories/new', + getParentRoute: () => AuthedAppRoute, + } as any) const AuthedAppConnectionsKeyToolsToolRoute = AuthedAppConnectionsKeyToolsToolRouteImport.update({ id: '/connections/$key_/tools/$tool', 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', @@ -1042,6 +1063,7 @@ export interface FileRoutesByFullPath { '/admin/boundaries/new': typeof AuthedAdminBoundariesNewRoute '/admin/components/$name': typeof AuthedAdminComponentsNameRoute '/admin/credentials/new': typeof AuthedAdminCredentialsNewRoute + '/admin/identity-providers/new': typeof AuthedAdminIdentityProvidersNewRoute '/admin/permissions/describe': typeof AuthedAdminPermissionsDescribeRoute '/admin/plugins/$key': typeof AuthedAdminPluginsKeyRoute '/admin/plugins/arcade': typeof AuthedAdminPluginsArcadeRoute @@ -1098,7 +1120,9 @@ export interface FileRoutesByFullPath { '/bots/$agentId/setup/$field': typeof AuthedAppBotsAgentIdSetupFieldRoute '/bots/$agentId/setup/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/connections/$key/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute + '/connections/$key/repositories/new': typeof AuthedAppConnectionsKeyRepositoriesNewRoute '/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 } @@ -1186,6 +1210,7 @@ export interface FileRoutesByTo { '/admin/boundaries/new': typeof AuthedAdminBoundariesNewRoute '/admin/components/$name': typeof AuthedAdminComponentsNameRoute '/admin/credentials/new': typeof AuthedAdminCredentialsNewRoute + '/admin/identity-providers/new': typeof AuthedAdminIdentityProvidersNewRoute '/admin/permissions/describe': typeof AuthedAdminPermissionsDescribeRoute '/admin/plugins/$key': typeof AuthedAdminPluginsKeyRoute '/admin/plugins/arcade': typeof AuthedAdminPluginsArcadeRoute @@ -1242,7 +1267,9 @@ export interface FileRoutesByTo { '/bots/$agentId/setup/$field': typeof AuthedAppBotsAgentIdSetupFieldRoute '/bots/$agentId/setup/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/connections/$key/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute + '/connections/$key/repositories/new': typeof AuthedAppConnectionsKeyRepositoriesNewRoute '/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 } @@ -1336,6 +1363,7 @@ export interface FileRoutesById { '/_authed/admin/boundaries_/new': typeof AuthedAdminBoundariesNewRoute '/_authed/admin/components/$name': typeof AuthedAdminComponentsNameRoute '/_authed/admin/credentials_/new': typeof AuthedAdminCredentialsNewRoute + '/_authed/admin/identity-providers_/new': typeof AuthedAdminIdentityProvidersNewRoute '/_authed/admin/permissions_/describe': typeof AuthedAdminPermissionsDescribeRoute '/_authed/admin/plugins/$key': typeof AuthedAdminPluginsKeyRoute '/_authed/admin/plugins/arcade': typeof AuthedAdminPluginsArcadeRoute @@ -1392,7 +1420,9 @@ export interface FileRoutesById { '/_authed/_app/bots/$agentId/setup_/$field': typeof AuthedAppBotsAgentIdSetupFieldRoute '/_authed/_app/bots/$agentId/setup_/key': typeof AuthedAppBotsAgentIdSetupKeyRoute '/_authed/_app/connections/$key_/bots/$agentId': typeof AuthedAppConnectionsKeyBotsAgentIdRoute + '/_authed/_app/connections/$key_/repositories/new': typeof AuthedAppConnectionsKeyRepositoriesNewRoute '/_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 } @@ -1484,6 +1514,7 @@ export interface FileRouteTypes { | '/admin/boundaries/new' | '/admin/components/$name' | '/admin/credentials/new' + | '/admin/identity-providers/new' | '/admin/permissions/describe' | '/admin/plugins/$key' | '/admin/plugins/arcade' @@ -1540,7 +1571,9 @@ export interface FileRouteTypes { | '/bots/$agentId/setup/$field' | '/bots/$agentId/setup/key' | '/connections/$key/bots/$agentId' + | '/connections/$key/repositories/new' | '/connections/$key/tools/$tool' + | '/routines/schedules/$routineId/edit' | '/admin/plugins/$key/bots/$agentId' | '/admin/plugins/$key/tools/$tool' fileRoutesByTo: FileRoutesByTo @@ -1628,6 +1661,7 @@ export interface FileRouteTypes { | '/admin/boundaries/new' | '/admin/components/$name' | '/admin/credentials/new' + | '/admin/identity-providers/new' | '/admin/permissions/describe' | '/admin/plugins/$key' | '/admin/plugins/arcade' @@ -1684,7 +1718,9 @@ export interface FileRouteTypes { | '/bots/$agentId/setup/$field' | '/bots/$agentId/setup/key' | '/connections/$key/bots/$agentId' + | '/connections/$key/repositories/new' | '/connections/$key/tools/$tool' + | '/routines/schedules/$routineId/edit' | '/admin/plugins/$key/bots/$agentId' | '/admin/plugins/$key/tools/$tool' id: @@ -1777,6 +1813,7 @@ export interface FileRouteTypes { | '/_authed/admin/boundaries_/new' | '/_authed/admin/components/$name' | '/_authed/admin/credentials_/new' + | '/_authed/admin/identity-providers_/new' | '/_authed/admin/permissions_/describe' | '/_authed/admin/plugins/$key' | '/_authed/admin/plugins/arcade' @@ -1833,7 +1870,9 @@ export interface FileRouteTypes { | '/_authed/_app/bots/$agentId/setup_/$field' | '/_authed/_app/bots/$agentId/setup_/key' | '/_authed/_app/connections/$key_/bots/$agentId' + | '/_authed/_app/connections/$key_/repositories/new' | '/_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 @@ -2508,6 +2547,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthedAdminCredentialsNewRouteImport parentRoute: typeof AuthedAdminRouteRoute } + '/_authed/admin/identity-providers_/new': { + id: '/_authed/admin/identity-providers_/new' + path: '/identity-providers/new' + fullPath: '/admin/identity-providers/new' + preLoaderRoute: typeof AuthedAdminIdentityProvidersNewRouteImport + parentRoute: typeof AuthedAdminRouteRoute + } '/_authed/admin/permissions_/describe': { id: '/_authed/admin/permissions_/describe' path: '/permissions/describe' @@ -2858,6 +2904,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthedAppConnectionsKeyBotsAgentIdRouteImport parentRoute: typeof AuthedAppRoute } + '/_authed/_app/connections/$key_/repositories/new': { + id: '/_authed/_app/connections/$key_/repositories/new' + path: '/connections/$key/repositories/new' + fullPath: '/connections/$key/repositories/new' + preLoaderRoute: typeof AuthedAppConnectionsKeyRepositoriesNewRouteImport + parentRoute: typeof AuthedAppRoute + } '/_authed/_app/connections/$key_/tools/$tool': { id: '/_authed/_app/connections/$key_/tools/$tool' path: '/connections/$key/tools/$tool' @@ -2865,6 +2918,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' @@ -2908,6 +2968,7 @@ interface AuthedAdminRouteRouteChildren { AuthedAdminBoundariesNewRoute: typeof AuthedAdminBoundariesNewRoute AuthedAdminComponentsNameRoute: typeof AuthedAdminComponentsNameRoute AuthedAdminCredentialsNewRoute: typeof AuthedAdminCredentialsNewRoute + AuthedAdminIdentityProvidersNewRoute: typeof AuthedAdminIdentityProvidersNewRoute AuthedAdminPermissionsDescribeRoute: typeof AuthedAdminPermissionsDescribeRoute AuthedAdminPluginsKeyRoute: typeof AuthedAdminPluginsKeyRoute AuthedAdminPluginsArcadeRoute: typeof AuthedAdminPluginsArcadeRoute @@ -2952,6 +3013,7 @@ const AuthedAdminRouteRouteChildren: AuthedAdminRouteRouteChildren = { AuthedAdminBoundariesNewRoute: AuthedAdminBoundariesNewRoute, AuthedAdminComponentsNameRoute: AuthedAdminComponentsNameRoute, AuthedAdminCredentialsNewRoute: AuthedAdminCredentialsNewRoute, + AuthedAdminIdentityProvidersNewRoute: AuthedAdminIdentityProvidersNewRoute, AuthedAdminPermissionsDescribeRoute: AuthedAdminPermissionsDescribeRoute, AuthedAdminPluginsKeyRoute: AuthedAdminPluginsKeyRoute, AuthedAdminPluginsArcadeRoute: AuthedAdminPluginsArcadeRoute, @@ -3128,7 +3190,9 @@ interface AuthedAppRouteChildren { AuthedAppBotsAgentIdSetupFieldRoute: typeof AuthedAppBotsAgentIdSetupFieldRoute AuthedAppBotsAgentIdSetupKeyRoute: typeof AuthedAppBotsAgentIdSetupKeyRoute AuthedAppConnectionsKeyBotsAgentIdRoute: typeof AuthedAppConnectionsKeyBotsAgentIdRoute + AuthedAppConnectionsKeyRepositoriesNewRoute: typeof AuthedAppConnectionsKeyRepositoriesNewRoute AuthedAppConnectionsKeyToolsToolRoute: typeof AuthedAppConnectionsKeyToolsToolRoute + AuthedAppRoutinesSchedulesRoutineIdEditRoute: typeof AuthedAppRoutinesSchedulesRoutineIdEditRoute } const AuthedAppRouteChildren: AuthedAppRouteChildren = { @@ -3196,7 +3260,11 @@ const AuthedAppRouteChildren: AuthedAppRouteChildren = { AuthedAppBotsAgentIdSetupKeyRoute: AuthedAppBotsAgentIdSetupKeyRoute, AuthedAppConnectionsKeyBotsAgentIdRoute: AuthedAppConnectionsKeyBotsAgentIdRoute, + AuthedAppConnectionsKeyRepositoriesNewRoute: + AuthedAppConnectionsKeyRepositoriesNewRoute, AuthedAppConnectionsKeyToolsToolRoute: AuthedAppConnectionsKeyToolsToolRoute, + AuthedAppRoutinesSchedulesRoutineIdEditRoute: + AuthedAppRoutinesSchedulesRoutineIdEditRoute, } const AuthedAppRouteWithChildren = AuthedAppRoute._addFileChildren( diff --git a/app/src/routes/_authed/_app/connections.$key_.repositories.new.tsx b/app/src/routes/_authed/_app/connections.$key_.repositories.new.tsx new file mode 100644 index 0000000000..9d49d068e6 --- /dev/null +++ b/app/src/routes/_authed/_app/connections.$key_.repositories.new.tsx @@ -0,0 +1,18 @@ +import { createFileRoute, redirect } from "@tanstack/react-router"; +import { AddGithubRepositoryPage } from "@/components/settings/github-sources"; + +/** + * GitHub's page, Add a repository: a repository whose events can start work, on a screen of its + * own beside GitHub's page. Only GitHub has repositories, so any other app's address opens that + * app's own page. + */ +export const Route = createFileRoute( + "/_authed/_app/connections/$key_/repositories/new", +)({ + beforeLoad: ({ params }) => { + if (params.key !== "github") { + throw redirect({ to: "/connections/$key", params: { key: params.key } }); + } + }, + component: AddGithubRepositoryPage, +}); diff --git a/app/src/routes/_authed/_app/connections.index.tsx b/app/src/routes/_authed/_app/connections.index.tsx index e30f9c9194..db294ba7af 100644 --- a/app/src/routes/_authed/_app/connections.index.tsx +++ b/app/src/routes/_authed/_app/connections.index.tsx @@ -619,7 +619,11 @@ function RouteComponent() { return ( } 0 + ? `${matching.length} ${matching.length === 1 ? "app" : "apps"}` + : undefined + } search={search} onSearch={setSearch} mayAdd={mayAddServer} @@ -688,7 +701,11 @@ function RouteComponent() { /> {/* What a move to OpenBot Cloud left to connect again, and the way to the list of it. */} - + {/* + * The page's one list in the team edition, so no title: "Apps" above already names it, and + * its count sits on the search's row. + */} + {/* * 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 @@ -768,19 +785,11 @@ function RouteComponent() { Nothing matches “{search.trim()}”. ) : personal || matching.length === 0 ? null : ( - <> -
-

Your connections

- - {matching.length} {matching.length === 1 ? "app" : "apps"} - -
- - + )} {searchesDirectory && directory.error ? (

@@ -886,7 +895,11 @@ function ConnectionGrid({ */ const appPage = useOpenAppPage(); return ( -

+ /* + * 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 (