Skip to content

Commit 07212da

Browse files
kathiekiwiTrigger.dev RepoOps
authored andcommitted
feat(webapp): simplify the Access page tool confirmations and align settings page widths
Mono-RevId: 2bbc29b2e251fd4b2ac59f6e3e169d0f2c365551
1 parent dc74906 commit 07212da

14 files changed

Lines changed: 447 additions & 254 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
The Access page's tool confirmations are now a filterable list of switches.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
The Personal Access Tokens page now has a Connection type column, and a warning icon next to a token's name explains where its MCP connection is blocked.

‎apps/webapp/app/components/primitives/Switch.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ const variations = {
7777
thumb: MEDIUM_THUMB,
7878
text: "text-sm text-text-dimmed",
7979
},
80+
"minimal/warning": {
81+
container: "flex items-center gap-x-2 rounded-md focus-custom",
82+
root: cn("h-4 w-7.5", "group-data-[state=checked]:bg-warning"),
83+
thumb: MEDIUM_THUMB,
84+
text: "text-sm text-text-dimmed",
85+
},
8086
};
8187

8288
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.settings._index/route.tsx‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
1414
import { z } from "zod";
1515
import { GlobeLinesIcon } from "~/assets/icons/GlobeLinesIcon";
1616
import { InlineCode } from "~/components/code/InlineCode";
17-
import {
18-
MainHorizontallyCenteredContainer,
19-
PageBody,
20-
PageContainer,
21-
} from "~/components/layout/AppLayout";
17+
import { PageBody, PageContainer } from "~/components/layout/AppLayout";
2218
import {
2319
Avatar,
2420
AvatarData,
@@ -40,6 +36,7 @@ import { Input } from "~/components/primitives/Input";
4036
import { InputGroup } from "~/components/primitives/InputGroup";
4137
import { Label } from "~/components/primitives/Label";
4238
import { NavBar, PageTitle } from "~/components/primitives/PageHeader";
39+
import { SettingsContainer } from "~/components/primitives/SettingsLayout";
4340
import { Popover, PopoverContent, PopoverTrigger } from "~/components/primitives/Popover";
4441
import { SpinnerWhite } from "~/components/primitives/Spinner";
4542
import { prisma } from "~/db.server";
@@ -389,7 +386,7 @@ export default function Page() {
389386
</NavBar>
390387

391388
<PageBody>
392-
<MainHorizontallyCenteredContainer>
389+
<SettingsContainer>
393390
<div className="mb-3 border-b border-grid-dimmed pb-3">
394391
<Header2>Settings</Header2>
395392
</div>
@@ -484,7 +481,7 @@ export default function Page() {
484481
</Form>
485482
</div>
486483
</div>
487-
</MainHorizontallyCenteredContainer>
484+
</SettingsContainer>
488485
</PageBody>
489486
</PageContainer>
490487
);

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.access/McpAccessSection.tsx‎

Lines changed: 84 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { useFetcher, useLocation } from "@remix-run/react";
22
import type { ReactNode } from "react";
3-
import { InlineCode } from "~/components/code/InlineCode";
4-
import { McpClientName } from "~/components/mcp/McpClientName";
53
import { Button, LinkButton } from "~/components/primitives/Buttons";
64
import { DateTime } from "~/components/primitives/DateTime";
75
import { Paragraph } from "~/components/primitives/Paragraph";
86
import { InformationCircleIcon } from "@heroicons/react/20/solid";
9-
import { Header3 } from "~/components/primitives/Headers";
107
import { SimpleTooltip } from "~/components/primitives/Tooltip";
11-
import { SettingsRow, SettingsRowDescription } from "~/components/primitives/SettingsLayout";
8+
import {
9+
SETTINGS_SECTION_GAP,
10+
SettingsHeader,
11+
SettingsRow,
12+
} from "~/components/primitives/SettingsLayout";
1213
import { Switch } from "~/components/primitives/Switch";
1314
import {
1415
Table,
@@ -20,6 +21,7 @@ import {
2021
TableRow,
2122
} from "~/components/primitives/Table";
2223
import type { McpConnectionListItem } from "~/mcp/policy/mcpAccess.server";
24+
import { mcpClientName } from "~/utils/mcpClient";
2325

2426
type Connection = Omit<McpConnectionListItem, "block"> & {
2527
block: { id: string; scope: "CONNECTION" | "ORGANIZATION_CLIENT" } | null;
@@ -49,15 +51,14 @@ export function McpAccessSection({
4951
<div>
5052
<Subsection
5153
title="Member connections"
52-
description="MCP clients that members of this organization have connected. Blocking a connection is not a hard stop: a client that registers again gets a new identity."
54+
description="AI tools your members have connected. Blocking a tool stops its calls in this organization until you unblock it. Connecting the same tool again does not lift the block."
5355
action={<ForwardPagination nextCursor={nextCursor} cursorParam={cursorParam} />}
5456
/>
55-
<Table>
57+
<Table showTopBorder={false}>
5658
<TableHeader>
5759
<TableRow>
5860
<TableHeaderCell>Member</TableHeaderCell>
5961
<TableHeaderCell>Client</TableHeaderCell>
60-
<TableHeaderCell>First connected</TableHeaderCell>
6162
<TableHeaderCell>State</TableHeaderCell>
6263
<TableHeaderCell hiddenLabel>Actions</TableHeaderCell>
6364
</TableRow>
@@ -72,7 +73,7 @@ export function McpAccessSection({
7273
/>
7374
))
7475
) : (
75-
<TableBlankRow colSpan={5}>
76+
<TableBlankRow colSpan={4}>
7677
<Paragraph variant="small" className="py-4 text-center">
7778
No members have connected an MCP client.
7879
</Paragraph>
@@ -85,6 +86,22 @@ export function McpAccessSection({
8586
);
8687
}
8788

89+
function InfoTip({ label, content }: { label: string; content: ReactNode }) {
90+
return (
91+
<SimpleTooltip
92+
tabbable
93+
asChild
94+
button={
95+
<button type="button" aria-label={label} className="h-fit">
96+
<InformationCircleIcon className="size-3.5 text-text-dimmed" />
97+
</button>
98+
}
99+
content={content}
100+
className="max-w-lg"
101+
/>
102+
);
103+
}
104+
88105
/** A heading inside a page section: one step below the section heading, above the rows. */
89106
export function Subsection({
90107
title,
@@ -99,27 +116,17 @@ export function Subsection({
99116
action?: ReactNode;
100117
}) {
101118
return (
102-
<div className="flex w-full items-end justify-between gap-8 pb-2 pt-8">
103-
<div className="space-y-0.5">
104-
<div className="flex items-center gap-1.5">
105-
<Header3>{title}</Header3>
106-
{info && (
107-
<SimpleTooltip
108-
tabbable
109-
asChild
110-
button={
111-
<button type="button" aria-label={info} className="h-fit">
112-
<InformationCircleIcon className="size-3.5 text-text-dimmed" />
113-
</button>
114-
}
115-
content={info}
116-
/>
117-
)}
118-
</div>
119-
{description ? <SettingsRowDescription>{description}</SettingsRowDescription> : null}
120-
</div>
121-
{action ? <div className="flex flex-none items-center">{action}</div> : null}
122-
</div>
119+
<SettingsHeader
120+
className={SETTINGS_SECTION_GAP}
121+
title={
122+
<span className="flex items-center gap-1.5">
123+
{title}
124+
{info && <InfoTip label={info} content={info} />}
125+
</span>
126+
}
127+
description={description}
128+
action={action}
129+
/>
123130
);
124131
}
125132

@@ -137,17 +144,23 @@ function AllowMcpRow({
137144
const fetcher = useFetcher();
138145
return (
139146
<SettingsRow
140-
title={ALLOW_MCP_TITLE}
141-
description={
147+
size="sm"
148+
className="min-h-16"
149+
title={
142150
<>
143-
When off, every call to the remote MCP server in this organization is refused. The local{" "}
144-
<InlineCode variant="extra-small">trigger mcp</InlineCode> server uses the API with a
145-
personal access token and is not affected.
151+
{ALLOW_MCP_TITLE}
152+
<InfoTip
153+
label={ALLOW_MCP_TITLE}
154+
content={
155+
"When off, every call to the remote MCP server in this organization is refused. The local trigger MCP server uses the API with a personal access token and is not affected."
156+
}
157+
/>
146158
</>
147159
}
148160
action={
149161
<Switch
150-
variant="medium"
162+
variant="minimal/medium"
163+
className="cursor-pointer disabled:cursor-not-allowed"
151164
aria-label={ALLOW_MCP_TITLE}
152165
checked={enabled}
153166
disabled={readOnly || fetcher.state !== "idle"}
@@ -163,6 +176,28 @@ function AllowMcpRow({
163176
);
164177
}
165178

179+
function ClientLabel({
180+
client,
181+
}: {
182+
client: { displayName: string | null; selfReportedName: string | null };
183+
}) {
184+
const { name, selfReported } = mcpClientName(client);
185+
return (
186+
<span className="inline-flex min-w-0 items-center gap-1.5">
187+
{name ? (
188+
<span className="max-w-[16rem] truncate text-text-bright" title={name}>
189+
{name}
190+
</span>
191+
) : (
192+
<span>Unnamed client</span>
193+
)}
194+
{selfReported ? (
195+
<InfoTip label="Name provided by the client" content="Name provided by the client" />
196+
) : null}
197+
</span>
198+
);
199+
}
200+
166201
function ConnectionRow({ connection, readOnly }: { connection: Connection; readOnly: boolean }) {
167202
const { block } = connection;
168203
return (
@@ -180,15 +215,19 @@ function ConnectionRow({ connection, readOnly }: { connection: Connection; readO
180215
)}
181216
</TableCell>
182217
<TableCell>
183-
<McpClientName
184-
client={{
185-
displayName: connection.clientDisplayName,
186-
selfReportedName: connection.clientSelfReportedName,
187-
}}
188-
/>
189-
</TableCell>
190-
<TableCell>
191-
{connection.firstConnectedAt ? <DateTime date={connection.firstConnectedAt} /> : "–"}
218+
<span className="flex flex-col">
219+
<ClientLabel
220+
client={{
221+
displayName: connection.clientDisplayName,
222+
selfReportedName: connection.clientSelfReportedName,
223+
}}
224+
/>
225+
{connection.firstConnectedAt ? (
226+
<span className="text-xs text-text-dimmed">
227+
First connected <DateTime date={connection.firstConnectedAt} includeTime={false} />
228+
</span>
229+
) : null}
230+
</span>
192231
</TableCell>
193232
<TableCell>
194233
{block === null
@@ -197,7 +236,7 @@ function ConnectionRow({ connection, readOnly }: { connection: Connection; readO
197236
? "Blocked for everyone"
198237
: "Blocked"}
199238
</TableCell>
200-
<TableCell alignment="right">
239+
<TableCell alignment="right" className="whitespace-nowrap">
201240
{block === null ? (
202241
<IntentButton
203242
label="Block"

0 commit comments

Comments
 (0)