From 7c899942fbd5421c175b26a783c50318eead61a0 Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 16 Sep 2026 23:22:18 +0800 Subject: [PATCH] Stop stealing conversation.hero.workspace slot with a null lock. Default priority 0 lock displaced the shipped picker; clearing it left workspaces unselectable and blocked Session create in the DSH UI. Deny open-workspace with CSS and click guards only. Co-authored-by: Cursor --- uds-auth/lib/client.js | 51 +++++------------------------------------- uds-auth/package.json | 2 +- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/uds-auth/lib/client.js b/uds-auth/lib/client.js index bf216434..76651851 100644 --- a/uds-auth/lib/client.js +++ b/uds-auth/lib/client.js @@ -1981,51 +1981,14 @@ function reloadAfterLogin() { event.stopPropagation() }, true) - let workspaceDispose = null - const LockedWorkspace = function UdsAuthLockedWorkspace(props) { - React.useEffect(() => { - if (props && props.open) { - try { props.onClose && props.onClose() } catch { /* ignore */ } - } - }, [props && props.open]) - return null - } - const installWorkspaceLock = () => { - if (workspaceDispose) return - try { - workspaceDispose = ctx.slots.register({ - name: 'conversation.hero.workspace', - id: 'uds-auth-workspace-lock', - order: 9999, - }, LockedWorkspace) - } catch { /* slot may be undeclared briefly */ } - } - const clearWorkspaceLock = () => { - if (workspaceDispose) { - try { workspaceDispose() } catch { /* ignore */ } - workspaceDispose = null - } - } - // Deny open-workspace by default until AuthBadge /api/me proves canCreateWorkspace. + // Do NOT register into conversation.hero.workspace. A null lock at the + // default priority 0 steals the shipped picker (same single-slot clash as + // directoryFlow); clearing it never restores the occupant, so workspaces + // cannot be selected and sessions cannot be created in the DSH UI. freezeChoosers() - - const syncWorkspaceSlot = () => { - // Use AuthBadge DOM attrs only — no default /api/me. - const canCreate = document.documentElement.getAttribute('data-uds-can-create-ws') === '1' - if (canCreate) clearWorkspaceLock() - else installWorkspaceLock() - freezeChoosers() - } - let workspaceInjectOff = null - try { - workspaceInjectOff = ctx.slots.inject('conversation.hero.workspace', () => { - syncWorkspaceSlot() - }) - } catch { /* ignore */ } - syncWorkspaceSlot() - const onAuth = () => { syncWorkspaceSlot() } + const onAuth = () => { freezeChoosers() } window.addEventListener('uds-auth-changed', onAuth) - const mo = new MutationObserver(() => { freezeChoosers(); syncWorkspaceSlot() }) + const mo = new MutationObserver(() => { freezeChoosers() }) mo.observe(document.documentElement, { childList: true, subtree: true, @@ -2039,8 +2002,6 @@ function reloadAfterLogin() { document.removeEventListener('pointerdown', block, true) document.removeEventListener('mousedown', block, true) window.removeEventListener('uds-auth-changed', onAuth) - clearWorkspaceLock() - try { if (typeof workspaceInjectOff === 'function') workspaceInjectOff() } catch { /* ignore */ } } }, 'uds-auth: workspace-click-lock') ctx.effect(() => { diff --git a/uds-auth/package.json b/uds-auth/package.json index c04bda51..48476f25 100644 --- a/uds-auth/package.json +++ b/uds-auth/package.json @@ -1,6 +1,6 @@ { "name": "uds-auth", - "version": "0.2.11", + "version": "0.2.12", "description": "UDS authentication plugin for DeepSeek Harness with multi-tenant session isolation", "type": "module", "main": "lib/index.js",