From 3916c2785b2a5dc5196b2a15bdc87948cb80ce16 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Thu, 3 Dec 2026 16:30:26 +0100 Subject: [PATCH] fix: limit access dialog keeps the clamped level when it opens Co-Authored-By: Claude Opus 5.5 --- .../(root)/(logged)/oauth/mcp_authorize/+page@(root).svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(root)/(logged)/oauth/mcp_authorize/+page@(root).svelte b/frontend/src/routes/(root)/(logged)/oauth/mcp_authorize/+page@(root).svelte index aeb5a57157..962f0b3107 100644 --- a/frontend/src/routes/(root)/(logged)/oauth/mcp_authorize/+page@(root).svelte +++ b/frontend/src/routes/(root)/(logged)/oauth/mcp_authorize/+page@(root).svelte @@ -214,7 +214,11 @@ function openEdit() { beforeEdit = { access, scopes, all: allWorkspaces, picked: pickedWorkspaces } // The dialog offers the level shown and those below it, so it opens on the level shown. - if (ceiling && access !== 'selected' && RANK[access] > RANK[ceiling]) setAccess(ceiling) + // The picker starts from `scopes`, so they move down with it. + if (ceiling && access !== 'selected' && RANK[access] > RANK[ceiling]) { + setAccess(ceiling) + scopes = ACCESS_SCOPES[ceiling] + } editing = true } function closeEdit(keep: boolean) {