Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/src/assets/brands/github.svg

This file was deleted.

12 changes: 4 additions & 8 deletions app/src/components/approvals/rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,11 @@ export function RuleRow({
{locked ? <ItemDescription>Locked</ItemDescription> : null}
</ItemContent>
<ItemActions>
{/* 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 ? (
<LabelSelect
disabled
label={`Behaviour for ${title}`}
labels={labels}
onChange={() => undefined}
value={rule.behaviour}
/>
<span className="text-muted-foreground text-sm">
{labels[rule.behaviour]}
</span>
) : (
<>
<LabelSelect
Expand Down
21 changes: 9 additions & 12 deletions app/src/components/bot-profile/routines-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -47,10 +47,15 @@ export function BotRoutinesSummary({ agentId }: { agentId: string }) {
return (
<PageSection
action={
<span className="text-muted-foreground text-sm tabular-nums">
{routineCount(listed.length)}
</span>
<Button
render={<Link params={{ agentId }} to="/bots/$agentId/routines" />}
size="sm"
variant="ghost"
>
All routines ({all.length})
</Button>
}
count={listed.length}
title="Routines"
>
{/* One read failing leaves the others listed, and says so. */}
Expand All @@ -76,14 +81,6 @@ export function BotRoutinesSummary({ agentId }: { agentId: string }) {
Every goal this Bot had is completed.
</p>
)}
<Button
className="mt-3"
render={<Link params={{ agentId }} to="/bots/$agentId/routines" />}
size="sm"
variant="ghost"
>
All routines ({all.length})
</Button>
</PageSection>
);
}
79 changes: 53 additions & 26 deletions app/src/components/connections/apps-toolbar.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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,
Expand All @@ -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 (
<nav aria-label="App pages" className="mt-6 flex gap-5 border-b">
<Link
to="/connections"
aria-current={!browsing ? "page" : undefined}
className={style(!browsing)}
>
Your apps
</Link>
<Link
to={browsePath(provider)}
data-testid="account-browse"
aria-current={browsing ? "page" : undefined}
className={style(!!browsing)}
>
Browse apps
</Link>
</nav>
<Tabs
render={<nav aria-label="App pages" />}
value={browsing ? "browse" : "yours"}
>
<TabsList variant="line">
<TabsTrigger
nativeButton={false}
render={
<Link
activeOptions={{ exact: true }}
aria-current={!browsing ? "page" : undefined}
to="/connections"
/>
}
value="yours"
>
Your apps
</TabsTrigger>
<TabsTrigger
data-testid="account-browse"
nativeButton={false}
render={
<Link
aria-current={browsing ? "page" : undefined}
to={browsePath(provider)}
/>
}
value="browse"
>
Browse apps
</TabsTrigger>
</TabsList>
</Tabs>
);
}

