Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: optimize mcp ui (#21497)

ecmadaob19a2930c69d
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 28cb59603a..f27a657254 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2766,7 +2766,7 @@
"title": "Disabled"
},
"read-only": {
- "best-for": "Best for: querying and exploring data, including by people who do not write SQL.",
+ "best-for": "Best for: querying and exploring data, using natural language.",
"caption": "Explore and query",
"title": "Read-only"
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index ec1c4f6bf5..fede7462a0 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2766,7 +2766,7 @@
"title": "Desactivado"
},
"read-only": {
- "best-for": "Ideal para: consultar y explorar datos, incluso por personas que no escriben SQL.",
+ "best-for": "Ideal para: consultar y explorar datos mediante lenguaje natural.",
"caption": "Explorar y consultar",
"title": "Solo lectura"
},
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 7f2bf9ed27..a4b7fccfd0 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -2766,7 +2766,7 @@
"title": "無効"
},
"read-only": {
- "best-for": "適する場面:SQL を書かない人も含めた、データの照会と探索。",
+ "best-for": "適する場面:自然言語を使ったデータの照会と探索。",
"caption": "探索と照会",
"title": "読み取り専用"
},
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 0ae53c69ee..1b0a601375 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -2766,7 +2766,7 @@
"title": "Tắt"
},
"read-only": {
- "best-for": "Phù hợp khi: truy vấn và khám phá dữ liệu, kể cả với người không viết SQL.",
+ "best-for": "Phù hợp khi: truy vấn và khám phá dữ liệu bằng ngôn ngữ tự nhiên.",
"caption": "Khám phá và truy vấn",
"title": "Chỉ đọc"
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 3d2750efd0..e49517d7cf 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2766,7 +2766,7 @@
"title": "禁用"
},
"read-only": {
- "best-for": "适用于:查询和探索数据,包括不写 SQL 的人。",
+ "best-for": "适用于:使用自然语言查询和探索数据。",
"caption": "探索与查询",
"title": "只读"
},
diff --git a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx
index 90dbe956d4..52164d7f5a 100644
--- a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx
+++ b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx
@@ -339,6 +339,24 @@ describe("MCPAccessPolicySection", () => {
unmount();
});
+ test("keeps the masking switch aligned with its title", async () => {
+ const { container, render, unmount } = renderIntoContainer(
+ <MCPAccessPolicySection />
+ );
+ render();
+ await flush();
+ clickText(container, "settings.mcp.policy.edit");
+ await flush();
+
+ const title = [...container.querySelectorAll("div")].find(
+ (node) =>
+ node.classList.contains("textinfo") &&
+ node.textContent === "settings.mcp.policy.masking.title"
+ );
+ expect(maskingSwitch(container)?.parentElement).toBe(title?.parentElement);
+ unmount();
+ });
+
test("the policy inputs are locked while a save is in flight", async () => {
const inFlight = Promise.withResolvers<undefined>();
mocks.upsertSetting.mockReturnValue(inFlight.promise);
diff --git a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx
index 4894d3ca4d..9a8fb83b22 100644
--- a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx
+++ b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx
@@ -349,17 +349,21 @@ export function MCPAccessPolicySection() {
)}
{maskingApplies && (
- <div className="flex items-start gap-x-3">
- <Switch
- checked={ignoreMasking}
- onCheckedChange={setIgnoreMasking}
- disabled={saving}
- aria-label={t("settings.mcp.policy.masking.title")}
- className="mt-0.5 shrink-0"
- />
+ <>
+ <Separator />
+
<div className="flex flex-col gap-1">
- <div className="textinfo font-semibold">
- {t("settings.mcp.policy.masking.title")}
+ <div className="flex items-center gap-x-2">
+ <Switch
+ checked={ignoreMasking}
+ onCheckedChange={setIgnoreMasking}
+ disabled={saving}
+ aria-label={t("settings.mcp.policy.masking.title")}
+ className="shrink-0"
+ />
+ <div className="textinfo font-semibold">
+ {t("settings.mcp.policy.masking.title")}
+ </div>
</div>
<div className="textinfolabel">
{t("settings.mcp.policy.masking.description")}
@@ -370,7 +374,7 @@ export function MCPAccessPolicySection() {
</div>
)}
</div>
- </div>
+ </>
)}
<Separator />
diff --git a/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.test.tsx b/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.test.tsx
index 32d24df8ec..7f493ea1fa 100644
--- a/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.test.tsx
+++ b/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.test.tsx
@@ -146,6 +146,22 @@ describe("MCPCapabilityLadder", () => {
unmount();
});
+ test("keeps the details action beside the open list heading", () => {
+ const { container, unmount } = renderIntoContainer(ladder({}));
+ const trigger = container.querySelector(
+ '[data-testid="mcp-ladder-trigger"]'
+ );
+ const detailsAction = [...container.querySelectorAll("button")].find(
+ (button) =>
+ button.textContent?.includes("settings.mcp.ladder.show-details")
+ );
+
+ expect(trigger?.parentElement).toHaveClass("gap-x-2");
+ expect(trigger?.parentElement).not.toHaveClass("border-b");
+ expect(trigger?.nextElementSibling).toBe(detailsAction);
+ unmount();
+ });
+
// One second-level control rather than eight: the toggle reveals the
// sub-item line on every row at once.
test("the details toggle reveals sub-items on every row at once", () => {
@@ -167,6 +183,16 @@ describe("MCPCapabilityLadder", () => {
unmount();
});
+ test("details remain visually subordinate to their scope title", () => {
+ const { container, unmount } = renderIntoContainer(ladder({ details: true }));
+ const detail = [...container.querySelectorAll("p")].find((node) =>
+ node.textContent?.includes("settings.mcp.ladder.row.read-schemas.details")
+ );
+
+ expect(detail).toHaveClass("text-xs", "leading-5", "text-control-light");
+ unmount();
+ });
+
test("toggling asks the owner rather than keeping its own state", () => {
const expanded: boolean[] = [];
const details: boolean[] = [];
@@ -225,6 +251,22 @@ describe("MCPCapabilityLadder", () => {
unmount();
});
+ test("uses spacing rather than row borders to separate capabilities", () => {
+ const { container, unmount } = renderIntoContainer(ladder({}));
+ const list = container.querySelector("ul");
+ const divider = [...container.querySelectorAll("li")].find((node) =>
+ node.textContent?.includes("settings.mcp.ladder.stops.read")
+ );
+
+ expect(list).toHaveClass("gap-y-2");
+ for (const row of rowItems(container)) {
+ expect(row).not.toHaveClass("border-b");
+ }
+ expect(divider).toHaveClass("py-2", "text-sm");
+ expect(divider?.querySelector("span")).toHaveClass("font-medium");
+ unmount();
+ });
+
test("every row states whether it is allowed, not only shows it", () => {
const { container, unmount } = renderIntoContainer(
ladder({ mode: MCPSetting_Capability.READ_ONLY })
diff --git a/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.tsx b/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.tsx
index 4c2bdd1816..39cffec5c9 100644
--- a/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.tsx
+++ b/frontend/src/routes/workspace/mcp/MCPCapabilityLadder.tsx
@@ -61,9 +61,12 @@ export function MCPCapabilityLadder({
return (
<Collapsible open={expanded} onOpenChange={onExpandedChange}>
- <div className="flex items-center justify-between gap-x-2 border-b border-block-border py-2">
+ <div className="flex items-center gap-x-2 py-2">
<CollapsibleTrigger
- className="min-w-0 flex-1 rounded-xs"
+ className={cn(
+ "min-w-0 rounded-xs",
+ expanded ? "w-auto shrink-0" : "flex-1"
+ )}
data-testid="mcp-ladder-trigger"
>
<ChevronRight
@@ -110,7 +113,7 @@ export function MCPCapabilityLadder({
{/* Tailwind's preflight removes the marker from every `ul`, and Safari
drops list semantics from an unstyled list — so the position
announcement this list depends on needs the role stated. */}
- <ul role="list" className="flex flex-col">
+ <ul role="list" className="flex flex-col gap-y-2">
{MCP_CAPABILITY_TIERS.map((tier) => (
<Fragment key={tier}>
{rowsInTier(tier).map((row) => (
@@ -127,7 +130,7 @@ export function MCPCapabilityLadder({
</ul>
{/* The floor is one line rather than a row: it is what no mode serves,
so it has no mark and belongs to no tier. */}
- <p className="bg-error/5 px-3 py-2 text-sm text-error">
+ <p className="bg-error/5 px-3 py-2 text-sm text-error my-2">
<span className="font-medium">
{t("settings.mcp.ladder.floor.label")}
</span>{" "}
@@ -149,13 +152,11 @@ function LadderRow({
}) {
const { t } = useTranslation();
return (
- <li className="flex items-start gap-x-2 border-b border-block-border px-1 py-2">
+ <li className="flex items-start gap-x-2 px-1 py-1">
<span
className={cn(
"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full",
- served
- ? "bg-success/10 text-success"
- : "bg-control-bg text-control-light"
+ served ? "bg-success/10 text-success" : "bg-error/10 text-error"
)}
>
{served ? (
@@ -174,12 +175,7 @@ function LadderRow({
</span>
<div className="flex min-w-0 flex-col gap-1">
<div className="flex flex-wrap items-center gap-2">
- <span
- className={cn(
- "text-sm",
- served ? "font-medium text-main" : "text-control-light"
- )}
- >
+ <span className="text-sm text-control-light">
{t(mcpRowKey(row, "title"))}
</span>
{served && (
@@ -192,12 +188,7 @@ function LadderRow({
)}
</div>
{details && (
- <p
- className={cn(
- "text-xs leading-4",
- served ? "text-control" : "text-control-light"
- )}
- >
+ <p className="text-xs leading-5 text-control-light">
{t(mcpRowKey(row, "details"))}
</p>
)}
@@ -211,10 +202,10 @@ function TierDivider({ tier }: { tier: MCPCapabilityTier }) {
return (
<li
role="presentation"
- className="flex items-center gap-x-2 border-b border-block-border py-2 text-xs text-control-light"
+ className="flex items-center gap-x-2 py-2 text-sm text-control-light"
>
<Separator className="flex-1" />
- <span className="uppercase tracking-wide">
+ <span className="uppercase font-medium text-main tracking-wide">
{t(mcpTierKey(tier, "stops"))}
</span>
<Separator className="flex-1" />