fix: limit access dialog keeps the clamped level when it opens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-12-03 16:30:26 +01:00
co-authored by Claude Opus 5.5
parent 41f17d63db
commit 3916c2785b
@@ -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) {