From 41f17d63dba87de391509b0ddf3d58feeb3c91d3 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Thu, 3 Dec 2026 16:27:32 +0100 Subject: [PATCH] fix: pens next to the workspace and access values on the mcp consent page Co-Authored-By: Claude Opus 5.5 --- .../lib/components/mcp/McpAccessLine.svelte | 6 ++- .../components/mcp/McpAccessSection.svelte | 5 +-- .../oauth/mcp_authorize/+page@(root).svelte | 45 ++++++++++--------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/frontend/src/lib/components/mcp/McpAccessLine.svelte b/frontend/src/lib/components/mcp/McpAccessLine.svelte index 6392c17e75..00c705cd98 100644 --- a/frontend/src/lib/components/mcp/McpAccessLine.svelte +++ b/frontend/src/lib/components/mcp/McpAccessLine.svelte @@ -2,6 +2,7 @@ import type { McpWorkspaceAccess } from '$lib/gen' import type { McpAccess } from './McpAccessPicker.svelte' import Tooltip from '$lib/components/Tooltip.svelte' + import type { Snippet } from 'svelte' import { connectionLevel, narrows } from './workspaceAccess' interface Props { @@ -10,9 +11,11 @@ access: McpAccess /** Names the level, for where no select already shows it. */ labelled?: boolean + /** Rendered after the level, to change it. */ + edit?: Snippet } - let { workspaces, access, labelled = false }: Props = $props() + let { workspaces, access, labelled = false, edit }: Props = $props() const shown = $derived(connectionLevel(workspaces, access)) // Under a select, a workspace giving less than the level picked is what the sentence is about. @@ -23,6 +26,7 @@
{shown.label} {#if shown.hint}{shown.hint}{/if} + {@render edit?.()}
{/if} {#if less} diff --git a/frontend/src/lib/components/mcp/McpAccessSection.svelte b/frontend/src/lib/components/mcp/McpAccessSection.svelte index 6d97fa1cf8..9bbdc6a29c 100644 --- a/frontend/src/lib/components/mcp/McpAccessSection.svelte +++ b/frontend/src/lib/components/mcp/McpAccessSection.svelte @@ -9,12 +9,10 @@ /** The tools "Show tools" lists: a level's, or the scripts and flows a role offers as tools * in `workspace`. None hides the button. */ tools?: { level?: ToolsetLevel; workspace?: string } - /** Next to the label, to change the access. */ - edit?: Snippet children: Snippet } - let { tools, edit, children }: Props = $props() + let { tools, children }: Props = $props() let open = $state(false) const shown = $derived(!!tools && (!!tools.level || !!tools.workspace)) @@ -23,7 +21,6 @@
Access - {@render edit?.()} {#if shown}
+

+ {access === 'selected' || toolsOnly || toolsAlone ? 'Workspace' : 'Workspaces'} +

{#if loadingWorkspaces}

Loading workspaces...

{:else if accessLoadFailed} @@ -509,7 +496,18 @@ Your role lets you connect scripts and flows as tools, one workspace per connection.

{:else if toolsAlone} -

{covered[0].name}

+
+

{covered[0].name}

+
{:else} 0 || access === 'selected')}
- + {#if served.length > 0} - + {:else} -

- Scripts and flows as tools. Choose the workspace and its scripts and flows. -

+
+

+ Scripts and flows as tools. Choose the workspace and its scripts and flows. +

+ {@render pen()} +
{/if}