Expand Down Expand Up @@ -96,6 +112,8 @@ export function AppsToolbar({
mayAdd,
browse = null,
placeholder = "Search apps",
count,
ref,
children,
}: {
search: string;
Expand All @@ -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<HTMLDivElement>;
children?: ReactNode;
}) {
return (
<div className="sticky top-0 z-10 border-b bg-background py-2">
// Opaque in the panel's own color, so the rows scrolling under the stuck bar don't show through.
<div ref={ref} className="sticky top-0 z-10 border-b bg-background py-2">
<div className="flex items-center gap-2">
<InputGroup className="min-w-0 flex-1 bg-card">
<InputGroup className="min-w-0 flex-1">
<InputGroupAddon>
<IconSearch aria-hidden="true" />
</InputGroupAddon>
Expand All @@ -121,6 +143,11 @@ export function AppsToolbar({
onChange={(event) => onSearch(event.target.value)}
/>
</InputGroup>
{count ? (
<span className="shrink-0 text-muted-foreground text-xs tabular-nums">
{count}
</span>
) : null}
{mayAdd && <AddMenu browse={browse} />}
</div>
{children}
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/connections/identity-connection-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export function IdentityConnectionPage({
function IdentityMark({ provider }: { provider: LinkableProvider }) {
const Icon = providerIcon(provider);
return (
<ItemMedia className="size-10" variant="icon">
<ItemMedia variant="icon">
<PluginLogo
fallback={<Icon className="size-5" />}
fallback={<Icon />}
logo={identityVendorLogo(provider)}
name={linkableProviderTitle(provider)}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/layout/page-parts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
</span>
)}
</h2>
Expand Down
6 changes: 3 additions & 3 deletions app/src/components/manage/skill-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ export function SkillPage({
cancel: (
<Button
render={(props) => <Link {...props} {...here} replace />}
size="sm"
variant="ghost"
variant="outline"
>
Cancel
</Button>
Expand Down Expand Up @@ -220,7 +219,8 @@ export function SkillPage({
description={skillByline(skill, me?.id, paths.edition)}
title={skill.title}
>
<div className="flex flex-col gap-6">
{/* The one-liner and the overview: two blocks of one group, 12px apart (the Rhythm table). */}
<div className="flex flex-col gap-3">
{skill.summary ? <p className="text-sm">{skill.summary}</p> : null}
<SkillOverview skill={skill} />
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/memory/memories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 (
<span className="ml-1.5 inline-flex items-center rounded-md bg-warning/10 px-1.5 py-0.5 font-medium text-warning text-xs">
<Badge className="ml-1.5" variant="warning">
Needs review
</span>
</Badge>
);
}

Expand Down
42 changes: 17 additions & 25 deletions app/src/components/organizations/organization-settings-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,42 +234,34 @@ function PlanRow() {
</ItemDescription>
) : 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. */}
<ItemDescription className="mt-1.5 line-clamp-none">
{OTHERS_NEED_A_CARD}
</ItemDescription>
<a
className={cn(
buttonVariants({ size: "sm", variant: "outline" }),
"mt-2 self-start",
)}
href={plan.addCardUrl}
>
{cardAction(plan)}
</a>
</>
<ItemDescription className="mt-1.5 line-clamp-none">
{OTHERS_NEED_A_CARD}
</ItemDescription>
) : 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 ? (
</ItemContent>
{/*
* 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 ? (
<ItemActions className="basis-full justify-end">
<a
className={cn(
buttonVariants({ size: "sm", variant: "outline" }),
"mt-2 self-start",
)}
href={plan.addCardUrl}
>
{cardAction(plan)}
</a>
) : null}
</ItemContent>
</ItemActions>
) : null}
</Item>
</>
);
Expand Down
23 changes: 15 additions & 8 deletions app/src/components/plan/card-needed-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -229,7 +231,7 @@ function PausedBots({ bots }: { bots: readonly AgentProfile[] }) {
{shown.map((bot, index) => (
<span
className={cn(
"inline-flex rounded-full opacity-90 ring-2 ring-popover saturate-50",
"inline-flex rounded-full ring-2 ring-popover",
index > 0 && "-ml-2.5",
)}
key={bot.id}
Expand All @@ -243,10 +245,10 @@ function PausedBots({ bots }: { bots: readonly AgentProfile[] }) {
</span>
) : null}
</div>
<span className="inline-flex items-center gap-1.5 rounded-full bg-muted py-0.5 pr-2.5 pl-2 font-medium text-muted-foreground text-sm">
<IconPlayerPause aria-hidden="true" className="size-3" />
<Badge variant="muted">
<IconPlayerPause aria-hidden="true" data-icon="inline-start" />
Paused
</span>
</Badge>
</div>
);
}
Expand All @@ -265,7 +267,7 @@ function PlanCard() {
</ItemContent>
<ItemActions className="whitespace-nowrap text-muted-foreground">
<span>
<span className="font-medium text-base text-foreground tabular-nums">
<span className="font-medium text-foreground text-sm tabular-nums">
{PRICE_AMOUNT}
</span>{" "}
{PRICE_PER}
Expand Down Expand Up @@ -316,6 +318,11 @@ function AdminsToAsk({
{shown.map((admin, index) => (
<Fragment key={admin.id}>
{index > 0 ? <Separator /> : 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.
*/}
<Item className="px-0" role="listitem" size="xs">
<ItemMedia>
<PersonAvatar className="size-7" person={admin} />
Expand Down
Loading
Loading