diff --git a/turnstone/shared_static/auth.js b/turnstone/shared_static/auth.js index 4657e31a..a10afcac 100644 --- a/turnstone/shared_static/auth.js +++ b/turnstone/shared_static/auth.js @@ -713,6 +713,15 @@ function _storePermissions(data) { } else { sessionStorage.removeItem("turnstone_permissions"); } + // Surface the authenticated identity for the rail footer's user chip. + // whoami returns user_id (the username); the shell reads it via ts.username + // and repaints once it lands. Cleared in lockstep with permissions so the + // chip never shows a stale user after logout / revocation. + if (data && data.user_id) { + sessionStorage.setItem("ts.username", data.user_id); + } else { + sessionStorage.removeItem("ts.username"); + } } function _setBusy(busy, label) { diff --git a/turnstone/shared_static/rail.js b/turnstone/shared_static/rail.js index 9b72d153..da0bcdd6 100644 --- a/turnstone/shared_static/rail.js +++ b/turnstone/shared_static/rail.js @@ -331,21 +331,21 @@ export function mountManage(root, paneManager) { root.replaceChildren(); // If the Admin pane is already open (e.g. restored by PaneManager.rehydrate), - // seed the rail to its current tab + expand the owning group; otherwise the - // first group expands (mock) and nothing is marked until the user clicks. + // seed the rail to its current tab + expand the owning group; otherwise every + // group starts collapsed and nothing is marked until the user clicks. const adminOpen = paneManager && paneManager.hasPane && paneManager.hasPane("admin"); const activeTab = adminOpen && TS.getActiveTab ? TS.getActiveTab() : null; const rowByTab = new Map(); // tab -> its row