Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
feat(portal): add sectioned left-nav shell
rcourtmanc72a88a009fb
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.jsonindex 0538365204..9ed4d67ac1 100644--- a/internal/cloudcp/portal/dist/build_manifest.json+++ b/internal/cloudcp/portal/dist/build_manifest.json@@ -1,5 +1,5 @@{- "source_hash": "2cbfa509f8e18522b02bce02cea0af8db454746381d6e7cae0e1b5a0eefcad5d",+ "source_hash": "087912d40011626d575748045a827f33b34abfd10a3a35ddf8f79ba776b2f549","build_inputs": ["package.json","tsconfig.json",diff --git a/internal/cloudcp/portal/dist/portal_app.css b/internal/cloudcp/portal/dist/portal_app.cssindex ee3a0421b9..6ae2e3efe3 100644--- a/internal/cloudcp/portal/dist/portal_app.css+++ b/internal/cloudcp/portal/dist/portal_app.css@@ -241,45 +241,90 @@ header .logout-btn:hover,background: rgba(255, 255, 255, 0.98);box-shadow: var(--shadow-sm);}-.portal-command-strip {+.portal-shell-layout {display: grid;- grid-template-columns: repeat(3, minmax(0, 1fr));- gap: 0;+ grid-template-columns: 248px minmax(0, 1fr);+ gap: 24px;+ align-items: start;+}+.portal-shell-nav {+ position: sticky;+ top: 88px;+ border: 1px solid var(--line);border-radius: var(--radius-md);+ background: rgba(255, 255, 255, 0.98);+ box-shadow: var(--shadow-sm);+ overflow: hidden;}-.portal-command-link {- display: block;- padding: 16px 18px;- text-decoration: none;- transition: background 140ms ease;+.portal-shell-nav-group {+ display: flex;+ flex-direction: column;}-.portal-command-link + .portal-command-link {- border-left: 1px solid var(--line);+.portal-shell-nav-link {+ display: flex;+ flex-direction: column;+ gap: 6px;+ width: 100%;+ padding: 15px 16px;+ border: none;+ border-bottom: 1px solid var(--line);+ background: transparent;+ text-align: left;+ cursor: pointer;+ transition: background 140ms ease, color 140ms ease;}-.portal-command-link:hover {+.portal-shell-nav-link:last-child {+ border-bottom: none;+}+.portal-shell-nav-link:hover {background: #f7fafc;}-.portal-command-label {+.portal-shell-nav-link.active {+ background: #eef6f7;+}+.portal-shell-nav-label {display: block;font-size: 14px;font-weight: 700;- margin-bottom: 5px;}-.portal-command-copy {+.portal-shell-nav-copy {display: block;- font-size: 13px;- line-height: 1.5;+ font-size: 12px;+ line-height: 1.45;color: var(--ink-soft);}+.portal-shell-main {+ min-width: 0;+}+.portal-shell-main > .portal-content-panel {+ display: none !important;+}+.portal-shell[data-shell-section=overview] .portal-content-panel-overview,+.portal-shell[data-shell-section=services] .portal-content-panel-services,+.portal-shell[data-shell-section=support] .portal-content-panel-support,+.portal-shell[data-shell-section=workspaces] .portal-content-panel-overview,+.portal-shell[data-shell-section=team] .portal-content-panel-overview {+ display: block !important;+}+.portal-shell[data-shell-section=overview] .account-content-panel-overview,+.portal-shell[data-shell-section=workspaces] .account-content-panel-workspaces,+.portal-shell[data-shell-section=team] .account-content-panel-team {+ display: block !important;+}+.portal-shell[data-shell-section=overview] .account-content-panel-workspaces,+.portal-shell[data-shell-section=overview] .account-content-panel-team,+.portal-shell[data-shell-section=workspaces] .account-content-panel-overview,+.portal-shell[data-shell-section=workspaces] .account-content-panel-team,+.portal-shell[data-shell-section=team] .account-content-panel-overview,+.portal-shell[data-shell-section=team] .account-content-panel-workspaces {+ display: none !important;+}.portal-support-link,.support-link,.service-panel .helper-text a {color: var(--accent-strong);font-weight: 600;}-.portal-command-link-support {- text-align: right;-}.portal-stage {display: flex;flex-direction: column;@@ -356,6 +401,9 @@ header .logout-btn:hover,gap: 18px;margin-top: 22px;}+.account-content-panel {+ display: block;+}.account-command-deck,.account-overview-card,.account-stat-card,@@ -475,6 +523,49 @@ header .logout-btn:hover,flex-direction: column;gap: 16px;}+.portal-support-panel {+ border: 1px solid var(--line);+ border-radius: var(--radius-lg);+ padding: 26px;+ background: rgba(255, 255, 255, 0.98);+ box-shadow: var(--shadow-sm);+}+.portal-support-panel h2 {+ margin: 8px 0 0;+ font-size: clamp(1.8rem, 2.4vw, 2.5rem);+ line-height: 1.02;+ letter-spacing: -0.05em;+}+.portal-support-panel > p {+ margin: 12px 0 0;+ max-width: 760px;+ font-size: 15px;+ line-height: 1.7;+ color: var(--ink-soft);+}+.portal-support-card-grid {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 14px;+ margin-top: 20px;+}+.portal-support-card {+ padding: 18px;+ border: 1px solid var(--line);+ border-radius: var(--radius-md);+ background: var(--panel-muted);+}+.portal-support-card h3 {+ margin: 0;+ font-size: 18px;+ letter-spacing: -0.02em;+}+.portal-support-card p {+ margin: 10px 0 14px;+ font-size: 14px;+ line-height: 1.65;+ color: var(--ink-soft);+}.account-stage-header {padding: 2px 4px 0;}@@ -674,30 +765,68 @@ header .logout-btn:hover,.team-panel-heading {margin-bottom: 12px;}-.team-table {- width: 100%;- border-collapse: collapse;+.team-roster-list {+ display: flex;+ flex-direction: column;+ gap: 10px;}-.team-table th {- padding: 10px 8px;- text-align: left;- font-size: 11px;- font-weight: 800;- letter-spacing: 0.12em;- text-transform: uppercase;- color: var(--ink-muted);- border-bottom: 1px solid var(--line);+.team-member-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 16px;+ padding: 14px 16px;+ border: 1px solid var(--line);+ border-radius: 10px;+ background: var(--panel-muted);}-.team-table td {- padding: 12px 8px;- border-bottom: 1px solid var(--line);- vertical-align: middle;+.team-member-identity {+ display: flex;+ flex-direction: column;+ gap: 4px;+ min-width: 0;}-.team-message-cell {- text-align: center;+.team-member-email {+ font-size: 14px;+ font-weight: 700;+ color: var(--ink);+}+.team-member-caption {+ font-size: 12px;+ color: var(--ink-soft);+}+.team-member-controls {+ display: flex;+ align-items: center;+ gap: 10px;+ flex-wrap: wrap;+}+.team-role-badge {+ display: inline-flex;+ align-items: center;+ min-height: 36px;+ padding: 0 12px;+ border-radius: 999px;+ background: #edf3ff;+ color: #35507a;+ font-size: 12px;+ font-weight: 700;+}+.team-role-select {+ min-width: 140px;+}+.team-list-message {+ display: flex;+ align-items: center;+ justify-content: center;+ min-height: 120px;+ padding: 16px;+ border: 1px dashed var(--line-strong);+ border-radius: 10px;color: var(--ink-muted);+ background: var(--panel-muted);}-.team-message-cell.error {+.team-list-message.error {color: var(--danger);}.btn-remove {@@ -898,13 +1027,16 @@ header .logout-btn:hover,.team-management-grid {grid-template-columns: 1fr;}- .portal-command-strip,+ .portal-shell-layout,.account-command-deck {grid-template-columns: 1fr;}.account-metric-strip {grid-template-columns: repeat(2, minmax(0, 1fr));}+ .portal-shell-nav {+ position: static;+ }.workspace-management-content {grid-template-columns: 1fr;}@@ -935,7 +1067,9 @@ header .logout-btn:hover,.main {padding: 18px 16px 40px;}- .portal-command-strip {+ .portal-shell-layout,+ .portal-support-card-grid,+ .portal-shell-nav-group {grid-template-columns: 1fr;}.account-surface,@@ -951,13 +1085,6 @@ header .logout-btn:hover,flex-direction: column;align-items: flex-start;}- .portal-command-link + .portal-command-link {- border-left: none;- border-top: 1px solid var(--line);- }- .portal-command-link-support {- text-align: left;- }.account-action-strip {flex-direction: column;align-items: stretch;@@ -968,6 +1095,11 @@ header .logout-btn:hover,.workspace-actions .btn-secondary {width: 100%;}+ .team-member-row,+ .team-member-controls {+ flex-direction: column;+ align-items: stretch;+ }.workspace-row-status-grid {grid-template-columns: 1fr;}diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.jsindex 0b971b8d04..c6f62a81d0 100644--- a/internal/cloudcp/portal/dist/portal_app.js+++ b/internal/cloudcp/portal/dist/portal_app.js@@ -68,15 +68,12 @@actionButton.setAttribute("data-workspace-action", workspace.state === "active" ? "suspend" : "delete");closeButton.disabled = entry.manageWorkspace.pending;}- function setTbodyMessage(tbody, msg, isError) {- tbody.textContent = "";- var tr = document.createElement("tr");- var td = document.createElement("td");- td.setAttribute("colspan", "3");- td.className = "team-message-cell" + (isError ? " error" : "");- td.textContent = msg;- tr.appendChild(td);- tbody.appendChild(tr);+ function setContainerMessage(container, msg, isError) {+ container.textContent = "";+ var message = document.createElement("div");+ message.className = "team-list-message" + (isError ? " error" : "");+ message.textContent = msg;+ container.appendChild(message);}function countMembersByRole(members, role) {var count = 0;@@ -103,13 +100,15 @@var members = entry.teamQuery.data;stats.innerHTML = '<div class="team-stat-card"><span class="team-stat-label">Members</span><span class="team-stat-value">' + String(members.length) + '</span></div><div class="team-stat-card"><span class="team-stat-label">Owners</span><span class="team-stat-value">' + String(countMembersByRole(members, "owner")) + '</span></div><div class="team-stat-card"><span class="team-stat-label">Admins</span><span class="team-stat-value">' + String(countMembersByRole(members, "admin")) + '</span></div><div class="team-stat-card"><span class="team-stat-label">Operators</span><span class="team-stat-value">' + String(countMembersByRole(members, "tech") + countMembersByRole(members, "read_only")) + "</span></div>";}- function renderTeamMemberRoleCell(accountID, member, isOwner) {- var tdRole = document.createElement("td");+ function renderTeamRoleControl(accountID, member, isOwner) {if (member.role === "owner" && !isOwner) {- tdRole.textContent = "owner";- return tdRole;+ var locked = document.createElement("span");+ locked.className = "team-role-badge";+ locked.textContent = "Owner";+ return locked;}var sel = document.createElement("select");+ sel.className = "team-role-select";var roles = isOwner ? ["owner", "admin", "tech", "read_only"] : ["admin", "tech", "read_only"];for (var j = 0; j < roles.length; j += 1) {var opt = document.createElement("option");@@ -121,13 +120,11 @@sel.setAttribute("data-action", "change-role");sel.setAttribute("data-account-id", accountID);sel.setAttribute("data-user-id", member.user_id);- tdRole.appendChild(sel);- return tdRole;+ return sel;}- function renderTeamMemberActionCell(accountID, member, isOwner) {- var tdAction = document.createElement("td");+ function renderTeamMemberAction(accountID, member, isOwner) {if (member.role === "owner" && !isOwner) {- return tdAction;+ return null;}var btn = document.createElement("button");btn.type = "button";@@ -137,8 +134,29 @@btn.setAttribute("data-account-id", accountID);btn.setAttribute("data-user-id", member.user_id);btn.setAttribute("data-member-email", member.email);- tdAction.appendChild(btn);- return tdAction;+ return btn;+ }+ function renderTeamMemberRow(accountID, member, isOwner) {+ var row = document.createElement("div");+ row.className = "team-member-row";+ var identity = document.createElement("div");+ identity.className = "team-member-identity";+ var email = document.createElement("div");+ email.className = "team-member-email";+ email.textContent = member.email;+ identity.appendChild(email);+ var caption = document.createElement("div");+ caption.className = "team-member-caption";+ caption.textContent = member.role === "owner" ? "Full account owner access" : "Hosted account operator";+ identity.appendChild(caption);+ var controls = document.createElement("div");+ controls.className = "team-member-controls";+ controls.appendChild(renderTeamRoleControl(accountID, member, isOwner));+ var action = renderTeamMemberAction(accountID, member, isOwner);+ if (action) controls.appendChild(action);+ row.appendChild(identity);+ row.appendChild(controls);+ return row;}function renderAddWorkspaceSection(accountID, entry) {var form = getElement("add-ws-form-" + accountID);@@ -151,8 +169,8 @@}function renderTeamSection(accountID, entry) {var section = getElement("team-section-" + accountID);- var tbody = getElement("team-list-" + accountID);- if (!section || !tbody) return;+ var roster = getElement("team-list-" + accountID);+ if (!section || !roster) return;var actorRole = section.getAttribute("data-actor-role") || "";var isOwner = actorRole === "owner";section.classList.toggle("visible", entry.teamVisible);@@ -161,27 +179,21 @@return;}if (entry.teamQuery.status === "loading") {- setTbodyMessage(tbody, "Loading\u2026", false);+ setContainerMessage(roster, "Loading\u2026", false);return;}if (entry.teamQuery.status === "error") {- setTbodyMessage(tbody, entry.teamQuery.error, true);+ setContainerMessage(roster, entry.teamQuery.error, true);return;}if (!entry.teamQuery.data.length) {- setTbodyMessage(tbody, "No team members.", false);+ setContainerMessage(roster, "No team members.", false);return;}- tbody.textContent = "";+ roster.textContent = "";for (var i = 0; i < entry.teamQuery.data.length; i += 1) {var member = entry.teamQuery.data[i];- var tr = document.createElement("tr");- var tdEmail = document.createElement("td");- tdEmail.textContent = member.email;- tr.appendChild(tdEmail);- tr.appendChild(renderTeamMemberRoleCell(accountID, member, isOwner));- tr.appendChild(renderTeamMemberActionCell(accountID, member, isOwner));- tbody.appendChild(tr);+ roster.appendChild(renderTeamMemberRow(accountID, member, isOwner));}}function renderAccountUI(accountState, accounts) {@@ -214,6 +226,7 @@switch (action) {case "toggle-add-workspace":event.preventDefault();+ deps.setShellSection("workspaces");deps.runtime.toggleAddWorkspace(accountID);return;case "open-billing":@@ -222,7 +235,8 @@return;case "toggle-team":event.preventDefault();- deps.runtime.toggleTeam(accountID);+ deps.setShellSection("team");+ deps.runtime.ensureTeamVisible(accountID);return;case "invite-member":event.preventDefault();@@ -230,10 +244,12 @@return;case "create-workspace":event.preventDefault();+ deps.setShellSection("workspaces");void deps.runtime.createWorkspace(accountID);return;case "select-workspace":event.preventDefault();+ deps.setShellSection("workspaces");deps.runtime.selectWorkspace(accountID,actionEl.getAttribute("data-workspace-id") || ""@@ -241,10 +257,12 @@return;case "clear-workspace-selection":event.preventDefault();+ deps.setShellSection("workspaces");deps.runtime.clearWorkspaceSelection(accountID);return;case "workspace-action":event.preventDefault();+ deps.setShellSection("workspaces");void deps.runtime.manageWorkspaceAction(accountID,actionEl.getAttribute("data-workspace-id") || "",@@ -486,6 +504,11 @@byAccountID: {}};}+ function createPortalShellState() {+ return {+ activeSection: "overview"+ };+ }function createMutationState() {return {pending: false,@@ -786,6 +809,21 @@void loadTeam(accountID);}};+ var ensureTeamVisible = function(accountID) {+ var shouldLoad = false;+ deps.store.updateAccountState(function(accountState) {+ var entry = ensurePortalAccountUIEntry(accountState, accountID);+ if (!entry.teamVisible) {+ entry.teamVisible = true;+ entry.selectedWorkspaceID = "";+ entry.addWorkspaceOpen = false;+ }+ shouldLoad = entry.teamQuery.status === "idle" || entry.teamQuery.status === "error";+ });+ if (shouldLoad) {+ void loadTeam(accountID);+ }+ };var inviteMember = async function(accountID) {var emailEl = getElement("invite-email-" + accountID);var roleEl = getElement("invite-role-" + accountID);@@ -851,6 +889,7 @@clearWorkspaceSelection,openBilling,toggleTeam,+ ensureTeamVisible,inviteMember,createWorkspace,manageWorkspaceAction,@@ -1065,6 +1104,7 @@switch (action) {case "open-service-panel":event.preventDefault();+ deps.setShellSection("services");deps.toggleServicePanel(panelID);deps.focusElement(focusID);return;@@ -1484,6 +1524,9 @@store.subscribeBootstrap(renderServiceRuntime);store.subscribeServices(renderServiceRuntime);installServicesController({+ setShellSection: function(section) {+ store.setActiveShellSection(section);+ },toggleServicePanel,focusElement: focusElement2,requestVerificationCode: function(flowID) {@@ -1598,9 +1641,12 @@var summary = hosted ? "Open hosted workspaces, manage account access, and handle commercial account services from one place." : "Use this account for self-hosted billing, license recovery, refunds, and privacy actions. Hosted workspace access will appear here when it is attached to this email.";return '<section class="portal-hero"><div class="portal-hero-copy"><div class="portal-hero-kicker">' + (hosted ? "Hosted access is active on this account." : "No hosted workspace access is attached to this account yet.") + "</div><h1>" + title + "</h1><p>" + summary + '</p></div><div class="portal-hero-stats"><div class="portal-hero-stat"><span class="portal-hero-stat-label">Hosted access</span><span class="portal-hero-stat-value">' + (hosted ? "Active" : "Not attached") + '</span></div><div class="portal-hero-stat"><span class="portal-hero-stat-label">Accounts</span><span class="portal-hero-stat-value">' + (accounts.length === 1 ? "1 account" : String(accounts.length) + " accounts") + '</span></div><div class="portal-hero-stat"><span class="portal-hero-stat-label">Workspaces</span><span class="portal-hero-stat-value">' + String(workspaceTotal) + "</span></div></div></section>";}- function renderShellNavigation(accounts, supportEmail) {+ function shellSectionButton(section, activeSection, title, copy) {+ return '<button class="portal-shell-nav-link' + (activeSection === section ? " active" : "") + '" type="button" data-shell-action="activate-section" data-shell-section="' + section + '"><span class="portal-shell-nav-label">' + title + '</span><span class="portal-shell-nav-copy">' + copy + "</span></button>";+ }+ function renderShellNavigation(accounts, supportEmail, activeSection) {var hosted = hasHostedAccounts(accounts);- return '<nav class="portal-command-strip" aria-label="Pulse Account sections"><a class="portal-command-link" href="#hosted-operations-section"><span class="portal-command-label">' + (hosted ? "Hosted operations" : "Hosted access") + '</span><span class="portal-command-copy">' + (hosted ? "Workspaces, teams, and hosted billing" : "No hosted workspaces are attached yet") + '</span></a><a class="portal-command-link" href="#account-services-section"><span class="portal-command-label">Account services</span><span class="portal-command-copy">Licenses, billing, refunds, and privacy</span></a><a class="portal-command-link portal-command-link-support" href="mailto:' + escapeAttr(supportEmail || "") + '"><span class="portal-command-label">Support</span><span class="portal-command-copy">' + escapeHTML(supportEmail || "") + "</span></a></nav>";+ return '<aside class="portal-shell-nav" aria-label="Pulse Account sections"><div class="portal-shell-nav-group">' + shellSectionButton("overview", activeSection, "Overview", hosted ? "Posture, accounts, and quick actions" : "Account summary and access state") + shellSectionButton("workspaces", activeSection, hosted ? "Workspaces" : "Hosted access", hosted ? "Hosted fleet and lifecycle actions" : "No hosted workspaces are attached yet") + shellSectionButton("team", activeSection, "Team", hosted ? "Access and operator roster" : "Account membership") + shellSectionButton("services", activeSection, "Account services", "Licenses, billing, refunds, and privacy") + shellSectionButton("support", activeSection, "Support", supportEmail || "Support contact") + "</div></aside>";}function renderWorkspaceCard(account, workspace, accountAPIBasePath) {var status = workspaceHealthState(workspace);@@ -1627,7 +1673,7 @@}return '<article class="workspace-row"><div class="workspace-row-main"><div class="workspace-row-title"><div class="workspace-row-heading"><h4 class="workspace-name">' + escapeHTML(workspace.display_name) + '</h4><div class="workspace-meta">' + metaParts.join("") + '</div></div><p class="workspace-summary">' + escapeHTML(workspaceStatusCopy(workspace)) + '</p></div><div class="workspace-row-status-grid"><div class="workspace-row-status-cell"><span class="workspace-row-status-label">Health</span>' + healthBadgeHTML(workspace) + '</div><div class="workspace-row-status-cell"><span class="workspace-row-status-label">Lifecycle</span><span class="badge badge-' + escapeHTML(state || "unknown") + '">' + escapeHTML(titleCase(state || "Unknown")) + '</span></div></div></div><div class="workspace-actions">' + openAction + manageAction + "</div></article>";}- function renderAccountSection(account, accountAPIBasePath) {+ function renderAccountOverviewSection(account) {var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];var summaryText = accountKindLabel(account) + " \xB7 " + titleCase(account.role) + " \xB7 " + workspaceCountLabel(workspaces.length);var healthyCount = countWorkspacesByHealth(workspaces, "healthy");@@ -1636,21 +1682,31 @@var activeCount = countWorkspacesByState(workspaces, "active");var operationsCopy = account.kind === "msp" ? "Manage the client fleet from this account surface. Workspace creation, billing, and team actions belong here." : "Use this account surface to open hosted workspaces, manage billing, and control access for this hosted account.";var actions = "";- var teamSection = "";var addWorkspaceForm = "";- var workspaceManagement = "";if (account.can_manage) {- actions = '<div class="account-action-strip"><div class="account-action-copy"><div class="account-panel-kicker">Account operations</div><p>' + escapeHTML(operationsCopy) + '</p></div><div class="account-actions">' + (account.kind === "msp" ? '<button type="button" class="btn-secondary" id="add-ws-btn-' + escapeAttr(account.id) + '" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(account.id) + '">Add workspace</button>' : "") + (account.has_billing ? '<button type="button" class="btn-secondary" data-action="open-billing" data-account-id="' + escapeAttr(account.id) + '">Manage billing</button>' : "") + '<button type="button" class="btn-secondary" id="team-btn-' + escapeAttr(account.id) + '" data-action="toggle-team" data-account-id="' + escapeAttr(account.id) + '">Manage team</button></div></div>';- teamSection = '<section class="team-management-panel team-section" id="team-section-' + escapeAttr(account.id) + '" data-actor-role="' + escapeAttr(account.role) + '"><div class="team-management-header"><div><div class="account-panel-kicker">Team management</div><h3>Control who can operate this account</h3><p>Owners manage billing and access. Admins and techs keep the hosted fleet running day to day.</p></div><button type="button" class="btn-secondary btn-compact" data-action="toggle-team" data-account-id="' + escapeAttr(account.id) + '">Done</button></div><div class="team-management-stats" id="team-stats-' + escapeAttr(account.id) + '"></div><div class="team-management-grid"><div class="team-roster"><div class="team-panel-heading"><h4>People on this account</h4><p>Keep the roster small and role assignment explicit. The people listed here are the ones who can operate the hosted fleet.</p></div><table class="team-table"><thead><tr><th>Email</th><th>Role</th><th></th></tr></thead><tbody id="team-list-' + escapeAttr(account.id) + '"><tr><td colspan="3" class="team-message-cell">Loading\u2026</td></tr></tbody></table></div><div class="team-invite-panel"><div class="team-panel-heading"><h4>Invite someone new</h4><p>Add another operator with the minimum role they need for this account.</p></div><div class="team-invite"><div><label for="invite-email-' + escapeAttr(account.id) + '">Email</label><input type="email" id="invite-email-' + escapeAttr(account.id) + '" placeholder="[email protected]" autocomplete="off"></div><div><label for="invite-role-' + escapeAttr(account.id) + '">Role</label><select id="invite-role-' + escapeAttr(account.id) + '"><option value="admin">Admin</option><option value="tech">Tech</option><option value="read_only">Read-only</option></select></div><button type="button" class="btn-primary btn-compact" data-action="invite-member" data-account-id="' + escapeAttr(account.id) + '">Invite</button></div></div></div></section>';- workspaceManagement = '<section class="workspace-management-panel" id="workspace-management-' + escapeAttr(account.id) + '"><div class="workspace-management-header"><div><div class="account-panel-kicker">Workspace management</div><h3>Review one workspace at a time</h3><p>Select a workspace from the fleet to review its lifecycle state and run explicit management actions.</p></div><button type="button" class="btn-secondary btn-compact" id="workspace-management-close-' + escapeAttr(account.id) + '" data-action="clear-workspace-selection" data-account-id="' + escapeAttr(account.id) + '">Done</button></div><div class="workspace-management-empty" id="workspace-management-empty-' + escapeAttr(account.id) + '">Choose a workspace to manage from the fleet above.</div><div class="workspace-management-content" id="workspace-management-content-' + escapeAttr(account.id) + '" hidden><div class="workspace-management-meta" id="workspace-management-meta-' + escapeAttr(account.id) + '"></div><h4 id="workspace-management-title-' + escapeAttr(account.id) + '"></h4><p class="workspace-management-summary" id="workspace-management-summary-' + escapeAttr(account.id) + '"></p><div class="workspace-management-actions"><button type="button" class="btn-danger" id="workspace-management-action-' + escapeAttr(account.id) + '" data-action="workspace-action" data-account-id="' + escapeAttr(account.id) + '">Manage workspace</button></div></div></section>';+ actions = '<div class="account-action-strip"><div class="account-action-copy"><div class="account-panel-kicker">Account operations</div><p>' + escapeHTML(operationsCopy) + '</p></div><div class="account-actions">' + (account.kind === "msp" ? '<button type="button" class="btn-secondary" id="add-ws-btn-' + escapeAttr(account.id) + '" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(account.id) + '" data-shell-target="workspaces">Add workspace</button>' : "") + (account.has_billing ? '<button type="button" class="btn-secondary" data-action="open-billing" data-account-id="' + escapeAttr(account.id) + '">Manage billing</button>' : "") + '<button type="button" class="btn-secondary" id="team-btn-' + escapeAttr(account.id) + '" data-action="toggle-team" data-account-id="' + escapeAttr(account.id) + '" data-shell-target="team">Manage team</button></div></div>';if (account.kind === "msp") {addWorkspaceForm = '<div class="add-workspace-form" id="add-ws-form-' + escapeAttr(account.id) + '"><label for="ws-name-' + escapeAttr(account.id) + '">Workspace name (for example, a client name)</label><input type="text" id="ws-name-' + escapeAttr(account.id) + '" placeholder="Acme Corp" maxlength="80" autocomplete="off"><div class="form-actions"><button type="button" class="btn-primary" data-action="create-workspace" data-account-id="' + escapeAttr(account.id) + '">Create workspace</button><button type="button" class="btn-secondary" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(account.id) + '">Cancel</button><div class="spinner" id="ws-spinner-' + escapeAttr(account.id) + '" hidden></div></div></div>';}}+ return '<section class="account-content-panel account-content-panel-overview"><div class="account-command-deck"><div class="account-overview-card"><div class="account-panel-kicker">Hosted posture</div><h3>' + escapeHTML(account.name) + "</h3><p>" + escapeHTML(summaryText) + '</p></div><div class="account-metric-strip"><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Active workspaces</span><span class="account-stat-value">' + String(activeCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Healthy</span><span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Checking</span><span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Needs attention</span><span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + "</span></div></div>" + actions + addWorkspaceForm + "</div></section>";+ }+ function renderAccountWorkspaceSection(account, accountAPIBasePath) {+ var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];+ var workspaceManagement = "";+ if (account.can_manage) {+ workspaceManagement = '<section class="workspace-management-panel" id="workspace-management-' + escapeAttr(account.id) + '"><div class="workspace-management-header"><div><div class="account-panel-kicker">Workspace management</div><h3>Review one workspace at a time</h3><p>Select a workspace from the fleet to review its lifecycle state and run explicit management actions.</p></div><button type="button" class="btn-secondary btn-compact" id="workspace-management-close-' + escapeAttr(account.id) + '" data-action="clear-workspace-selection" data-account-id="' + escapeAttr(account.id) + '">Done</button></div><div class="workspace-management-empty" id="workspace-management-empty-' + escapeAttr(account.id) + '">Choose a workspace to manage from the fleet above.</div><div class="workspace-management-content" id="workspace-management-content-' + escapeAttr(account.id) + '" hidden><div class="workspace-management-meta" id="workspace-management-meta-' + escapeAttr(account.id) + '"></div><h4 id="workspace-management-title-' + escapeAttr(account.id) + '"></h4><p class="workspace-management-summary" id="workspace-management-summary-' + escapeAttr(account.id) + '"></p><div class="workspace-management-actions"><button type="button" class="btn-danger" id="workspace-management-action-' + escapeAttr(account.id) + '" data-action="workspace-action" data-account-id="' + escapeAttr(account.id) + '">Manage workspace</button></div></div></section>';+ }var workspaceHTML = workspaces.length ? '<div class="workspace-list">' + workspaces.map(function(workspace) {return renderWorkspaceCard(account, workspace, accountAPIBasePath);}).join("") + "</div>" : '<div class="empty-state"><p>No hosted workspaces yet. Create one to get started.</p></div>';- return '<section class="account-surface"><div class="account-surface-header"><div class="account-heading"><div class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + "</div><h2>" + escapeHTML(account.name) + '</h2><div class="account-summary">' + escapeHTML(summaryText) + '</div></div><div class="account-badges"><span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + "</span>" + roleBadgeHTML(account.role) + '</div></div><div class="account-surface-body"><div class="account-command-deck"><div class="account-overview-card"><div class="account-panel-kicker">Hosted posture</div><h3>' + escapeHTML(account.name) + "</h3><p>" + escapeHTML(summaryText) + '</p></div><div class="account-metric-strip"><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Active workspaces</span><span class="account-stat-value">' + String(activeCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Healthy</span><span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Checking</span><span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Needs attention</span><span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + "</span></div></div>" + actions + addWorkspaceForm + '</div><div class="account-main-stage"><div class="account-stage-header"><div><div class="account-panel-kicker">Workspace fleet</div><h3>Open hosted Pulse workspaces</h3><p>Review fleet health, move into a workspace, and keep lifecycle actions explicit.</p></div></div>' + workspaceHTML + '<div class="account-management-grid">' + workspaceManagement + teamSection + "</div></div></div></section>";+ return '<section class="account-content-panel account-content-panel-workspaces"><div class="account-stage-header"><div><div class="account-panel-kicker">Workspace fleet</div><h3>Open hosted Pulse workspaces</h3><p>Review fleet health, move into a workspace, and keep lifecycle actions explicit.</p></div></div>' + workspaceHTML + '<div class="account-management-grid">' + workspaceManagement + "</div></section>";+ }+ function renderAccountTeamSection(account) {+ return '<section class="account-content-panel account-content-panel-team"><section class="team-management-panel team-section team-section-shell" id="team-section-' + escapeAttr(account.id) + '" data-actor-role="' + escapeAttr(account.role) + '"><div class="team-management-header"><div><div class="account-panel-kicker">Team management</div><h3>Control who can operate this account</h3><p>Owners manage billing and access. Admins and techs keep the hosted fleet running day to day.</p></div><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Done</button></div><div class="team-management-stats" id="team-stats-' + escapeAttr(account.id) + '"></div><div class="team-management-grid"><div class="team-roster"><div class="team-panel-heading"><h4>People on this account</h4><p>Keep the roster small and role assignment explicit. The people listed here are the ones who can operate the hosted fleet.</p></div><div class="team-roster-list" id="team-list-' + escapeAttr(account.id) + '"><div class="team-list-message">Loading\u2026</div></div></div><div class="team-invite-panel"><div class="team-panel-heading"><h4>Invite someone new</h4><p>Add another operator with the minimum role they need for this account.</p></div><div class="team-invite"><div><label for="invite-email-' + escapeAttr(account.id) + '">Email</label><input type="email" id="invite-email-' + escapeAttr(account.id) + '" placeholder="[email protected]" autocomplete="off"></div><div><label for="invite-role-' + escapeAttr(account.id) + '">Role</label><select id="invite-role-' + escapeAttr(account.id) + '"><option value="admin">Admin</option><option value="tech">Tech</option><option value="read_only">Read-only</option></select></div><button type="button" class="btn-primary btn-compact" data-action="invite-member" data-account-id="' + escapeAttr(account.id) + '">Invite</button></div></div></div></section></section>';+ }+ function renderSupportSection(context) {+ return '<section class="portal-support-panel"><div class="account-panel-kicker">Support</div><h2>Get help without leaving Pulse Account</h2><p>Use support when hosted access looks wrong, billing does not behave as expected, or you need help with commercial licensing and privacy actions.</p><div class="portal-support-card-grid"><div class="portal-support-card"><h3>Account support</h3><p>For access, tenant handoff, team, and billing issues, contact the hosted operations desk.</p><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div><div class="portal-support-card"><h3>Commercial services</h3><p>Self-hosted subscriptions, license recovery, refunds, and privacy requests all route through the same account surface.</p><button type="button" class="btn-secondary" data-shell-action="activate-section" data-shell-section="services">Open account services</button></div></div></section>';}function renderHeaderHTML(context) {if (context.bootstrap.authenticated) {@@ -1658,21 +1714,16 @@}return '<a class="logout-btn link-button" href="' + escapeAttr(context.signupPath) + '">Create account</a>';}- function renderAccountsHTML(context) {- var safeAccounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];- if (safeAccounts.length === 0) {- return '<div class="empty-state empty-state-spaced"><p>No hosted workspaces are attached to this account.</p><p class="support-copy">You can still use the self-hosted licensing and billing tools below.</p><p class="support-copy">Need help? Contact <a href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '" class="support-link">' + escapeHTML(context.bootstrap.support_email || "") + "</a></p></div>";- }- return safeAccounts.map(function(account) {- return renderAccountSection(account, context.accountAPIBasePath);- }).join("");- }function renderAuthenticatedPortalHTML(context) {var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];var hosted = hasHostedAccounts(accounts);+ var activeSection = context.activeSection || "overview";var serviceHeading = hosted ? "Self-hosted licenses and billing" : "Account services";var serviceNote = hosted ? "Hosted operations live above. Use these commercial tools for self-hosted licenses, billing, refunds, and privacy actions." : "Use these account tools for self-hosted licenses, billing, refunds, and privacy actions.";- return '<div class="portal-shell">' + renderOverviewBand(accounts) + renderShellNavigation(accounts, context.bootstrap.support_email || "") + '<section class="portal-top-section" id="hosted-operations-section"><div class="portal-top-section-header"><div class="account-panel-kicker">' + (hosted ? "Hosted operations" : "Hosted access") + "</div><h2>" + (hosted ? "Run hosted accounts from one place" : "No hosted workspaces are attached yet") + "</h2><p>" + (hosted ? "Use this area for workspace access, fleet operations, hosted billing, and team management." : "This account does not currently have hosted workspace access. If that is unexpected, contact support while using the commercial tools below.") + '</p></div><div id="accounts-root">' + renderAccountsHTML(context) + '</div></section><section class="service-section" id="account-services-section"><div class="service-header"><div><div class="account-panel-kicker">Account services</div><h2>' + serviceHeading + '</h2></div><div class="service-note">' + serviceNote + '</div></div><div class="service-grid"><button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email"><span class="service-card-kicker">Billing</span><h3>Manage subscriptions</h3><p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p></button><button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email"><span class="service-card-kicker">Licenses</span><h3>Retrieve licenses</h3><p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p></button><button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email"><span class="service-card-kicker">Refunds</span><h3>Refund requests</h3><p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p></button><button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email"><span class="service-card-kicker">Privacy</span><h3>Data and privacy</h3><p>Request commercial data export or deletion without leaving the account shell.</p></button></div><div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div><div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div><div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div><div class="service-panel" id="data-service-panel"><h3>Data and privacy</h3><p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p><div class="subsection"><div id="data-export-root"></div></div><div class="subsection"><div id="data-delete-root"></div></div><div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + "</a>.</div></div></section></div>";+ var hostedContent = accounts.map(function(account) {+ return '<section class="account-surface"><div class="account-surface-header"><div class="account-heading"><div class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + "</div><h2>" + escapeHTML(account.name) + '</h2><div class="account-summary">' + escapeHTML(accountKindLabel(account) + " \xB7 " + titleCase(account.role) + " \xB7 " + workspaceCountLabel((account.workspaces || []).length)) + '</div></div><div class="account-badges"><span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + "</span>" + roleBadgeHTML(account.role) + '</div></div><div class="account-surface-body">' + renderAccountOverviewSection(account) + renderAccountWorkspaceSection(account, context.accountAPIBasePath) + renderAccountTeamSection(account) + "</div></section>";+ }).join("");+ return '<div class="portal-shell" data-shell-section="' + activeSection + '">' + renderOverviewBand(accounts) + '<div class="portal-shell-layout">' + renderShellNavigation(accounts, context.bootstrap.support_email || "", activeSection) + '<div class="portal-shell-main"><section class="portal-content-panel portal-content-panel-overview"><div class="portal-top-section-header"><div class="account-panel-kicker">' + (hosted ? "Hosted operations" : "Hosted access") + "</div><h2>" + (hosted ? "Run hosted accounts from one place" : "No hosted workspaces are attached yet") + "</h2><p>" + (hosted ? "Use this area for workspace access, fleet operations, hosted billing, and team management." : "This account does not currently have hosted workspace access. If that is unexpected, contact support while using the commercial tools below.") + '</p></div><div id="accounts-root">' + hostedContent + '</div></section><section class="portal-content-panel portal-content-panel-services service-section" id="account-services-section"><div class="service-header"><div><div class="account-panel-kicker">Account services</div><h2>' + serviceHeading + '</h2></div><div class="service-note">' + serviceNote + '</div></div><div class="service-grid"><button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email" data-shell-target="services"><span class="service-card-kicker">Billing</span><h3>Manage subscriptions</h3><p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p></button><button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email" data-shell-target="services"><span class="service-card-kicker">Licenses</span><h3>Retrieve licenses</h3><p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p></button><button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email" data-shell-target="services"><span class="service-card-kicker">Refunds</span><h3>Refund requests</h3><p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p></button><button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email" data-shell-target="services"><span class="service-card-kicker">Privacy</span><h3>Data and privacy</h3><p>Request commercial data export or deletion without leaving the account shell.</p></button></div><div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div><div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div><div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div><div class="service-panel" id="data-service-panel"><h3>Data and privacy</h3><p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p><div class="subsection"><div id="data-export-root"></div></div><div class="subsection"><div id="data-delete-root"></div></div><div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a>.</div></div></section><section class="portal-content-panel portal-content-panel-support">' + renderSupportSection(context) + "</section></div></div></div>";}function renderSignedOutPortalHTML(context) {var statusHTML = "";@@ -1687,6 +1738,18 @@// src/shell.tsfunction installShell(deps) {+ function syncShellSection() {+ var root = document.querySelector(".portal-shell");+ var activeSection = deps.store.getShellState().activeSection;+ if (root) {+ root.setAttribute("data-shell-section", activeSection);+ }+ var links = document.querySelectorAll('[data-shell-action="activate-section"]');+ links.forEach(function(node) {+ var button = node;+ button.classList.toggle("active", button.getAttribute("data-shell-section") === activeSection);+ });+ }function renderHeader() {var userInfo = document.getElementById("portal-user-info");if (!userInfo) return;@@ -1707,9 +1770,11 @@bootstrap: portalBootstrap,loginState: deps.store.getLoginState(),signupPath: portalBootstrap.signup_path,- accountAPIBasePath: portalBootstrap.account_api_base_path+ accountAPIBasePath: portalBootstrap.account_api_base_path,+ activeSection: deps.store.getShellState().activeSection};root.innerHTML = portalBootstrap.authenticated ? renderAuthenticatedPortalHTML(context) : renderSignedOutPortalHTML(context);+ syncShellSection();}deps.store.subscribeBootstrap(function() {renderPortalApp();@@ -1717,6 +1782,19 @@deps.store.subscribeLogin(function() {renderPortalApp();});+ deps.store.subscribeShell(function() {+ syncShellSection();+ });+ document.addEventListener("click", function(event) {+ var target = event.target instanceof HTMLElement ? event.target.closest('[data-shell-action="activate-section"]') : null;+ if (!target) return;+ event.preventDefault();+ var section = target.getAttribute("data-shell-section") || "overview";+ deps.store.setActiveShellSection(section);+ if (deps.onSectionChange) {+ deps.onSectionChange(section);+ }+ });renderPortalApp();}@@ -1737,12 +1815,14 @@var bootstrapState = normalizeBootstrap(bootstrapDefaults, initialBootstrap);var accountState = createPortalAccountState();var loginState = createPortalLoginState();+ var shellState = createPortalShellState();var serviceState = createPortalServiceState();syncLoginStateBootstrapEmail(loginState, bootstrapState.email || "");syncServiceStateBootstrapEmail(serviceState, bootstrapState.email || "");var accountSubscribers = /* @__PURE__ */ new Set();var bootstrapSubscribers = /* @__PURE__ */ new Set();var loginSubscribers = /* @__PURE__ */ new Set();+ var shellSubscribers = /* @__PURE__ */ new Set();var serviceSubscribers = /* @__PURE__ */ new Set();function notify(subscribers) {subscribers.forEach(function(listener) {@@ -1759,6 +1839,9 @@getLoginState: function() {return loginState;},+ getShellState: function() {+ return shellState;+ },getServiceState: function() {return serviceState;},@@ -1783,6 +1866,11 @@}return loginState;},+ setActiveShellSection: function(section) {+ shellState.activeSection = section;+ notify(shellSubscribers);+ return shellState;+ },updateServiceState: function(mutator, options) {mutator(serviceState);if (!options || options.notify !== false) {@@ -1808,6 +1896,12 @@loginSubscribers.delete(listener);};},+ subscribeShell: function(listener) {+ shellSubscribers.add(listener);+ return function() {+ shellSubscribers.delete(listener);+ };+ },subscribeServices: function(listener) {serviceSubscribers.add(listener);return function() {@@ -1940,8 +2034,22 @@toast.className = "toast";}, 4e3);}+ var accountRuntime = installAccountRuntime({+ api,+ store: deps.store,+ refreshBootstrap,+ showToast+ });installShell({- store: deps.store+ store: deps.store,+ onSectionChange: function(section) {+ if (section === "team") {+ var accounts = deps.store.getBootstrap().accounts || [];+ if (accounts[0]) {+ accountRuntime.ensureTeamVisible(accounts[0].id);+ }+ }+ }});installServicesRuntime({api,@@ -1951,14 +2059,11 @@api,store: deps.store});- var accountRuntime = installAccountRuntime({- api,- store: deps.store,- refreshBootstrap,- showToast- });installAccountController({- runtime: accountRuntime+ runtime: accountRuntime,+ setShellSection: function(section) {+ deps.store.setActiveShellSection(section);+ }});var startupRefresh = deps.store.getBootstrap().authenticated ? refreshBootstrap() : null;return {diff --git a/internal/cloudcp/portal/frontend/src/account_controller.test.ts b/internal/cloudcp/portal/frontend/src/account_controller.test.tsindex a2e8aaa2d5..3afe7da40a 100644--- a/internal/cloudcp/portal/frontend/src/account_controller.test.ts+++ b/internal/cloudcp/portal/frontend/src/account_controller.test.ts@@ -15,6 +15,7 @@ describe('account controller', function() {clearWorkspaceSelection: vi.fn(),openBilling: vi.fn(),toggleTeam: vi.fn(),+ ensureTeamVisible: vi.fn(),inviteMember: vi.fn(),createWorkspace: vi.fn(),manageWorkspaceAction: vi.fn(),@@ -22,7 +23,9 @@ describe('account controller', function() {changeRole: vi.fn(),};- installAccountController({ runtime: runtime });+ var setShellSection = vi.fn();++ installAccountController({ runtime: runtime, setShellSection: setShellSection });document.body.innerHTML ='<button id="toggle" data-action="toggle-add-workspace" data-account-id="acct_1">Toggle</button>' +@@ -37,13 +40,15 @@ describe('account controller', function() {'<select id="role" data-action="change-role" data-account-id="acct_1" data-user-id="u1"><option value="admin">Admin</option></select>';document.getElementById('toggle')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));+ expect(setShellSection).toHaveBeenCalledWith('workspaces');expect(runtime.toggleAddWorkspace).toHaveBeenCalledWith('acct_1');document.getElementById('billing')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));expect(runtime.openBilling).toHaveBeenCalledWith('acct_1');document.getElementById('team')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));- expect(runtime.toggleTeam).toHaveBeenCalledWith('acct_1');+ expect(setShellSection).toHaveBeenCalledWith('team');+ expect(runtime.ensureTeamVisible).toHaveBeenCalledWith('acct_1');document.getElementById('invite')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));expect(runtime.inviteMember).toHaveBeenCalledWith('acct_1');diff --git a/internal/cloudcp/portal/frontend/src/account_controller.ts b/internal/cloudcp/portal/frontend/src/account_controller.tsindex 3ae0f5b819..6a30072cc2 100644--- a/internal/cloudcp/portal/frontend/src/account_controller.ts+++ b/internal/cloudcp/portal/frontend/src/account_controller.ts@@ -3,6 +3,7 @@ import type { AccountRuntime } from './account_runtime';export interface AccountControllerDeps {runtime: AccountRuntime;+ setShellSection: (section: 'overview' | 'workspaces' | 'team' | 'services' | 'support') => void;}export function installAccountController(deps: AccountControllerDeps): void {@@ -17,6 +18,7 @@ export function installAccountController(deps: AccountControllerDeps): void {switch (action) {case 'toggle-add-workspace':event.preventDefault();+ deps.setShellSection('workspaces');deps.runtime.toggleAddWorkspace(accountID);return;case 'open-billing':@@ -25,7 +27,8 @@ export function installAccountController(deps: AccountControllerDeps): void {return;case 'toggle-team':event.preventDefault();- deps.runtime.toggleTeam(accountID);+ deps.setShellSection('team');+ deps.runtime.ensureTeamVisible(accountID);return;case 'invite-member':event.preventDefault();@@ -33,10 +36,12 @@ export function installAccountController(deps: AccountControllerDeps): void {return;case 'create-workspace':event.preventDefault();+ deps.setShellSection('workspaces');void deps.runtime.createWorkspace(accountID);return;case 'select-workspace':event.preventDefault();+ deps.setShellSection('workspaces');deps.runtime.selectWorkspace(accountID,actionEl.getAttribute('data-workspace-id') || '',@@ -44,10 +49,12 @@ export function installAccountController(deps: AccountControllerDeps): void {return;case 'clear-workspace-selection':event.preventDefault();+ deps.setShellSection('workspaces');deps.runtime.clearWorkspaceSelection(accountID);return;case 'workspace-action':event.preventDefault();+ deps.setShellSection('workspaces');void deps.runtime.manageWorkspaceAction(accountID,actionEl.getAttribute('data-workspace-id') || '',diff --git a/internal/cloudcp/portal/frontend/src/account_runtime.ts b/internal/cloudcp/portal/frontend/src/account_runtime.tsindex 02f419f2bc..01a3a03b27 100644--- a/internal/cloudcp/portal/frontend/src/account_runtime.ts+++ b/internal/cloudcp/portal/frontend/src/account_runtime.ts@@ -19,6 +19,7 @@ export interface AccountRuntime {clearWorkspaceSelection(accountID: string): void;openBilling(accountID: string): Promise<void>;toggleTeam(accountID: string): void;+ ensureTeamVisible(accountID: string): void;inviteMember(accountID: string): Promise<void>;createWorkspace(accountID: string): Promise<void>;manageWorkspaceAction(accountID: string, tenantID: string, action: string, name: string): Promise<void>;@@ -217,6 +218,22 @@ export function installAccountRuntime(deps: AccountRuntimeDeps): AccountRuntime}};+ var ensureTeamVisible = function(accountID: string): void {+ var shouldLoad = false;+ deps.store.updateAccountState(function(accountState) {+ var entry = ensurePortalAccountUIEntry(accountState, accountID);+ if (!entry.teamVisible) {+ entry.teamVisible = true;+ entry.selectedWorkspaceID = '';+ entry.addWorkspaceOpen = false;+ }+ shouldLoad = entry.teamQuery.status === 'idle' || entry.teamQuery.status === 'error';+ });+ if (shouldLoad) {+ void loadTeam(accountID);+ }+ };+var inviteMember = async function(accountID: string): Promise<void> {var emailEl = getElement<HTMLInputElement>('invite-email-' + accountID);var roleEl = getElement<HTMLSelectElement>('invite-role-' + accountID);@@ -286,6 +303,7 @@ export function installAccountRuntime(deps: AccountRuntimeDeps): AccountRuntimeclearWorkspaceSelection: clearWorkspaceSelection,openBilling: openBilling,toggleTeam: toggleTeam,+ ensureTeamVisible: ensureTeamVisible,inviteMember: inviteMember,createWorkspace: createWorkspace,manageWorkspaceAction: manageWorkspaceAction,diff --git a/internal/cloudcp/portal/frontend/src/account_view.ts b/internal/cloudcp/portal/frontend/src/account_view.tsindex f4c50c2938..44c688899c 100644--- a/internal/cloudcp/portal/frontend/src/account_view.ts+++ b/internal/cloudcp/portal/frontend/src/account_view.ts@@ -87,15 +87,12 @@ export function renderWorkspaceManagement(account: PortalAccountSummary, entry:closeButton.disabled = entry.manageWorkspace.pending;}-function setTbodyMessage(tbody: HTMLElement, msg: string, isError: boolean): void {- tbody.textContent = '';- var tr = document.createElement('tr');- var td = document.createElement('td');- td.setAttribute('colspan', '3');- td.className = 'team-message-cell' + (isError ? ' error' : '');- td.textContent = msg;- tr.appendChild(td);- tbody.appendChild(tr);+function setContainerMessage(container: HTMLElement, msg: string, isError: boolean): void {+ container.textContent = '';+ var message = document.createElement('div');+ message.className = 'team-list-message' + (isError ? ' error' : '');+ message.textContent = msg;+ container.appendChild(message);}function countMembersByRole(members: PortalTeamMember[], role: string): number {@@ -130,14 +127,16 @@ function renderTeamStats(accountID: string, entry: PortalAccountUIEntry): void {'<div class="team-stat-card"><span class="team-stat-label">Operators</span><span class="team-stat-value">' + String(countMembersByRole(members, 'tech') + countMembersByRole(members, 'read_only')) + '</span></div>';}-function renderTeamMemberRoleCell(accountID: string, member: PortalTeamMember, isOwner: boolean): HTMLTableCellElement {- var tdRole = document.createElement('td');+function renderTeamRoleControl(accountID: string, member: PortalTeamMember, isOwner: boolean): HTMLElement {if (member.role === 'owner' && !isOwner) {- tdRole.textContent = 'owner';- return tdRole;+ var locked = document.createElement('span');+ locked.className = 'team-role-badge';+ locked.textContent = 'Owner';+ return locked;}var sel = document.createElement('select');+ sel.className = 'team-role-select';var roles = isOwner ? ['owner', 'admin', 'tech', 'read_only'] : ['admin', 'tech', 'read_only'];for (var j = 0; j < roles.length; j += 1) {var opt = document.createElement('option');@@ -149,14 +148,12 @@ function renderTeamMemberRoleCell(accountID: string, member: PortalTeamMember, isel.setAttribute('data-action', 'change-role');sel.setAttribute('data-account-id', accountID);sel.setAttribute('data-user-id', member.user_id);- tdRole.appendChild(sel);- return tdRole;+ return sel;}-function renderTeamMemberActionCell(accountID: string, member: PortalTeamMember, isOwner: boolean): HTMLTableCellElement {- var tdAction = document.createElement('td');+function renderTeamMemberAction(accountID: string, member: PortalTeamMember, isOwner: boolean): HTMLElement | null {if (member.role === 'owner' && !isOwner) {- return tdAction;+ return null;}var btn = document.createElement('button');@@ -167,8 +164,35 @@ function renderTeamMemberActionCell(accountID: string, member: PortalTeamMember,btn.setAttribute('data-account-id', accountID);btn.setAttribute('data-user-id', member.user_id);btn.setAttribute('data-member-email', member.email);- tdAction.appendChild(btn);- return tdAction;+ return btn;+}++function renderTeamMemberRow(accountID: string, member: PortalTeamMember, isOwner: boolean): HTMLElement {+ var row = document.createElement('div');+ row.className = 'team-member-row';++ var identity = document.createElement('div');+ identity.className = 'team-member-identity';++ var email = document.createElement('div');+ email.className = 'team-member-email';+ email.textContent = member.email;+ identity.appendChild(email);++ var caption = document.createElement('div');+ caption.className = 'team-member-caption';+ caption.textContent = member.role === 'owner' ? 'Full account owner access' : 'Hosted account operator';+ identity.appendChild(caption);++ var controls = document.createElement('div');+ controls.className = 'team-member-controls';+ controls.appendChild(renderTeamRoleControl(accountID, member, isOwner));+ var action = renderTeamMemberAction(accountID, member, isOwner);+ if (action) controls.appendChild(action);++ row.appendChild(identity);+ row.appendChild(controls);+ return row;}export function renderAddWorkspaceSection(accountID: string, entry: PortalAccountUIEntry): void {@@ -183,8 +207,8 @@ export function renderAddWorkspaceSection(accountID: string, entry: PortalAccounexport function renderTeamSection(accountID: string, entry: PortalAccountUIEntry): void {var section = getElement<HTMLElement>('team-section-' + accountID);- var tbody = getElement<HTMLElement>('team-list-' + accountID);- if (!section || !tbody) return;+ var roster = getElement<HTMLElement>('team-list-' + accountID);+ if (!section || !roster) return;var actorRole = section.getAttribute('data-actor-role') || '';var isOwner = actorRole === 'owner';@@ -195,28 +219,22 @@ export function renderTeamSection(accountID: string, entry: PortalAccountUIEntryreturn;}if (entry.teamQuery.status === 'loading') {- setTbodyMessage(tbody, 'Loading…', false);+ setContainerMessage(roster, 'Loading…', false);return;}if (entry.teamQuery.status === 'error') {- setTbodyMessage(tbody, entry.teamQuery.error, true);+ setContainerMessage(roster, entry.teamQuery.error, true);return;}if (!entry.teamQuery.data.length) {- setTbodyMessage(tbody, 'No team members.', false);+ setContainerMessage(roster, 'No team members.', false);return;}- tbody.textContent = '';+ roster.textContent = '';for (var i = 0; i < entry.teamQuery.data.length; i += 1) {var member = entry.teamQuery.data[i];- var tr = document.createElement('tr');- var tdEmail = document.createElement('td');- tdEmail.textContent = member.email;- tr.appendChild(tdEmail);- tr.appendChild(renderTeamMemberRoleCell(accountID, member, isOwner));- tr.appendChild(renderTeamMemberActionCell(accountID, member, isOwner));- tbody.appendChild(tr);+ roster.appendChild(renderTeamMemberRow(accountID, member, isOwner));}}diff --git a/internal/cloudcp/portal/frontend/src/app.ts b/internal/cloudcp/portal/frontend/src/app.tsindex 95c5a259e6..3401e2a768 100644--- a/internal/cloudcp/portal/frontend/src/app.ts+++ b/internal/cloudcp/portal/frontend/src/app.ts@@ -61,29 +61,40 @@ export function installPortalApp(deps: PortalAppDeps): PortalApp {}, 4000);}- installShell({+ var accountRuntime = installAccountRuntime({+ api: api,store: deps.store,+ refreshBootstrap: refreshBootstrap,+ showToast: showToast,});- installServicesRuntime({- api: api,+ installShell({store: deps.store,+ onSectionChange: function(section) {+ if (section === 'team') {+ var accounts = deps.store.getBootstrap().accounts || [];+ if (accounts[0]) {+ accountRuntime.ensureTeamVisible(accounts[0].id);+ }+ }+ },});- installAuthController({+ installServicesRuntime({api: api,store: deps.store,});- var accountRuntime = installAccountRuntime({+ installAuthController({api: api,store: deps.store,- refreshBootstrap: refreshBootstrap,- showToast: showToast,});installAccountController({runtime: accountRuntime,+ setShellSection: function(section) {+ deps.store.setActiveShellSection(section);+ },});var startupRefresh = deps.store.getBootstrap().authenticated ? refreshBootstrap() : null;diff --git a/internal/cloudcp/portal/frontend/src/services.ts b/internal/cloudcp/portal/frontend/src/services.tsindex b454e2f4f0..a843757b22 100644--- a/internal/cloudcp/portal/frontend/src/services.ts+++ b/internal/cloudcp/portal/frontend/src/services.ts@@ -428,6 +428,9 @@ export function installServicesRuntime(deps: ServicesRuntimeDeps): void {store.subscribeServices(renderServiceRuntime);installServicesController({+ setShellSection: function(section) {+ store.setActiveShellSection(section);+ },toggleServicePanel,focusElement,requestVerificationCode: function(flowID) {diff --git a/internal/cloudcp/portal/frontend/src/services_controller.test.ts b/internal/cloudcp/portal/frontend/src/services_controller.test.tsindex cec5152865..6abad50eb5 100644--- a/internal/cloudcp/portal/frontend/src/services_controller.test.ts+++ b/internal/cloudcp/portal/frontend/src/services_controller.test.ts@@ -10,6 +10,7 @@ describe('services controller', function() {it('routes service actions to the matching handlers', function() {var deps = {+ setShellSection: vi.fn(),toggleServicePanel: vi.fn(),focusElement: vi.fn(),requestVerificationCode: vi.fn(),@@ -32,6 +33,7 @@ describe('services controller', function() {'<button id="refund" data-account-service-action="refund-inline-submit">Refund</button>';document.getElementById('open')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));+ expect(deps.setShellSection).toHaveBeenCalledWith('services');expect(deps.toggleServicePanel).toHaveBeenCalledWith('retrieve-service-panel');expect(deps.focusElement).toHaveBeenCalledWith('retrieve-inline-email');@@ -53,6 +55,7 @@ describe('services controller', function() {it('routes input and checkbox changes into state update hooks', function() {var deps = {+ setShellSection: vi.fn(),toggleServicePanel: vi.fn(),focusElement: vi.fn(),requestVerificationCode: vi.fn(),diff --git a/internal/cloudcp/portal/frontend/src/services_controller.ts b/internal/cloudcp/portal/frontend/src/services_controller.tsindex 90a4e57ef2..8e938daa87 100644--- a/internal/cloudcp/portal/frontend/src/services_controller.ts+++ b/internal/cloudcp/portal/frontend/src/services_controller.ts@@ -1,6 +1,7 @@import { asHTMLElement } from './services_view';export interface ServicesControllerDeps {+ setShellSection: (section: 'overview' | 'workspaces' | 'team' | 'services' | 'support') => void;toggleServicePanel: (panelID: string) => void;focusElement: (id: string) => void;requestVerificationCode: (flowID: 'manage' | 'retrieve' | 'export' | 'delete') => void;@@ -23,6 +24,7 @@ export function installServicesController(deps: ServicesControllerDeps): void {switch (action) {case 'open-service-panel':event.preventDefault();+ deps.setShellSection('services');deps.toggleServicePanel(panelID);deps.focusElement(focusID);return;diff --git a/internal/cloudcp/portal/frontend/src/shell.ts b/internal/cloudcp/portal/frontend/src/shell.tsindex 931040d87d..296820edf9 100644--- a/internal/cloudcp/portal/frontend/src/shell.ts+++ b/internal/cloudcp/portal/frontend/src/shell.ts@@ -4,12 +4,27 @@ import {renderHeaderHTML,renderSignedOutPortalHTML,} from './shell_view';+import type { PortalShellSection } from './types';export interface ShellDeps {store: PortalStore;+ onSectionChange?: (section: PortalShellSection) => void;}export function installShell(deps: ShellDeps): void {+ function syncShellSection() {+ var root = document.querySelector('.portal-shell') as HTMLElement | null;+ var activeSection = deps.store.getShellState().activeSection;+ if (root) {+ root.setAttribute('data-shell-section', activeSection);+ }+ var links = document.querySelectorAll('[data-shell-action="activate-section"]');+ links.forEach(function(node) {+ var button = node as HTMLElement;+ button.classList.toggle('active', button.getAttribute('data-shell-section') === activeSection);+ });+ }+function renderHeader() {var userInfo = document.getElementById('portal-user-info');if (!userInfo) return;@@ -32,10 +47,12 @@ export function installShell(deps: ShellDeps): void {loginState: deps.store.getLoginState(),signupPath: portalBootstrap.signup_path,accountAPIBasePath: portalBootstrap.account_api_base_path,+ activeSection: deps.store.getShellState().activeSection,};root.innerHTML = portalBootstrap.authenticated? renderAuthenticatedPortalHTML(context): renderSignedOutPortalHTML(context);+ syncShellSection();}deps.store.subscribeBootstrap(function() {@@ -46,5 +63,20 @@ export function installShell(deps: ShellDeps): void {renderPortalApp();});+ deps.store.subscribeShell(function() {+ syncShellSection();+ });++ document.addEventListener('click', function(event) {+ var target = event.target instanceof HTMLElement ? event.target.closest('[data-shell-action="activate-section"]') as HTMLElement | null : null;+ if (!target) return;+ event.preventDefault();+ var section = (target.getAttribute('data-shell-section') || 'overview') as PortalShellSection;+ deps.store.setActiveShellSection(section);+ if (deps.onSectionChange) {+ deps.onSectionChange(section);+ }+ });+renderPortalApp();}diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.tsindex b622eaa471..188e3fd0ef 100644--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts@@ -127,11 +127,11 @@ describe('shell view', function() {expect(html).toContain('<h1>Pulse Account</h1>');expect(html).toContain('Hosted access is active on this account.');- expect(html).toContain('portal-command-strip');- expect(html).toContain('Hosted operations');+ expect(html).toContain('portal-shell-nav');+ expect(html).toContain('Overview');+ expect(html).toContain('Workspaces');expect(html).toContain('Account services');expect(html).toContain('Support');- expect(html).toContain('id="hosted-operations-section"');expect(html).toContain('id="account-services-section"');expect(html).toContain('Self-hosted licenses and billing');expect(html).toContain('id="accounts-root"');diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.tsindex 3eb7f5554e..dc7a33dca7 100644--- a/internal/cloudcp/portal/frontend/src/shell_view.ts+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts@@ -2,6 +2,7 @@ import type {PortalAccountSummary,PortalBootstrapData,PortalLoginState,+ PortalShellSection,PortalWorkspaceSummary,} from './types';@@ -10,6 +11,7 @@ export interface ShellViewContext {loginState: PortalLoginState;signupPath: string;accountAPIBasePath: string;+ activeSection?: PortalShellSection;}function escapeHTML(value: unknown): string {@@ -140,23 +142,27 @@ function renderOverviewBand(accounts: PortalAccountSummary[]): string {);}-function renderShellNavigation(accounts: PortalAccountSummary[], supportEmail: string): string {+function shellSectionButton(section: PortalShellSection, activeSection: PortalShellSection, title: string, copy: string): string {+ return (+ '<button class="portal-shell-nav-link' + (activeSection === section ? ' active' : '') + '" type="button" data-shell-action="activate-section" data-shell-section="' + section + '">' ++ '<span class="portal-shell-nav-label">' + title + '</span>' ++ '<span class="portal-shell-nav-copy">' + copy + '</span>' ++ '</button>'+ );+}++function renderShellNavigation(accounts: PortalAccountSummary[], supportEmail: string, activeSection: PortalShellSection): string {var hosted = hasHostedAccounts(accounts);return (- '<nav class="portal-command-strip" aria-label="Pulse Account sections">' +- '<a class="portal-command-link" href="#hosted-operations-section">' +- '<span class="portal-command-label">' + (hosted ? 'Hosted operations' : 'Hosted access') + '</span>' +- '<span class="portal-command-copy">' + (hosted ? 'Workspaces, teams, and hosted billing' : 'No hosted workspaces are attached yet') + '</span>' +- '</a>' +- '<a class="portal-command-link" href="#account-services-section">' +- '<span class="portal-command-label">Account services</span>' +- '<span class="portal-command-copy">Licenses, billing, refunds, and privacy</span>' +- '</a>' +- '<a class="portal-command-link portal-command-link-support" href="mailto:' + escapeAttr(supportEmail || '') + '">' +- '<span class="portal-command-label">Support</span>' +- '<span class="portal-command-copy">' + escapeHTML(supportEmail || '') + '</span>' +- '</a>' +- '</nav>'+ '<aside class="portal-shell-nav" aria-label="Pulse Account sections">' ++ '<div class="portal-shell-nav-group">' ++ shellSectionButton('overview', activeSection, 'Overview', hosted ? 'Posture, accounts, and quick actions' : 'Account summary and access state') ++ shellSectionButton('workspaces', activeSection, hosted ? 'Workspaces' : 'Hosted access', hosted ? 'Hosted fleet and lifecycle actions' : 'No hosted workspaces are attached yet') ++ shellSectionButton('team', activeSection, 'Team', hosted ? 'Access and operator roster' : 'Account membership') ++ shellSectionButton('services', activeSection, 'Account services', 'Licenses, billing, refunds, and privacy') ++ shellSectionButton('support', activeSection, 'Support', supportEmail || 'Support contact') ++ '</div>' ++ '</aside>');}@@ -225,7 +231,7 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWor);}-function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath: string): string {+function renderAccountOverviewSection(account: PortalAccountSummary): string {var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];var summaryText = accountKindLabel(account) + ' · ' + titleCase(account.role) + ' · ' + workspaceCountLabel(workspaces.length);var healthyCount = countWorkspacesByHealth(workspaces, 'healthy');@@ -237,9 +243,7 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:: 'Use this account surface to open hosted workspaces, manage billing, and control access for this hosted account.';var actions = '';- var teamSection = '';var addWorkspaceForm = '';- var workspaceManagement = '';if (account.can_manage) {actions ='<div class="account-action-strip">' +@@ -253,7 +257,7 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:escapeAttr(account.id) +'" data-action="toggle-add-workspace" data-account-id="' +escapeAttr(account.id) +- '">Add workspace</button>'+ '" data-shell-target="workspaces">Add workspace</button>': '') +(account.has_billing? '<button type="button" class="btn-secondary" data-action="open-billing" data-account-id="' +@@ -264,68 +268,73 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:escapeAttr(account.id) +'" data-action="toggle-team" data-account-id="' +escapeAttr(account.id) +- '">Manage team</button>' ++ '" data-shell-target="team">Manage team</button>' +'</div>' +'</div>';- teamSection =- '<section class="team-management-panel team-section" id="team-section-' +- escapeAttr(account.id) +- '" data-actor-role="' +- escapeAttr(account.role) +- '">' +- '<div class="team-management-header">' +- '<div>' +- '<div class="account-panel-kicker">Team management</div>' +- '<h3>Control who can operate this account</h3>' +- '<p>Owners manage billing and access. Admins and techs keep the hosted fleet running day to day.</p>' +- '</div>' +- '<button type="button" class="btn-secondary btn-compact" data-action="toggle-team" data-account-id="' ++ if (account.kind === 'msp') {+ addWorkspaceForm =+ '<div class="add-workspace-form" id="add-ws-form-' ++ escapeAttr(account.id) ++ '">' ++ '<label for="ws-name-' +escapeAttr(account.id) +- '">Done</button>' ++ '">Workspace name (for example, a client name)</label>' ++ '<input type="text" id="ws-name-' ++ escapeAttr(account.id) ++ '" placeholder="Acme Corp" maxlength="80" autocomplete="off">' ++ '<div class="form-actions">' ++ '<button type="button" class="btn-primary" data-action="create-workspace" data-account-id="' ++ escapeAttr(account.id) ++ '">Create workspace</button>' ++ '<button type="button" class="btn-secondary" data-action="toggle-add-workspace" data-account-id="' ++ escapeAttr(account.id) ++ '">Cancel</button>' ++ '<div class="spinner" id="ws-spinner-' ++ escapeAttr(account.id) ++ '" hidden></div>' ++ '</div>' ++ '</div>';+ }+ }++ return (+ '<section class="account-content-panel account-content-panel-overview">' ++ '<div class="account-command-deck">' ++ '<div class="account-overview-card">' ++ '<div class="account-panel-kicker">Hosted posture</div>' ++ '<h3>' + escapeHTML(account.name) + '</h3>' ++ '<p>' + escapeHTML(summaryText) + '</p>' +'</div>' +- '<div class="team-management-stats" id="team-stats-' +- escapeAttr(account.id) +- '"></div>' +- '<div class="team-management-grid">' +- '<div class="team-roster">' +- '<div class="team-panel-heading">' +- '<h4>People on this account</h4>' +- '<p>Keep the roster small and role assignment explicit. The people listed here are the ones who can operate the hosted fleet.</p>' +- '</div>' +- '<table class="team-table">' +- '<thead><tr><th>Email</th><th>Role</th><th></th></tr></thead>' +- '<tbody id="team-list-' +- escapeAttr(account.id) +- '">' +- '<tr><td colspan="3" class="team-message-cell">Loading…</td></tr>' +- '</tbody>' +- '</table>' ++ '<div class="account-metric-strip">' ++ '<div class="account-stat-card account-stat-card-inline">' ++ '<span class="account-stat-label">Active workspaces</span>' ++ '<span class="account-stat-value">' + String(activeCount) + '</span>' +'</div>' +- '<div class="team-invite-panel">' +- '<div class="team-panel-heading">' +- '<h4>Invite someone new</h4>' +- '<p>Add another operator with the minimum role they need for this account.</p>' +- '</div>' +- '<div class="team-invite">' +- '<div><label for="invite-email-' +- escapeAttr(account.id) +- '">Email</label><input type="email" id="invite-email-' +- escapeAttr(account.id) +- '" placeholder="[email protected]" autocomplete="off"></div>' +- '<div><label for="invite-role-' +- escapeAttr(account.id) +- '">Role</label><select id="invite-role-' +- escapeAttr(account.id) +- '"><option value="admin">Admin</option><option value="tech">Tech</option><option value="read_only">Read-only</option></select></div>' +- '<button type="button" class="btn-primary btn-compact" data-action="invite-member" data-account-id="' +- escapeAttr(account.id) +- '">Invite</button>' +- '</div>' ++ '<div class="account-stat-card account-stat-card-inline">' ++ '<span class="account-stat-label">Healthy</span>' ++ '<span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span>' ++ '</div>' ++ '<div class="account-stat-card account-stat-card-inline">' ++ '<span class="account-stat-label">Checking</span>' ++ '<span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span>' ++ '</div>' ++ '<div class="account-stat-card account-stat-card-inline">' ++ '<span class="account-stat-label">Needs attention</span>' ++ '<span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + '</span>' +'</div>' +'</div>' +- '</section>';+ actions ++ addWorkspaceForm ++ '</div>' ++ '</section>'+ );+}+function renderAccountWorkspaceSection(account: PortalAccountSummary, accountAPIBasePath: string): string {+ var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];+ var workspaceManagement = '';+ if (account.can_manage) {workspaceManagement ='<section class="workspace-management-panel" id="workspace-management-' +escapeAttr(account.id) +@@ -367,30 +376,6 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:'</div>' +'</section>';- if (account.kind === 'msp') {- addWorkspaceForm =- '<div class="add-workspace-form" id="add-ws-form-' +- escapeAttr(account.id) +- '">' +- '<label for="ws-name-' +- escapeAttr(account.id) +- '">Workspace name (for example, a client name)</label>' +- '<input type="text" id="ws-name-' +- escapeAttr(account.id) +- '" placeholder="Acme Corp" maxlength="80" autocomplete="off">' +- '<div class="form-actions">' +- '<button type="button" class="btn-primary" data-action="create-workspace" data-account-id="' +- escapeAttr(account.id) +- '">Create workspace</button>' +- '<button type="button" class="btn-secondary" data-action="toggle-add-workspace" data-account-id="' +- escapeAttr(account.id) +- '">Cancel</button>' +- '<div class="spinner" id="ws-spinner-' +- escapeAttr(account.id) +- '" hidden></div>' +- '</div>' +- '</div>';- }}var workspaceHTML = workspaces.length@@ -400,59 +385,96 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:: '<div class="empty-state"><p>No hosted workspaces yet. Create one to get started.</p></div>';return (- '<section class="account-surface">' +- '<div class="account-surface-header">' +- '<div class="account-heading">' +- '<div class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</div>' +- '<h2>' + escapeHTML(account.name) + '</h2>' +- '<div class="account-summary">' + escapeHTML(summaryText) + '</div>' +- '</div>' +- '<div class="account-badges">' +- '<span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + '</span>' +- roleBadgeHTML(account.role) ++ '<section class="account-content-panel account-content-panel-workspaces">' ++ '<div class="account-stage-header">' ++ '<div>' ++ '<div class="account-panel-kicker">Workspace fleet</div>' ++ '<h3>Open hosted Pulse workspaces</h3>' ++ '<p>Review fleet health, move into a workspace, and keep lifecycle actions explicit.</p>' +'</div>' +'</div>' +- '<div class="account-surface-body">' +- '<div class="account-command-deck">' +- '<div class="account-overview-card">' +- '<div class="account-panel-kicker">Hosted posture</div>' +- '<h3>' + escapeHTML(account.name) + '</h3>' +- '<p>' + escapeHTML(summaryText) + '</p>' ++ workspaceHTML ++ '<div class="account-management-grid">' ++ workspaceManagement ++ '</div>' ++ '</section>'+ );+}++function renderAccountTeamSection(account: PortalAccountSummary): string {+ return (+ '<section class="account-content-panel account-content-panel-team">' ++ '<section class="team-management-panel team-section team-section-shell" id="team-section-' ++ escapeAttr(account.id) ++ '" data-actor-role="' ++ escapeAttr(account.role) ++ '">' ++ '<div class="team-management-header">' ++ '<div>' ++ '<div class="account-panel-kicker">Team management</div>' ++ '<h3>Control who can operate this account</h3>' ++ '<p>Owners manage billing and access. Admins and techs keep the hosted fleet running day to day.</p>' +'</div>' +- '<div class="account-metric-strip">' +- '<div class="account-stat-card account-stat-card-inline">' +- '<span class="account-stat-label">Active workspaces</span>' +- '<span class="account-stat-value">' + String(activeCount) + '</span>' ++ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Done</button>' ++ '</div>' ++ '<div class="team-management-stats" id="team-stats-' ++ escapeAttr(account.id) ++ '"></div>' ++ '<div class="team-management-grid">' ++ '<div class="team-roster">' ++ '<div class="team-panel-heading">' ++ '<h4>People on this account</h4>' ++ '<p>Keep the roster small and role assignment explicit. The people listed here are the ones who can operate the hosted fleet.</p>' +'</div>' +- '<div class="account-stat-card account-stat-card-inline">' +- '<span class="account-stat-label">Healthy</span>' +- '<span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span>' ++ '<div class="team-roster-list" id="team-list-' ++ escapeAttr(account.id) ++ '">' ++ '<div class="team-list-message">Loading…</div>' +'</div>' +- '<div class="account-stat-card account-stat-card-inline">' +- '<span class="account-stat-label">Checking</span>' +- '<span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span>' ++ '</div>' ++ '<div class="team-invite-panel">' ++ '<div class="team-panel-heading">' ++ '<h4>Invite someone new</h4>' ++ '<p>Add another operator with the minimum role they need for this account.</p>' +'</div>' +- '<div class="account-stat-card account-stat-card-inline">' +- '<span class="account-stat-label">Needs attention</span>' +- '<span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + '</span>' ++ '<div class="team-invite">' ++ '<div><label for="invite-email-' ++ escapeAttr(account.id) ++ '">Email</label><input type="email" id="invite-email-' ++ escapeAttr(account.id) ++ '" placeholder="[email protected]" autocomplete="off"></div>' ++ '<div><label for="invite-role-' ++ escapeAttr(account.id) ++ '">Role</label><select id="invite-role-' ++ escapeAttr(account.id) ++ '"><option value="admin">Admin</option><option value="tech">Tech</option><option value="read_only">Read-only</option></select></div>' ++ '<button type="button" class="btn-primary btn-compact" data-action="invite-member" data-account-id="' ++ escapeAttr(account.id) ++ '">Invite</button>' +'</div>' +'</div>' +- actions +- addWorkspaceForm +'</div>' +- '<div class="account-main-stage">' +- '<div class="account-stage-header">' +- '<div>' +- '<div class="account-panel-kicker">Workspace fleet</div>' +- '<h3>Open hosted Pulse workspaces</h3>' +- '<p>Review fleet health, move into a workspace, and keep lifecycle actions explicit.</p>' +- '</div>' +- '</div>' +- workspaceHTML +- '<div class="account-management-grid">' +- workspaceManagement +- teamSection +- '</div>' ++ '</section>' ++ '</section>'+ );+}++function renderSupportSection(context: ShellViewContext): string {+ return (+ '<section class="portal-support-panel">' ++ '<div class="account-panel-kicker">Support</div>' ++ '<h2>Get help without leaving Pulse Account</h2>' ++ '<p>Use support when hosted access looks wrong, billing does not behave as expected, or you need help with commercial licensing and privacy actions.</p>' ++ '<div class="portal-support-card-grid">' ++ '<div class="portal-support-card">' ++ '<h3>Account support</h3>' ++ '<p>For access, tenant handoff, team, and billing issues, contact the hosted operations desk.</p>' ++ '<a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || '') + '">' + escapeHTML(context.bootstrap.support_email || '') + '</a>' ++ '</div>' ++ '<div class="portal-support-card">' ++ '<h3>Commercial services</h3>' ++ '<p>Self-hosted subscriptions, license recovery, refunds, and privacy requests all route through the same account surface.</p>' ++ '<button type="button" class="btn-secondary" data-shell-action="activate-section" data-shell-section="services">Open account services</button>' +'</div>' +'</div>' +'</section>'@@ -487,77 +509,107 @@ export function renderAccountsHTML(context: ShellViewContext): string {);}return safeAccounts.map(function(account) {- return renderAccountSection(account, context.accountAPIBasePath);+ return renderAccountOverviewSection(account);}).join('');}export function renderAuthenticatedPortalHTML(context: ShellViewContext): string {var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];var hosted = hasHostedAccounts(accounts);+ var activeSection = context.activeSection || 'overview';var serviceHeading = hosted ? 'Self-hosted licenses and billing' : 'Account services';var serviceNote = hosted? 'Hosted operations live above. Use these commercial tools for self-hosted licenses, billing, refunds, and privacy actions.': 'Use these account tools for self-hosted licenses, billing, refunds, and privacy actions.';-- return (- '<div class="portal-shell">' +- renderOverviewBand(accounts) +- renderShellNavigation(accounts, context.bootstrap.support_email || '') +- '<section class="portal-top-section" id="hosted-operations-section">' +- '<div class="portal-top-section-header">' +- '<div class="account-panel-kicker">' + (hosted ? 'Hosted operations' : 'Hosted access') + '</div>' +- '<h2>' + (hosted ? 'Run hosted accounts from one place' : 'No hosted workspaces are attached yet') + '</h2>' +- '<p>' + (hosted- ? 'Use this area for workspace access, fleet operations, hosted billing, and team management.'- : 'This account does not currently have hosted workspace access. If that is unexpected, contact support while using the commercial tools below.') + '</p>' +- '</div>' +- '<div id="accounts-root">' + renderAccountsHTML(context) + '</div>' +- '</section>' +- '<section class="service-section" id="account-services-section">' +- '<div class="service-header">' +- '<div>' +- '<div class="account-panel-kicker">Account services</div>' +- '<h2>' + serviceHeading + '</h2>' ++ var hostedContent = accounts.map(function(account) {+ return (+ '<section class="account-surface">' ++ '<div class="account-surface-header">' ++ '<div class="account-heading">' ++ '<div class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</div>' ++ '<h2>' + escapeHTML(account.name) + '</h2>' ++ '<div class="account-summary">' + escapeHTML(accountKindLabel(account) + ' · ' + titleCase(account.role) + ' · ' + workspaceCountLabel((account.workspaces || []).length)) + '</div>' ++ '</div>' ++ '<div class="account-badges">' ++ '<span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + '</span>' ++ roleBadgeHTML(account.role) +'</div>' +- '<div class="service-note">' + serviceNote + '</div>' +'</div>' +- '<div class="service-grid">' +- '<button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email">' +- '<span class="service-card-kicker">Billing</span>' +- '<h3>Manage subscriptions</h3>' +- '<p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p>' +- '</button>' +- '<button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email">' +- '<span class="service-card-kicker">Licenses</span>' +- '<h3>Retrieve licenses</h3>' +- '<p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p>' +- '</button>' +- '<button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email">' +- '<span class="service-card-kicker">Refunds</span>' +- '<h3>Refund requests</h3>' +- '<p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p>' +- '</button>' +- '<button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email">' +- '<span class="service-card-kicker">Privacy</span>' +- '<h3>Data and privacy</h3>' +- '<p>Request commercial data export or deletion without leaving the account shell.</p>' +- '</button>' ++ '<div class="account-surface-body">' ++ renderAccountOverviewSection(account) ++ renderAccountWorkspaceSection(account, context.accountAPIBasePath) ++ renderAccountTeamSection(account) +'</div>' +- '<div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div>' +- '<div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div>' +- '<div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div>' +- '<div class="service-panel" id="data-service-panel">' +- '<h3>Data and privacy</h3>' +- '<p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p>' +- '<div class="subsection"><div id="data-export-root"></div></div>' +- '<div class="subsection"><div id="data-delete-root"></div></div>' +- '<div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' +- escapeAttr(context.bootstrap.support_email || '') +- '">' +- escapeHTML(context.bootstrap.support_email || '') +- '</a>.</div>' ++ '</section>'+ );+ }).join('');++ return (+ '<div class="portal-shell" data-shell-section="' + activeSection + '">' ++ renderOverviewBand(accounts) ++ '<div class="portal-shell-layout">' ++ renderShellNavigation(accounts, context.bootstrap.support_email || '', activeSection) ++ '<div class="portal-shell-main">' ++ '<section class="portal-content-panel portal-content-panel-overview">' ++ '<div class="portal-top-section-header">' ++ '<div class="account-panel-kicker">' + (hosted ? 'Hosted operations' : 'Hosted access') + '</div>' ++ '<h2>' + (hosted ? 'Run hosted accounts from one place' : 'No hosted workspaces are attached yet') + '</h2>' ++ '<p>' + (hosted+ ? 'Use this area for workspace access, fleet operations, hosted billing, and team management.'+ : 'This account does not currently have hosted workspace access. If that is unexpected, contact support while using the commercial tools below.') + '</p>' ++ '</div>' ++ '<div id="accounts-root">' + hostedContent + '</div>' ++ '</section>' ++ '<section class="portal-content-panel portal-content-panel-services service-section" id="account-services-section">' ++ '<div class="service-header">' ++ '<div>' ++ '<div class="account-panel-kicker">Account services</div>' ++ '<h2>' + serviceHeading + '</h2>' ++ '</div>' ++ '<div class="service-note">' + serviceNote + '</div>' ++ '</div>' ++ '<div class="service-grid">' ++ '<button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email" data-shell-target="services">' ++ '<span class="service-card-kicker">Billing</span>' ++ '<h3>Manage subscriptions</h3>' ++ '<p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p>' ++ '</button>' ++ '<button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email" data-shell-target="services">' ++ '<span class="service-card-kicker">Licenses</span>' ++ '<h3>Retrieve licenses</h3>' ++ '<p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p>' ++ '</button>' ++ '<button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email" data-shell-target="services">' ++ '<span class="service-card-kicker">Refunds</span>' ++ '<h3>Refund requests</h3>' ++ '<p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p>' ++ '</button>' ++ '<button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email" data-shell-target="services">' ++ '<span class="service-card-kicker">Privacy</span>' ++ '<h3>Data and privacy</h3>' ++ '<p>Request commercial data export or deletion without leaving the account shell.</p>' ++ '</button>' ++ '</div>' ++ '<div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div>' ++ '<div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div>' ++ '<div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div>' ++ '<div class="service-panel" id="data-service-panel">' ++ '<h3>Data and privacy</h3>' ++ '<p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p>' ++ '<div class="subsection"><div id="data-export-root"></div></div>' ++ '<div class="subsection"><div id="data-delete-root"></div></div>' ++ '<div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' ++ escapeAttr(context.bootstrap.support_email || '') ++ '">' ++ escapeHTML(context.bootstrap.support_email || '') ++ '</a>.</div>' ++ '</div>' ++ '</section>' ++ '<section class="portal-content-panel portal-content-panel-support">' ++ renderSupportSection(context) ++ '</section>' +'</div>' +- '</section>' ++ '</div>' +'</div>');}diff --git a/internal/cloudcp/portal/frontend/src/state.ts b/internal/cloudcp/portal/frontend/src/state.tsindex 4036adc5a0..8f6d8fe0f8 100644--- a/internal/cloudcp/portal/frontend/src/state.ts+++ b/internal/cloudcp/portal/frontend/src/state.ts@@ -3,6 +3,7 @@ import type {PortalAccountState,PortalAccountUIEntry,PortalLoginState,+ PortalShellState,PortalServiceFlowID,PortalServiceState,PortalQueryState,@@ -49,6 +50,12 @@ export function createPortalAccountState(): PortalAccountState {};}+export function createPortalShellState(): PortalShellState {+ return {+ activeSection: 'overview',+ };+}+export function createMutationState(): PortalMutationState {return {pending: false,diff --git a/internal/cloudcp/portal/frontend/src/store.ts b/internal/cloudcp/portal/frontend/src/store.tsindex 71cb18b095..4a530a845b 100644--- a/internal/cloudcp/portal/frontend/src/store.ts+++ b/internal/cloudcp/portal/frontend/src/store.ts@@ -1,11 +1,12 @@import {createPortalAccountState,createPortalLoginState,+ createPortalShellState,createPortalServiceState,syncLoginStateBootstrapEmail,syncServiceStateBootstrapEmail,} from './state';-import type { PortalAccountState, PortalBootstrapData, PortalLoginState, PortalServiceState } from './types';+import type { PortalAccountState, PortalBootstrapData, PortalLoginState, PortalServiceState, PortalShellSection, PortalShellState } from './types';interface MutationOptions {notify?: boolean;@@ -15,14 +16,17 @@ export interface PortalStore {getBootstrap(): PortalBootstrapData;getAccountState(): PortalAccountState;getLoginState(): PortalLoginState;+ getShellState(): PortalShellState;getServiceState(): PortalServiceState;setBootstrap(nextBootstrap: Partial<PortalBootstrapData> | PortalBootstrapData): PortalBootstrapData;updateAccountState(mutator: (state: PortalAccountState) => void, options?: MutationOptions): PortalAccountState;updateLoginState(mutator: (state: PortalLoginState) => void, options?: MutationOptions): PortalLoginState;+ setActiveShellSection(section: PortalShellSection): PortalShellState;updateServiceState(mutator: (state: PortalServiceState) => void, options?: MutationOptions): PortalServiceState;subscribeAccount(listener: () => void): () => void;subscribeBootstrap(listener: () => void): () => void;subscribeLogin(listener: () => void): () => void;+ subscribeShell(listener: () => void): () => void;subscribeServices(listener: () => void): () => void;}@@ -53,12 +57,14 @@ export function createPortalStore(var bootstrapState = normalizeBootstrap(bootstrapDefaults, initialBootstrap);var accountState = createPortalAccountState();var loginState = createPortalLoginState();+ var shellState = createPortalShellState();var serviceState = createPortalServiceState();syncLoginStateBootstrapEmail(loginState, bootstrapState.email || '');syncServiceStateBootstrapEmail(serviceState, bootstrapState.email || '');var accountSubscribers = new Set<() => void>();var bootstrapSubscribers = new Set<() => void>();var loginSubscribers = new Set<() => void>();+ var shellSubscribers = new Set<() => void>();var serviceSubscribers = new Set<() => void>();function notify(subscribers: Set<() => void>) {@@ -77,6 +83,9 @@ export function createPortalStore(getLoginState: function() {return loginState;},+ getShellState: function() {+ return shellState;+ },getServiceState: function() {return serviceState;},@@ -101,6 +110,11 @@ export function createPortalStore(}return loginState;},+ setActiveShellSection: function(section) {+ shellState.activeSection = section;+ notify(shellSubscribers);+ return shellState;+ },updateServiceState: function(mutator, options) {mutator(serviceState);if (!options || options.notify !== false) {@@ -126,6 +140,12 @@ export function createPortalStore(loginSubscribers.delete(listener);};},+ subscribeShell: function(listener) {+ shellSubscribers.add(listener);+ return function() {+ shellSubscribers.delete(listener);+ };+ },subscribeServices: function(listener) {serviceSubscribers.add(listener);return function() {diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.cssindex 2d209fef7d..13e73e011f 100644--- a/internal/cloudcp/portal/frontend/src/styles.css+++ b/internal/cloudcp/portal/frontend/src/styles.css@@ -253,42 +253,98 @@ header .logout-btn:hover,box-shadow: var(--shadow-sm);}-.portal-command-strip {+.portal-shell-layout {display: grid;- grid-template-columns: repeat(3, minmax(0, 1fr));- gap: 0;+ grid-template-columns: 248px minmax(0, 1fr);+ gap: 24px;+ align-items: start;+}++.portal-shell-nav {+ position: sticky;+ top: 88px;+ border: 1px solid var(--line);border-radius: var(--radius-md);+ background: rgba(255, 255, 255, 0.98);+ box-shadow: var(--shadow-sm);+ overflow: hidden;}-.portal-command-link {- display: block;- padding: 16px 18px;- text-decoration: none;- transition: background 140ms ease;+.portal-shell-nav-group {+ display: flex;+ flex-direction: column;}-.portal-command-link + .portal-command-link {- border-left: 1px solid var(--line);+.portal-shell-nav-link {+ display: flex;+ flex-direction: column;+ gap: 6px;+ width: 100%;+ padding: 15px 16px;+ border: none;+ border-bottom: 1px solid var(--line);+ background: transparent;+ text-align: left;+ cursor: pointer;+ transition: background 140ms ease, color 140ms ease;}-.portal-command-link:hover {+.portal-shell-nav-link:last-child {+ border-bottom: none;+}++.portal-shell-nav-link:hover {background: #f7fafc;}-.portal-command-label {+.portal-shell-nav-link.active {+ background: #eef6f7;+}++.portal-shell-nav-label {display: block;font-size: 14px;font-weight: 700;- margin-bottom: 5px;}-.portal-command-copy {+.portal-shell-nav-copy {display: block;- font-size: 13px;- line-height: 1.5;+ font-size: 12px;+ line-height: 1.45;color: var(--ink-soft);}+.portal-shell-main {+ min-width: 0;+}++.portal-shell-main > .portal-content-panel {+ display: none !important;+}++.portal-shell[data-shell-section="overview"] .portal-content-panel-overview,+.portal-shell[data-shell-section="services"] .portal-content-panel-services,+.portal-shell[data-shell-section="support"] .portal-content-panel-support,+.portal-shell[data-shell-section="workspaces"] .portal-content-panel-overview,+.portal-shell[data-shell-section="team"] .portal-content-panel-overview {+ display: block !important;+}++.portal-shell[data-shell-section="overview"] .account-content-panel-overview,+.portal-shell[data-shell-section="workspaces"] .account-content-panel-workspaces,+.portal-shell[data-shell-section="team"] .account-content-panel-team {+ display: block !important;+}++.portal-shell[data-shell-section="overview"] .account-content-panel-workspaces,+.portal-shell[data-shell-section="overview"] .account-content-panel-team,+.portal-shell[data-shell-section="workspaces"] .account-content-panel-overview,+.portal-shell[data-shell-section="workspaces"] .account-content-panel-team,+.portal-shell[data-shell-section="team"] .account-content-panel-overview,+.portal-shell[data-shell-section="team"] .account-content-panel-workspaces {+ display: none !important;+}+.portal-support-link,.support-link,.service-panel .helper-text a {@@ -296,10 +352,6 @@ header .logout-btn:hover,font-weight: 600;}-.portal-command-link-support {- text-align: right;-}-.portal-stage {display: flex;flex-direction: column;@@ -388,6 +440,10 @@ header .logout-btn:hover,margin-top: 22px;}+.account-content-panel {+ display: block;+}+.account-command-deck,.account-overview-card,.account-stat-card,@@ -516,6 +572,56 @@ header .logout-btn:hover,gap: 16px;}+.portal-support-panel {+ border: 1px solid var(--line);+ border-radius: var(--radius-lg);+ padding: 26px;+ background: rgba(255, 255, 255, 0.98);+ box-shadow: var(--shadow-sm);+}++.portal-support-panel h2 {+ margin: 8px 0 0;+ font-size: clamp(1.8rem, 2.4vw, 2.5rem);+ line-height: 1.02;+ letter-spacing: -0.05em;+}++.portal-support-panel > p {+ margin: 12px 0 0;+ max-width: 760px;+ font-size: 15px;+ line-height: 1.7;+ color: var(--ink-soft);+}++.portal-support-card-grid {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 14px;+ margin-top: 20px;+}++.portal-support-card {+ padding: 18px;+ border: 1px solid var(--line);+ border-radius: var(--radius-md);+ background: var(--panel-muted);+}++.portal-support-card h3 {+ margin: 0;+ font-size: 18px;+ letter-spacing: -0.02em;+}++.portal-support-card p {+ margin: 10px 0 14px;+ font-size: 14px;+ line-height: 1.65;+ color: var(--ink-soft);+}+.account-stage-header {padding: 2px 4px 0;}@@ -748,34 +854,77 @@ header .logout-btn:hover,margin-bottom: 12px;}-.team-table {- width: 100%;- border-collapse: collapse;+.team-roster-list {+ display: flex;+ flex-direction: column;+ gap: 10px;}-.team-table th {- padding: 10px 8px;- text-align: left;- font-size: 11px;- font-weight: 800;- letter-spacing: 0.12em;- text-transform: uppercase;- color: var(--ink-muted);- border-bottom: 1px solid var(--line);+.team-member-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 16px;+ padding: 14px 16px;+ border: 1px solid var(--line);+ border-radius: 10px;+ background: var(--panel-muted);}-.team-table td {- padding: 12px 8px;- border-bottom: 1px solid var(--line);- vertical-align: middle;+.team-member-identity {+ display: flex;+ flex-direction: column;+ gap: 4px;+ min-width: 0;+}++.team-member-email {+ font-size: 14px;+ font-weight: 700;+ color: var(--ink);}-.team-message-cell {- text-align: center;+.team-member-caption {+ font-size: 12px;+ color: var(--ink-soft);+}++.team-member-controls {+ display: flex;+ align-items: center;+ gap: 10px;+ flex-wrap: wrap;+}++.team-role-badge {+ display: inline-flex;+ align-items: center;+ min-height: 36px;+ padding: 0 12px;+ border-radius: 999px;+ background: #edf3ff;+ color: #35507a;+ font-size: 12px;+ font-weight: 700;+}++.team-role-select {+ min-width: 140px;+}++.team-list-message {+ display: flex;+ align-items: center;+ justify-content: center;+ min-height: 120px;+ padding: 16px;+ border: 1px dashed var(--line-strong);+ border-radius: 10px;color: var(--ink-muted);+ background: var(--panel-muted);}-.team-message-cell.error {+.team-list-message.error {color: var(--danger);}@@ -1008,7 +1157,7 @@ header .logout-btn:hover,grid-template-columns: 1fr;}- .portal-command-strip,+ .portal-shell-layout,.account-command-deck {grid-template-columns: 1fr;}@@ -1017,6 +1166,10 @@ header .logout-btn:hover,grid-template-columns: repeat(2, minmax(0, 1fr));}+ .portal-shell-nav {+ position: static;+ }+.workspace-management-content {grid-template-columns: 1fr;}@@ -1054,7 +1207,9 @@ header .logout-btn:hover,padding: 18px 16px 40px;}- .portal-command-strip {+ .portal-shell-layout,+ .portal-support-card-grid,+ .portal-shell-nav-group {grid-template-columns: 1fr;}@@ -1073,15 +1228,6 @@ header .logout-btn:hover,align-items: flex-start;}- .portal-command-link + .portal-command-link {- border-left: none;- border-top: 1px solid var(--line);- }-- .portal-command-link-support {- text-align: left;- }-.account-action-strip {flex-direction: column;align-items: stretch;@@ -1094,6 +1240,12 @@ header .logout-btn:hover,width: 100%;}+ .team-member-row,+ .team-member-controls {+ flex-direction: column;+ align-items: stretch;+ }+.workspace-row-status-grid {grid-template-columns: 1fr;}diff --git a/internal/cloudcp/portal/frontend/src/types.ts b/internal/cloudcp/portal/frontend/src/types.tsindex 8bac4f6ad2..20118ff9d9 100644--- a/internal/cloudcp/portal/frontend/src/types.ts+++ b/internal/cloudcp/portal/frontend/src/types.ts@@ -74,6 +74,12 @@ export interface PortalAccountState {byAccountID: Record<string, PortalAccountUIEntry>;}+export type PortalShellSection = 'overview' | 'workspaces' | 'team' | 'services' | 'support';++export interface PortalShellState {+ activeSection: PortalShellSection;+}+export type PortalServiceFlowID = 'manage' | 'retrieve' | 'export' | 'delete';export interface ServiceStatus {