Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

Redesign portal as a simpler account surface

rcourtman41a031098cc8
diff --git a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
index b6918cd280..6fdffcd9e2 100644
--- a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
+++ b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
@@ -170,10 +170,11 @@ Core rules:
with the primary jobs a user came to do.
16. The signed-in `Overview` must be one shell-level triage surface across the
current account set, not a repeated per-account dashboard.
-17. When `Workspaces` or `Access` are unavailable, the tab must show an
- explicit unavailable state that points to the right live task instead of
- rendering blank space. The shell navigation must stay honest too: it must
- not badge or describe unavailable hosted tasks as though they are live.
+17. Top-level navigation must stay honest to account shape. Hosted-only tasks
+ that are irrelevant to the current account should be removed from the
+ primary task row instead of rendered as fake live tabs, and any shared
+ fallback surface that still resolves there must render an explicit
+ unavailable state rather than blank space.
18. `Access` must stay action-first: roster, invite, role change, and remove
access are the job; view-only users may review the roster but must never
see live controls that imply they can mutate it. The view-only roster must
@@ -283,6 +284,12 @@ Core rules:
only accounts should land in `Billing`. `Overview` remains available as a
precise triage surface, but it must not be the default first impression
for authenticated users.
+43. The signed-in shell must orient the user with one quiet account-context
+ header and one flat top task row. It must not add a second summary box,
+ sidebar shell, or badge-heavy frame that competes with the active task.
+44. Idle hosted `Access` must stay a plain review roster. The third action
+ column should appear only for the active remove-access job; default and
+ role-change states should stay focused on operator identity plus role.
## Screen Model
@@ -311,8 +318,8 @@ Each signed-in state should render:
The overview band remains available from navigation, but authenticated
users should open on the first live task for the current account shape
rather than landing here by default.
-2. account cards with role, account kind, workspace totals, and account-level
- fleet status
+2. one quiet account-context header with account kind, role, current account
+ title, and one short orienting sentence
3. an explicit `Workspaces` area for open, create, and lifecycle actions
4. an explicit `Access` area for roster, invites, role changes, and removals
`Access` copy should stay terse and task-led; the section exists to do the
@@ -330,14 +337,14 @@ Each signed-in state should render:
routes in review-plus-owner/admin-handoff language rather than implying live
mutation authority.
7. explicit action groups, not anonymous menu affordances
-8. explicit unavailable-state panels for top-level tasks that are not active
- for the current account shape
+8. explicit unavailable-state panels only where shared shell logic can still
+ resolve a task that is not live for the current account shape
9. a compact narrow-screen task switcher that preserves task-first navigation
without letting navigation chrome dominate the page before the active task,
while keeping the active task visibly in-frame when the strip scrolls
-10. a compact narrow-screen account context strip that keeps account identity,
- role, workspace count, and billing state visible without pushing the live
- task below the fold
+10. a compact narrow-screen account context strip that keeps account identity
+ and role visible without adding a second summary deck ahead of the live
+ task
## Product-Specific Boundaries
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 0e20c1771a..ce0996c576 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -329,8 +329,10 @@ in shell section from account shape: hosted accounts open on `Workspaces`,
self-hosted-only accounts open on `Billing`, and `Overview` remains available
as triage instead of acting as the default authenticated landing layer.
The same account-shape runtime contract must also keep the shell navigation
-honest: unavailable hosted `Workspaces` or `Access` tasks must read as
-unavailable in the nav itself rather than implying live hosted work. `Support` follows the same
+honest: self-hosted-only accounts must drop hosted-only `Workspaces`,
+`Access`, and `Overview` tabs from the primary task row rather than implying
+live hosted work, and any shared fallback surface that still resolves there
+must render an explicit unavailable state. `Support` follows the same
account-shape runtime contract: self-hosted-only accounts expose only the
billing escalation path and billing-specific handoff packet, and hosted
workspace/access escalation controls must not render when no hosted account
@@ -340,6 +342,10 @@ honest for hosted view-only roles: when `can_manage` is false, `Workspaces`,
`Access`, and hosted `Billing` must stop advertising create, roster-mutation,
or hosted-billing actions and must instead state that an owner or admin is
required.
+That same typed shell contract must also keep account context quiet and
+literal: the signed-in shell should render one account-context header with the
+current account title, kind, role, and short orienting copy, not a second
+summary deck competing with the active task surface.
The same permission contract must also drive hosted `Support`: when
`can_manage` is false, the support shell may route the user back to
`Workspaces`, `Access`, or `Billing` only as review and owner/admin handoff
@@ -385,6 +391,11 @@ action or state (`Manage access`, `Hosted billing attached`, `Email support`,
generic alert labels. Support copy is part of the same typed contract:
escalation surfaces must render short literal path/account/action wording
instead of longer procedural prose.
+That same typed `Access` contract must also keep the idle managed roster
+structurally honest: when no remove job is active, the roster remains a
+two-column review surface for operator and role. The third action column
+appears only for the live remove-access job instead of repeating fake idle row
+state.
That same typed portal page contract also owns favicon cache-busting: the
rendered `<link rel="icon">` must point at the shared `/favicon.svg` asset
through a versioned href so new portal icon revisions bypass browser cache on
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 5fedeee67d..79c1049b52 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -870,19 +870,20 @@ authenticated Pulse account shell that unifies Cloud tenants, self-hosted
licenses, billing, recovery, and MSP admin surfaces without creating a
standalone Relay portal. That shell now also owns two product rules
explicitly: `Overview` is one shell-level triage surface across the current
-account set rather than a repeated per-account dashboard, and unavailable
-top-level `Workspaces` or `Access` tasks must render an explicit unavailable
-state instead of blank space. The shell navigation must stay honest to that
-same account shape rather than labelling unavailable hosted tasks as though
-they are still live. The same shell also owns action-first task
+account set rather than a repeated per-account dashboard, and the top-level
+task row must stay honest to account shape by removing irrelevant hosted-only
+tasks instead of pretending they are live. Any shared fallback that still
+lands on a non-live task must render an explicit unavailable state instead of
+blank space. The same shell also owns action-first task
surfaces for `Access`, `Billing`, and `Support`: access mutations must be
permission-honest and roster-led, billing must reduce to one obvious job at a
time with hosted billing first when relevant, support must stay a failed-path
handoff rather than a peer workflow, and phone-width layouts must collapse the
-desktop task sidebar into a compact task strip so the active job remains
+desktop shell into a compact task strip so the active job remains
primary and visibly in-frame when the strip scrolls. The same narrow-screen
-shell must also compress account identity into a compact summary strip instead
-of repeating a desktop-sized intro block ahead of every task, and lower
+shell must also compress account identity into one compact context strip
+instead of repeating a desktop-sized intro block or second summary box ahead
+of every task, and lower
workspace job surfaces such as lifecycle review or create-workspace forms must
be revealed when the user opens them. `Workspaces` must also default to the
workspace list plus the real task entry points rather than an idle lifecycle
@@ -891,7 +892,10 @@ create-workspace job is active. `Access` follows the same rule: the hosted
roster must be the default state, while invite, role-change, and remove
controls appear only when that exact access job is active, and a hosted
view-only roster must stay a review surface instead of a row-by-row action
-table with fake disabled action state. That same task-first `Access` contract
+table with fake disabled action state. Managed idle `Access` follows that same
+review-first rule: the roster should stay two-column until a remove job is
+active, with the third action column reserved for real remove access work.
+That same task-first `Access` contract
must also start from bootstrap-owned roster truth: the first hosted roster
render must come from the portal bootstrap payload itself, with later member
API reads reserved for refresh and mutation follow-through instead of
@@ -909,8 +913,10 @@ That same owned shell also owns the signed-in visual posture: the portal
should read like a serious settings/account tool rather than a dashboard.
Navigation chrome, account framing, and overview panels must stay visually
quieter than the active task surface, with flatter light treatment and
-list-first task presentation instead of dark ornamental rails or nested
-explanatory cards.
+list-first task presentation instead of dark ornamental rails, sidebars, or
+nested explanatory cards. The signed-in shell should orient the user with one
+quiet account-context header and one flat top task row, not a second summary
+deck competing with the task itself.
That same owned shell must also open on the first live job instead of the
summary layer: hosted accounts should land in `Workspaces`, and self-hosted-
only accounts should land in `Billing`. `Overview` remains part of the shell,
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index 6f05cf3af1..f3ccd03143 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "ce6e280f3787d7661ec4b3c30bb7997ff7a0df50d8dac23eeb0d44dcd7daf574",
+ "source_hash": "9f9d5468a58d29a9e38839b7c671e9b48a2cbedb21919ebe32e2a44256a030aa",
"build_inputs": [
"package.json",
"tsconfig.json",
diff --git a/internal/cloudcp/portal/dist/portal_app.css b/internal/cloudcp/portal/dist/portal_app.css
index 5ef5e4e708..a315acca36 100644
--- a/internal/cloudcp/portal/dist/portal_app.css
+++ b/internal/cloudcp/portal/dist/portal_app.css
@@ -4100,3 +4100,277 @@ header .logout-btn,
justify-content: center;
}
}
+.portal-shell-main {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ padding: 0 0 32px;
+}
+.portal-shell-main > .portal-content-panel {
+ display: none !important;
+}
+.portal-shell[data-shell-section=workspaces] .portal-content-panel-workspaces,
+.portal-shell[data-shell-section=access] .portal-content-panel-access,
+.portal-shell[data-shell-section=billing] .portal-content-panel-billing,
+.portal-shell[data-shell-section=support] .portal-content-panel-support,
+.portal-shell[data-shell-section=overview] .portal-content-panel-overview {
+ display: block !important;
+}
+.portal-account-context {
+ display: block;
+ padding: 0 0 12px;
+ border: none;
+ border-bottom: 1px solid var(--line);
+ border-radius: 0;
+ background: transparent;
+}
+.portal-account-context-copy {
+ gap: 6px;
+}
+.portal-account-context-meta {
+ gap: 8px;
+ flex-wrap: wrap;
+}
+.portal-account-context-separator {
+ color: var(--line-strong);
+}
+.portal-account-context-row-title h2 {
+ font-size: 30px;
+ line-height: 1.04;
+ letter-spacing: -0.04em;
+}
+.portal-account-context-copy p {
+ max-width: 820px;
+ font-size: 15px;
+ line-height: 1.55;
+}
+.portal-account-context-summary {
+ display: none !important;
+}
+.portal-shell-nav {
+ position: static;
+ top: auto;
+ border: none;
+ border-bottom: 1px solid var(--line);
+ background: transparent;
+}
+.portal-shell-nav-header {
+ display: none !important;
+}
+.portal-shell-nav-group {
+ display: flex;
+ flex-direction: row;
+ gap: 12px;
+ padding: 0 0 4px;
+ overflow-x: auto;
+ overscroll-behavior-x: contain;
+ scrollbar-width: none;
+}
+.portal-shell-nav-group::-webkit-scrollbar {
+ display: none;
+}
+.portal-shell-nav-link {
+ min-width: 0;
+ padding: 0 8px 10px;
+ border: none;
+ border-bottom: 2px solid transparent;
+ border-radius: 0;
+ background: transparent;
+ color: var(--ink-muted);
+}
+.portal-shell-nav-link:hover {
+ background: transparent;
+ color: var(--ink);
+}
+.portal-shell-nav-link.active {
+ border: none;
+ border-bottom: 2px solid var(--accent);
+ background: transparent;
+ color: var(--ink);
+}
+.portal-shell-nav-row {
+ justify-content: flex-start;
+ gap: 0;
+}
+.portal-shell-nav-label {
+ font-size: 14px;
+ font-weight: 600;
+}
+.portal-shell-nav-badge {
+ display: none !important;
+}
+.portal-content-panel,
+.account-content-panel,
+.account-content-panel-overview,
+.account-content-panel-workspaces,
+.account-content-panel-access,
+.portal-support-panel {
+ padding: 0;
+ border: none;
+ background: transparent;
+ box-shadow: none;
+}
+.account-surface + .account-surface {
+ margin-top: 24px;
+}
+.account-stage-header,
+.billing-header {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 12px;
+ margin-bottom: 18px;
+}
+.account-stage-header h3,
+.billing-header h2,
+.portal-support-panel h2 {
+ font-size: 24px;
+ line-height: 1.12;
+ letter-spacing: -0.03em;
+}
+.account-stage-header p,
+.billing-header p,
+.billing-note,
+.portal-support-panel > p {
+ max-width: 760px;
+ font-size: 14px;
+ line-height: 1.55;
+}
+.section-context-strip {
+ gap: 0;
+ margin-top: 8px;
+}
+.section-context-chip {
+ font-size: 12px;
+}
+.section-context-chip + .section-context-chip::before {
+ margin-right: 8px;
+}
+.overview-task-grid {
+ grid-template-columns: 1fr;
+ gap: 12px;
+}
+.overview-task-card,
+.billing-task-card,
+.portal-support-route-card,
+.portal-support-runbook,
+.workspace-list-wrap,
+.workspace-management-panel,
+.access-roster,
+.access-task-panel,
+.access-invite-panel,
+.access-job-note-panel,
+.access-policy-panel,
+.billing-shell-main,
+.billing-shell-detail,
+.billing-panel {
+ border: 1px solid var(--line);
+ border-radius: 12px;
+ background: #fff;
+}
+.overview-task-card,
+.billing-task-card,
+.portal-support-route-card,
+.portal-support-runbook,
+.billing-shell-main,
+.billing-shell-detail,
+.billing-panel {
+ padding: 18px;
+}
+.workspace-operations-shell,
+.access-shell,
+.billing-shell,
+.portal-support-layout {
+ grid-template-columns: 1fr;
+ gap: 14px;
+}
+.workspace-list-toolbar,
+.access-panel-heading {
+ padding: 16px 18px 10px;
+}
+.workspace-list-head {
+ grid-template-columns: minmax(0, 1.6fr) 120px 120px 160px;
+ gap: 12px;
+ padding: 8px 18px;
+}
+.workspace-row {
+ grid-template-columns: minmax(0, 1.6fr) 120px 120px 160px;
+ gap: 12px;
+ padding: 14px 18px;
+}
+.workspace-actions {
+ flex-wrap: wrap;
+}
+.access-management-stats {
+ display: block;
+ margin-bottom: 12px;
+}
+.access-stat-summary {
+ padding: 0 0 8px;
+ font-size: 12px;
+ font-weight: 500;
+ color: var(--ink-muted);
+}
+.access-stat-summary-error {
+ color: var(--danger);
+}
+.access-task-strip {
+ gap: 6px;
+ margin-top: 10px;
+}
+.access-task-button {
+ border-radius: 10px;
+}
+.access-task-button.active {
+ border-color: var(--accent);
+}
+.access-roster-list {
+ padding: 0 18px 8px;
+}
+.access-roster-head {
+ padding: 8px 18px;
+}
+.access-member-row {
+ padding: 12px 0;
+}
+.billing-overview-grid {
+ grid-template-columns: 1fr;
+ gap: 12px;
+}
+.billing-note {
+ padding: 0;
+ border: none;
+}
+.billing-action-row {
+ padding: 14px 0;
+}
+.portal-support-route-grid {
+ gap: 12px;
+}
+@media (max-width: 960px) {
+ .portal-shell-main {
+ gap: 16px;
+ }
+ .portal-shell-nav-group {
+ gap: 8px;
+ }
+ .portal-account-context {
+ padding-bottom: 10px;
+ }
+ .portal-account-context-row-title h2,
+ .account-stage-header h3,
+ .billing-header h2,
+ .portal-support-panel h2 {
+ font-size: 22px;
+ }
+}
+@media (max-width: 640px) {
+ .portal-shell-nav-link {
+ padding: 0 6px 8px;
+ }
+ .portal-account-context-row-title h2 {
+ font-size: 24px;
+ }
+ .access-management-stats {
+ grid-template-columns: 1fr;
+ }
+}
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 9a354c4e30..3f36eb6f36 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -208,6 +208,9 @@
}
return count;
}
+ function renderAccessStatsSummary(summary, isError) {
+ return '<div class="access-stat-summary' + (isError ? " access-stat-summary-error" : "") + '">' + summary + "</div>";
+ }
function accessJobTitle(job) {
switch (job) {
case "invite":
@@ -240,15 +243,18 @@
return;
}
if (entry.accessQuery.status === "loading") {
- stats.innerHTML = '<div class="access-stat-card"><span class="access-stat-label">Roster</span><span class="access-stat-value">Loading\u2026</span></div><div class="access-stat-card"><span class="access-stat-label">Access</span><span class="access-stat-value">' + (canManage ? "Manage access" : "View roster") + "</span></div>";
+ stats.innerHTML = renderAccessStatsSummary("Access \u2022 " + (canManage ? "Manage access" : "View roster") + " \u2022 Loading roster", false);
return;
}
if (entry.accessQuery.status === "error") {
- stats.innerHTML = '<div class="access-stat-card"><span class="access-stat-label">Roster</span><span class="access-stat-value access-stat-error">Load failed</span></div><div class="access-stat-card"><span class="access-stat-label">Access</span><span class="access-stat-value">' + (canManage ? "Manage access" : "View roster") + "</span></div>";
+ stats.innerHTML = renderAccessStatsSummary("Access \u2022 " + (canManage ? "Manage access" : "View roster") + " \u2022 Load failed", true);
return;
}
var members = entry.accessQuery.data;
- stats.innerHTML = '<div class="access-stat-card"><span class="access-stat-label">Members</span><span class="access-stat-value">' + String(members.length) + '</span></div><div class="access-stat-card"><span class="access-stat-label">Owners</span><span class="access-stat-value">' + String(countMembersByRole(members, "owner")) + '</span></div><div class="access-stat-card"><span class="access-stat-label">Admins</span><span class="access-stat-value">' + String(countMembersByRole(members, "admin")) + '</span></div><div class="access-stat-card"><span class="access-stat-label">Operators</span><span class="access-stat-value">' + String(countMembersByRole(members, "tech") + countMembersByRole(members, "read_only")) + "</span></div>";
+ stats.innerHTML = renderAccessStatsSummary(
+ "Members " + String(members.length) + " \u2022 Owners " + String(countMembersByRole(members, "owner")) + " \u2022 Admins " + String(countMembersByRole(members, "admin")) + " \u2022 Operators " + String(countMembersByRole(members, "tech") + countMembersByRole(members, "read_only")),
+ false
+ );
}
function createAccessControlCell(className) {
var cell = document.createElement("div");
@@ -289,17 +295,10 @@
return group;
}
function renderAccessMemberAction(accountID, member, isOwner, canManage, activeJob) {
- var group = createAccessControlCell("access-control-cell-access");
- if (!canManage) {
+ if (!canManage || activeJob !== "remove") {
return null;
}
- if (activeJob !== "remove") {
- var idleText = document.createElement("span");
- idleText.className = "access-control-locked";
- idleText.textContent = activeJob === "change_role" ? "Role change" : "Review only";
- group.appendChild(idleText);
- return group;
- }
+ var group = createAccessControlCell("access-control-cell-access");
if (normalizePortalRole(member.role) === "owner" && !isOwner) {
var lockedText = document.createElement("span");
lockedText.className = "access-control-locked";
@@ -319,8 +318,9 @@
return group;
}
function renderAccessMemberRow(accountID, member, isOwner, canManage, activeJob) {
+ var showActionColumn = canManage && activeJob === "remove";
var row = document.createElement("div");
- row.className = "access-member-row" + (canManage ? "" : " access-member-row-readonly");
+ row.className = "access-member-row" + (showActionColumn ? "" : " access-member-row-readonly");
var identity = document.createElement("div");
identity.className = "access-member-identity";
var topline = document.createElement("div");
@@ -347,9 +347,10 @@
return row;
}
function renderAccessRosterHead(container, activeJob, canManage) {
+ var showActionColumn = canManage && activeJob === "remove";
var head = document.createElement("div");
- head.className = "access-roster-head" + (canManage ? "" : " access-roster-head-readonly");
- head.innerHTML = canManage ? "<span>Operator</span><span>" + (activeJob === "change_role" ? "New role" : "Role") + "</span><span>" + (activeJob === "remove" ? "Remove" : "Action") + "</span>" : "<span>Operator</span><span>Role</span>";
+ head.className = "access-roster-head" + (showActionColumn ? "" : " access-roster-head-readonly");
+ head.innerHTML = showActionColumn ? "<span>Operator</span><span>Role</span><span>Remove</span>" : "<span>Operator</span><span>Role</span>";
container.appendChild(head);
}
function renderAddWorkspaceSection(accountID, entry) {
@@ -2014,25 +2015,6 @@
function suspendedWorkspaceSectionChipLabel(count) {
return count === 1 ? "1 workspace suspended" : String(count) + " workspaces suspended";
}
- function overviewNavBadgeLabel(hosted, attentionCount, readyCount) {
- if (!hosted) return "Billing available";
- if (attentionCount > 0) return reviewWorkspaceChipLabel(attentionCount);
- return readyWorkspaceChipLabel(readyCount);
- }
- function workspacesNavBadgeLabel(hosted, totalWorkspaces) {
- if (!hosted) return "Unavailable";
- return workspaceCountLabel(totalWorkspaces);
- }
- function accessNavBadgeLabel(hosted, canManage) {
- if (!hosted) return "Unavailable";
- return canManage ? "Manage access" : "View roster";
- }
- function billingNavBadgeLabel(hostedBillingCount) {
- return hostedBillingCount > 0 ? "Hosted billing" : "Self-hosted billing";
- }
- function supportNavBadgeLabel() {
- return "Escalation only";
- }
function billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial) {
return [
hostedBillingCount > 0 ? "Hosted billing attached" : "No hosted billing attached",
@@ -2179,59 +2161,59 @@
return '<span class="section-context-chip">' + escapeHTML(chip) + "</span>";
}).join("") + "</div>";
}
- function attentionWorkspaces(workspaces) {
- var results = [];
- for (var i = 0; i < workspaces.length; i += 1) {
- var status = workspaceHealthState(workspaces[i]);
- if (status === "unhealthy" || status === "checking") {
- results.push(workspaces[i]);
- }
- }
- return results;
- }
function accountContextRoleMeta(account) {
return portalRoleLabel(account.role) + " role";
}
function accountContextLeadCopy(account) {
- var accountPrefix = account.kind === "msp" ? "Hosted workspace account" : "Hosted account";
if (account.can_manage) {
- return accountPrefix + (account.has_billing ? " for workspace access, access control, and billing." : " for workspace access and access control.");
+ return account.has_billing ? "Manage workspaces, access, and billing for this account." : "Manage workspaces and access for this account.";
}
- return accountPrefix + (account.has_billing ? " where you can open workspaces and review who already has access. An owner or admin handles access changes and billing." : " where you can open workspaces and review who already has access. An owner or admin handles account changes.");
- }
- function accountContextAccessSummary(account) {
- return account.can_manage ? "Manage access" : "View roster";
- }
- function accountContextBillingSummary(account) {
- if (!account.has_billing) return "Not attached";
- return account.can_manage ? "Hosted billing attached" : "Owner/admin required";
+ return account.has_billing ? "Open workspaces and review access here. Billing and account changes require an owner or admin." : "Open workspaces and review access here. Account changes require an owner or admin.";
}
function renderAccountContextStrip(account) {
- var workspaceLabel = workspaceCountLabel((account.workspaces || []).length);
- var billingLabel = accountContextBillingSummary(account);
- return '<section class="portal-account-context"><div class="portal-account-context-copy"><div class="portal-account-context-meta"><span class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</span><span class="portal-account-context-separator">/</span><span class="portal-account-context-access">' + escapeHTML(accountContextRoleMeta(account)) + '</span></div><div class="portal-account-context-row portal-account-context-row-title"><h2>' + escapeHTML(account.name) + "</h2></div><p>" + escapeHTML(accountContextLeadCopy(account)) + '</p></div><div class="portal-account-context-summary"><div class="portal-account-context-stat"><span>Access</span><strong>' + escapeHTML(accountContextAccessSummary(account)) + '</strong></div><div class="portal-account-context-stat"><span>Workspaces</span><strong>' + escapeHTML(workspaceLabel) + '</strong></div><div class="portal-account-context-stat"><span>Billing</span><strong>' + escapeHTML(billingLabel) + "</strong></div></div></section>";
+ return '<section class="portal-account-context"><div class="portal-account-context-copy"><div class="portal-account-context-meta"><span class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</span><span class="portal-account-context-separator">\u2022</span><span class="portal-account-context-access">' + escapeHTML(accountContextRoleMeta(account)) + '</span></div><div class="portal-account-context-row portal-account-context-row-title"><h2>' + escapeHTML(account.name) + "</h2></div><p>" + escapeHTML(accountContextLeadCopy(account)) + "</p></div></section>";
}
- function shellSectionButton(section, activeSection, title, badge) {
- var badgeHTML = badge ? '<span class="portal-shell-nav-badge">' + escapeHTML(badge) + "</span>" : "";
- 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-row"><span class="portal-shell-nav-label">' + title + "</span>" + badgeHTML + "</span></button>";
+ function renderPortalContextStrip(accounts, showSelfHostedCommercial) {
+ if (accounts.length === 1) {
+ return renderAccountContextStrip(accounts[0]);
+ }
+ if (accounts.length > 1) {
+ return '<section class="portal-account-context"><div class="portal-account-context-copy"><div class="portal-account-context-meta"><span class="account-eyebrow">Pulse Account</span><span class="portal-account-context-separator">\u2022</span><span class="portal-account-context-access">' + escapeHTML(accounts.length === 1 ? "1 hosted account" : String(accounts.length) + " hosted accounts") + '</span></div><div class="portal-account-context-row portal-account-context-row-title"><h2>Accounts</h2></div><p>Open workspaces, review access, and handle billing from one account surface.</p></div></section>';
+ }
+ return '<section class="portal-account-context"><div class="portal-account-context-copy"><div class="portal-account-context-meta"><span class="account-eyebrow">Billing account</span><span class="portal-account-context-separator">\u2022</span><span class="portal-account-context-access">' + escapeHTML(showSelfHostedCommercial ? "Self-hosted commercial" : "Commercial account") + '</span></div><div class="portal-account-context-row portal-account-context-row-title"><h2>Billing</h2></div><p>Use Billing for self-hosted subscriptions, licenses, refunds, and privacy requests.</p></div></section>';
}
- function renderShellNavigation(accounts, activeSection) {
+ function visibleShellSections(bootstrap) {
+ var accounts = Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];
var hosted = hasHostedAccounts(accounts);
- var workspaces = collectWorkspaces(accounts);
- var totalWorkspaces = workspaces.length;
- var readyWorkspaces = countReadyWorkspaces(workspaces);
- var attentionCount = attentionWorkspaces(workspaces).length;
+ var showSelfHostedCommercial = hasSelfHostedCommercial(bootstrap);
var hostedBillingCount = 0;
- var canManage = false;
for (var i = 0; i < accounts.length; i += 1) {
- if (accounts[i].can_manage) {
- canManage = true;
- }
if (accounts[i].has_billing) {
hostedBillingCount += 1;
}
}
- return '<aside class="portal-shell-nav" aria-label="Pulse Account sections"><div class="portal-shell-nav-header"><div class="portal-shell-nav-eyebrow">Pulse Account</div><div class="portal-shell-nav-title">' + (hosted ? "Account" : "Billing account") + '</div></div><div class="portal-shell-nav-group">' + shellSectionButton("overview", activeSection, "Overview", overviewNavBadgeLabel(hosted, attentionCount, readyWorkspaces)) + shellSectionButton("workspaces", activeSection, "Workspaces", workspacesNavBadgeLabel(hosted, totalWorkspaces)) + shellSectionButton("access", activeSection, "Access", accessNavBadgeLabel(hosted, canManage)) + shellSectionButton("billing", activeSection, "Billing", billingNavBadgeLabel(hostedBillingCount)) + shellSectionButton("support", activeSection, "Support", supportNavBadgeLabel()) + "</div></aside>";
+ var sections = [];
+ if (hosted) {
+ sections.push({ section: "workspaces", title: "Workspaces" });
+ sections.push({ section: "access", title: "Access" });
+ }
+ if (hostedBillingCount > 0 || showSelfHostedCommercial) {
+ sections.push({ section: "billing", title: "Billing" });
+ }
+ sections.push({ section: "support", title: "Support" });
+ if (hosted) {
+ sections.push({ section: "overview", title: "Overview" });
+ }
+ return sections;
+ }
+ function shellSectionButton(section, activeSection, title) {
+ 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-row"><span class="portal-shell-nav-label">' + title + "</span></span></button>";
+ }
+ function renderShellNavigation(bootstrap, activeSection) {
+ var sections = visibleShellSections(bootstrap);
+ return '<nav class="portal-shell-nav" aria-label="Pulse Account sections"><div class="portal-shell-nav-group">' + sections.map(function(entry) {
+ return shellSectionButton(entry.section, activeSection, entry.title);
+ }).join("") + "</div></nav>";
}
function renderWorkspaceCard(account, workspace, accountAPIBasePath) {
var status = workspaceHealthState(workspace);
@@ -2406,7 +2388,7 @@
reviewWorkspaceChipLabel(attentionCount),
suspendedWorkspaceChipLabel(suspendedCount)
] : ["No hosted account", "0 hosted workspaces", "Billing available", "Support only on escalation"];
- return '<section class="account-content-panel account-content-panel-overview"><div class="account-stage-header account-stage-header-overview overview-stage-header"><div><div class="account-panel-kicker">Overview</div><h3>Current state</h3><p>Hosted workspace counts and the next available action.</p>' + renderSectionContextChips(chips) + '</div></div><div class="overview-task-grid">' + renderOverviewAttentionCard(accounts, entries, showSelfHostedCommercial) + renderOverviewReadyCard(accounts, entries, context.accountAPIBasePath) + renderOverviewNextActionCard(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) + "</div></section>";
+ return '<section class="account-content-panel account-content-panel-overview"><div class="account-stage-header account-stage-header-overview overview-stage-header"><div><div class="account-panel-kicker">Overview</div><h3>Current state</h3><p>Hosted workspace counts, current state, and the next step.</p>' + renderSectionContextChips(chips) + '</div></div><div class="overview-task-grid">' + renderOverviewAttentionCard(accounts, entries, showSelfHostedCommercial) + renderOverviewReadyCard(accounts, entries, context.accountAPIBasePath) + renderOverviewNextActionCard(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) + "</div></section>";
}
function renderNoHostedWorkspacesSection() {
return '<section class="account-content-panel account-content-panel-workspaces"><div class="account-stage-header"><div><div class="account-panel-kicker">Workspaces</div><h3>Workspaces</h3><p>No hosted workspace is attached to this account.</p>' + renderSectionContextChips(["None attached", "Billing instead"]) + '</div></div><div class="empty-state empty-state-spaced"><p>There is nothing to open or manage here yet.</p><p class="support-copy">Use Billing for self-hosted subscriptions, licenses, refunds, or privacy requests.</p></div></section>';
@@ -2497,16 +2479,23 @@
var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];
var hosted = hasHostedAccounts(accounts);
var showSelfHostedCommercial = hasSelfHostedCommercial(context.bootstrap);
- var activeSection = context.activeSection || preferredPortalShellSection(context.bootstrap);
+ var shellSections = visibleShellSections(context.bootstrap);
+ var preferredSection = context.activeSection || preferredPortalShellSection(context.bootstrap);
+ var activeSection = shellSections.some(function(entry) {
+ return entry.section === preferredSection;
+ }) ? preferredSection : shellSections[0] ? shellSections[0].section : "billing";
var hostedBillingCount = accounts.filter(function(account) {
return account.has_billing;
}).length;
var billingNote = hosted ? showSelfHostedCommercial ? "Use hosted billing first when the request belongs to a hosted workspace account. Self-hosted licenses, refunds, and privacy stay separate underneath it." : "Use this billing surface only for hosted billing on your hosted workspace accounts." : "Use this billing surface only for self-hosted subscriptions, licenses, refunds, and privacy requests.";
var selfHostedBillingEscalationCopy = hosted ? "Escalate with the same hosted billing action or self-hosted path and the exact failed step." : "Escalate with the same self-hosted billing path and the exact failed step.";
- var hostedContent = accounts.length ? accounts.map(function(account) {
- return '<section class="account-surface"><div class="account-surface-body">' + renderAccountWorkspaceSection(account, context.accountAPIBasePath) + renderAccountAccessSection(account) + "</div></section>";
- }).join("") : renderNoHostedWorkspacesSection() + renderNoHostedAccessSection();
- return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-layout">' + renderShellNavigation(accounts, activeSection) + '<div class="portal-shell-main">' + (accounts.length === 1 ? renderAccountContextStrip(accounts[0]) : "") + '<section class="portal-content-panel portal-content-panel-overview">' + renderShellOverviewSection(context) + '<div id="accounts-root">' + hostedContent + '</div></section><section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section"><div class="billing-header"><div><div class="account-panel-kicker">Billing</div><h2>Billing</h2>' + renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) + '</div><div class="billing-note">' + billingNote + "</div></div>" + (hosted ? '<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + "</div>" : "") + (showSelfHostedCommercial ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><div class="account-panel-kicker">Self-hosted billing</div><h3>Pick the self-hosted job</h3><p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p></div><div class="billing-action-list">' + renderBillingActionRow("open-manage-billing", "Manage subscriptions", "Billing", "Open Stripe for self-hosted plan, invoice, and payment changes.", "manage-billing-panel", "manage-inline-email", ["Plan changes", "Invoices"]) + renderBillingActionRow("open-retrieve-billing", "Retrieve licenses", "Licenses", "Recover the latest active self-hosted license and invoice link.", "retrieve-billing-panel", "retrieve-inline-email", ["Latest active license", "Invoice lookup"]) + renderBillingActionRow("open-refund-billing", "Refund requests", "Refunds", "Request a self-serve refund when the purchase is still eligible.", "refund-billing-panel", "refund-inline-email", ["Eligibility check", "Revocation"]) + renderBillingActionRow("open-data-billing", "Data and privacy", "Privacy", "Request export or deletion for commercial account data.", "data-billing-panel", "data-export-email", ["Export", "Deletion"]) + '</div><div class="billing-inline-support"><div class="account-panel-kicker">Escalation only</div><h4>Use Support only after Billing fails</h4><p>' + selfHostedBillingEscalationCopy + '</p><div class="billing-inline-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div></div><div class="billing-shell-detail" id="billing-detail-shell" hidden>' + renderBillingTaskPanel(
+ var workspacesContent = accounts.length ? accounts.map(function(account) {
+ return '<section class="account-surface">' + renderAccountWorkspaceSection(account, context.accountAPIBasePath) + "</section>";
+ }).join("") : renderNoHostedWorkspacesSection();
+ var accessContent = accounts.length ? accounts.map(function(account) {
+ return '<section class="account-surface">' + renderAccountAccessSection(account) + "</section>";
+ }).join("") : renderNoHostedAccessSection();
+ return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-main">' + renderPortalContextStrip(accounts, showSelfHostedCommercial) + renderShellNavigation(context.bootstrap, activeSection) + (hosted ? '<section class="portal-content-panel portal-content-panel-workspaces">' + workspacesContent + '</section><section class="portal-content-panel portal-content-panel-access">' + accessContent + '</section><section class="portal-content-panel portal-content-panel-overview">' + renderShellOverviewSection(context) + "</section>" : "") + '<section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section"><div class="billing-header"><div><div class="account-panel-kicker">Billing</div><h2>Billing</h2>' + renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) + '</div><div class="billing-note">' + billingNote + "</div></div>" + (hosted ? '<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + "</div>" : "") + (showSelfHostedCommercial ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><div class="account-panel-kicker">Self-hosted billing</div><h3>Pick the self-hosted job</h3><p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p></div><div class="billing-action-list">' + renderBillingActionRow("open-manage-billing", "Manage subscriptions", "Billing", "Open Stripe for self-hosted plan, invoice, and payment changes.", "manage-billing-panel", "manage-inline-email", ["Plan changes", "Invoices"]) + renderBillingActionRow("open-retrieve-billing", "Retrieve licenses", "Licenses", "Recover the latest active self-hosted license and invoice link.", "retrieve-billing-panel", "retrieve-inline-email", ["Latest active license", "Invoice lookup"]) + renderBillingActionRow("open-refund-billing", "Refund requests", "Refunds", "Request a self-serve refund when the purchase is still eligible.", "refund-billing-panel", "refund-inline-email", ["Eligibility check", "Revocation"]) + renderBillingActionRow("open-data-billing", "Data and privacy", "Privacy", "Request export or deletion for commercial account data.", "data-billing-panel", "data-export-email", ["Export", "Deletion"]) + '</div><div class="billing-inline-support"><div class="account-panel-kicker">Escalation only</div><h4>Use Support only after Billing fails</h4><p>' + selfHostedBillingEscalationCopy + '</p><div class="billing-inline-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div></div><div class="billing-shell-detail" id="billing-detail-shell" hidden>' + renderBillingTaskPanel(
"Manage subscriptions",
"Open Stripe for self-hosted plan, invoice, and payment changes.",
"manage-billing-panel",
@@ -2526,7 +2515,7 @@
"Request export or deletion for commercial account data.",
"data-billing-panel",
'<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></div>" : "") + '</section><section class="portal-content-panel portal-content-panel-support">' + renderSupportSection(context) + "</section></div></div></div>";
+ ) + "</div></div>" : "") + '</section><section class="portal-content-panel portal-content-panel-support">' + renderSupportSection(context) + "</section></div></div>";
}
function renderAuthScopeRow(title, copy) {
return '<article class="portal-auth-scope-row"><h3>' + escapeHTML(title) + "</h3><p>" + escapeHTML(copy) + "</p></article>";
diff --git a/internal/cloudcp/portal/frontend/src/account_view.test.ts b/internal/cloudcp/portal/frontend/src/account_view.test.ts
index 466c4db80a..323a93ebfc 100644
--- a/internal/cloudcp/portal/frontend/src/account_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/account_view.test.ts
@@ -144,7 +144,9 @@ describe('account view', function() {
);
expect(document.querySelector('[data-action="change-role"]')).toBeNull();
expect(document.querySelector('[data-action="remove-member"]')).toBeNull();
- expect(document.getElementById('access-list-acct_1')?.textContent).toContain('Review only');
+ expect(document.getElementById('access-list-acct_1')?.textContent).toContain('Operator');
+ expect(document.getElementById('access-list-acct_1')?.textContent).toContain('Role');
+ expect(document.getElementById('access-list-acct_1')?.textContent).not.toContain('Review only');
expect(document.getElementById('access-stats-acct_1')?.textContent).toContain('Members');
expect(document.getElementById('access-stats-acct_1')?.textContent).toContain('2');
});
diff --git a/internal/cloudcp/portal/frontend/src/account_view.ts b/internal/cloudcp/portal/frontend/src/account_view.ts
index 315f8c0ef1..a8e88cbdb4 100644
--- a/internal/cloudcp/portal/frontend/src/account_view.ts
+++ b/internal/cloudcp/portal/frontend/src/account_view.ts
@@ -143,6 +143,10 @@ function countMembersByRole(members: PortalAccessMember[], role: string): number
return count;
}
+function renderAccessStatsSummary(summary: string, isError: boolean): string {
+ return '<div class="access-stat-summary' + (isError ? ' access-stat-summary-error' : '') + '">' + summary + '</div>';
+}
+
function accessJobTitle(job: PortalAccessJob): string {
switch (job) {
case 'invite':
@@ -177,24 +181,22 @@ function renderAccessStats(accountID: string, entry: PortalAccountUIEntry, canMa
return;
}
if (entry.accessQuery.status === 'loading') {
- stats.innerHTML =
- '<div class="access-stat-card"><span class="access-stat-label">Roster</span><span class="access-stat-value">Loading…</span></div>' +
- '<div class="access-stat-card"><span class="access-stat-label">Access</span><span class="access-stat-value">' + (canManage ? 'Manage access' : 'View roster') + '</span></div>';
+ stats.innerHTML = renderAccessStatsSummary('Access • ' + (canManage ? 'Manage access' : 'View roster') + ' • Loading roster', false);
return;
}
if (entry.accessQuery.status === 'error') {
- stats.innerHTML =
- '<div class="access-stat-card"><span class="access-stat-label">Roster</span><span class="access-stat-value access-stat-error">Load failed</span></div>' +
- '<div class="access-stat-card"><span class="access-stat-label">Access</span><span class="access-stat-value">' + (canManage ? 'Manage access' : 'View roster') + '</span></div>';
+ stats.innerHTML = renderAccessStatsSummary('Access • ' + (canManage ? 'Manage access' : 'View roster') + ' • Load failed', true);
return;
}
var members = entry.accessQuery.data;
- stats.innerHTML =
- '<div class="access-stat-card"><span class="access-stat-label">Members</span><span class="access-stat-value">' + String(members.length) + '</span></div>' +
- '<div class="access-stat-card"><span class="access-stat-label">Owners</span><span class="access-stat-value">' + String(countMembersByRole(members, 'owner')) + '</span></div>' +
- '<div class="access-stat-card"><span class="access-stat-label">Admins</span><span class="access-stat-value">' + String(countMembersByRole(members, 'admin')) + '</span></div>' +
- '<div class="access-stat-card"><span class="access-stat-label">Operators</span><span class="access-stat-value">' + String(countMembersByRole(members, 'tech') + countMembersByRole(members, 'read_only')) + '</span></div>';
+ stats.innerHTML = renderAccessStatsSummary(
+ 'Members ' + String(members.length) + ' • ' +
+ 'Owners ' + String(countMembersByRole(members, 'owner')) + ' • ' +
+ 'Admins ' + String(countMembersByRole(members, 'admin')) + ' • ' +
+ 'Operators ' + String(countMembersByRole(members, 'tech') + countMembersByRole(members, 'read_only')),
+ false
+ );
}
function createAccessControlCell(className: string): HTMLDivElement {
@@ -239,17 +241,10 @@ function renderAccessRoleControl(accountID: string, member: PortalAccessMember,
}
function renderAccessMemberAction(accountID: string, member: PortalAccessMember, isOwner: boolean, canManage: boolean, activeJob: PortalAccessJob): HTMLElement | null {
- var group = createAccessControlCell('access-control-cell-access');
- if (!canManage) {
+ if (!canManage || activeJob !== 'remove') {
return null;
}
- if (activeJob !== 'remove') {
- var idleText = document.createElement('span');
- idleText.className = 'access-control-locked';
- idleText.textContent = activeJob === 'change_role' ? 'Role change' : 'Review only';
- group.appendChild(idleText);
- return group;
- }
+ var group = createAccessControlCell('access-control-cell-access');
if (normalizePortalRole(member.role) === 'owner' && !isOwner) {
var lockedText = document.createElement('span');
lockedText.className = 'access-control-locked';
@@ -271,8 +266,9 @@ function renderAccessMemberAction(accountID: string, member: PortalAccessMember,
}
function renderAccessMemberRow(accountID: string, member: PortalAccessMember, isOwner: boolean, canManage: boolean, activeJob: PortalAccessJob): HTMLElement {
+ var showActionColumn = canManage && activeJob === 'remove';
var row = document.createElement('div');
- row.className = 'access-member-row' + (canManage ? '' : ' access-member-row-readonly');
+ row.className = 'access-member-row' + (showActionColumn ? '' : ' access-member-row-readonly');
var identity = document.createElement('div');
identity.className = 'access-member-identity';
@@ -307,13 +303,14 @@ function renderAccessMemberRow(accountID: string, member: PortalAccessMember, is
}
function renderAccessRosterHead(container: HTMLElement, activeJob: PortalAccessJob, canManage: boolean): void {
+ var showActionColumn = canManage && activeJob === 'remove';
var head = document.createElement('div');
- head.className = 'access-roster-head' + (canManage ? '' : ' access-roster-head-readonly');
- head.innerHTML = canManage
+ head.className = 'access-roster-head' + (showActionColumn ? '' : ' access-roster-head-readonly');
+ head.innerHTML = showActionColumn
? (
'<span>Operator</span>' +
- '<span>' + (activeJob === 'change_role' ? 'New role' : 'Role') + '</span>' +
- '<span>' + (activeJob === 'remove' ? 'Remove' : 'Action') + '</span>'
+ '<span>Role</span>' +
+ '<span>Remove</span>'
)
: (
'<span>Operator</span>' +
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index 4f1dbb64fe..f4800f392c 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -135,27 +135,23 @@ describe('shell view', function() {
expect(html).toContain('Access');
expect(html).toContain('Billing');
expect(html).toContain('Support');
- expect(html).toContain('portal-shell-nav-title">Account<');
expect(html).toContain('1 account');
expect(html).toContain('3 workspaces');
expect(html).toContain('1 ready workspace');
expect(html).toContain('2 workspaces to review');
- expect(html).toContain('Manage access');
expect(html).toContain('id="billing-section"');
expect(html).toContain('portal-account-context');
expect(html).toContain('Owner role');
- expect(html).toContain('portal-account-context-summary');
expect(html).toContain('Hosted billing attached');
- expect(html).toContain('id="accounts-root"');
expect(html).toContain('MSP account');
expect(html).toContain('Acme MSP');
- expect(html).toContain('Hosted workspace account');
+ expect(html).toContain('Manage workspaces, access, and billing for this account.');
expect(html).toContain('3 workspaces');
expect(html).toContain('Create workspace');
expect(html).not.toContain('Manage billing');
expect(html).not.toContain('Manage team');
expect(html).toContain('Current state');
- expect(html).toContain('Hosted workspace counts and the next available action.');
+ expect(html).toContain('Hosted workspace counts, current state, and the next step.');
expect(html).toContain('section-context-strip');
expect(html).toContain('Needs attention');
expect(html).toContain('Ready');
@@ -315,7 +311,7 @@ describe('shell view', function() {
expect(html).toContain('data-shell-section="billing"');
});
- it('keeps top-level task navigation in the canonical section order', function() {
+ it('keeps top-level task navigation in the simplified section order', function() {
var html = renderAuthenticatedPortalHTML(
createContext({
bootstrap: createBootstrap({
@@ -350,15 +346,15 @@ describe('shell view', function() {
var billingIndex = html.indexOf('data-shell-action="activate-section" data-shell-section="billing"');
var supportIndex = html.indexOf('data-shell-action="activate-section" data-shell-section="support"');
- expect(overviewIndex).toBeGreaterThan(-1);
- expect(workspacesIndex).toBeGreaterThan(overviewIndex);
+ expect(workspacesIndex).toBeGreaterThan(-1);
expect(accessIndex).toBeGreaterThan(workspacesIndex);
expect(billingIndex).toBeGreaterThan(accessIndex);
expect(supportIndex).toBeGreaterThan(billingIndex);
+ expect(overviewIndex).toBeGreaterThan(supportIndex);
expect(html).not.toContain('Services');
});
- it('renders one compact account context strip with three summary facts', function() {
+ it('renders one simple account context strip without summary facts', function() {
var html = renderAuthenticatedPortalHTML(
createContext({
bootstrap: createBootstrap({
@@ -388,12 +384,11 @@ describe('shell view', function() {
);
expect((html.match(/portal-account-context\"/g) || []).length).toBe(1);
- expect((html.match(/portal-account-context-stat/g) || []).length).toBe(3);
+ expect((html.match(/portal-account-context-stat/g) || []).length).toBe(0);
expect((html.match(/account-context-chip\"/g) || []).length).toBe(0);
expect(html).toContain('Admin role');
- expect(html).toContain('Hosted account for workspace access, access control, and billing.');
- expect(html).toContain('Manage access');
- expect(html).toContain('Hosted billing attached');
+ expect(html).toContain('Manage workspaces, access, and billing for this account.');
+ expect(html).not.toContain('portal-account-context-summary');
});
it('renders a view-only access surface when the account cannot manage access', function() {
@@ -427,12 +422,9 @@ describe('shell view', function() {
expect(html).toContain('Open a workspace and review current state here. An owner or admin must create or change hosted workspaces.');
expect(html).toContain('Tech role');
- expect(html).toContain('Hosted account where you can open workspaces and review who already has access. An owner or admin handles access changes and billing.');
- expect(html).toContain('View roster');
- expect(html).toContain('Owner/admin required');
+ expect(html).toContain('Open workspaces and review access here. Billing and account changes require an owner or admin.');
expect(html).toContain('0 workspaces need review');
expect(html).toContain('1 workspace is ready to use');
- expect(html).toContain('View roster');
expect(html).toContain('Owner or admin required');
expect(html).toContain('Review who already has access to this hosted account. An owner or admin must make changes.');
expect(html).toContain('Review the hosted roster here. An owner or admin must make changes.');
@@ -652,7 +644,7 @@ describe('shell view', function() {
expect(html).not.toContain('Active workspaces look clear for routine use.');
});
- it('renders self-hosted overview copy when no hosted accounts are attached', function() {
+ it('renders a billing-first self-hosted shell when no hosted accounts are attached', function() {
var html = renderAuthenticatedPortalHTML(
createContext({
bootstrap: createBootstrap({
@@ -661,18 +653,11 @@ describe('shell view', function() {
})
);
- expect(html).toContain('Pulse Account');
expect(html).toContain('Billing account');
- expect(html).toContain('Current state');
- expect(html).toContain('Workspaces');
- expect(html).toContain('Unavailable');
- expect(html).toContain('Access');
expect(html).toContain('Support');
- expect(html).toContain('No hosted account');
- expect(html).toContain('0 hosted workspaces need review');
- expect(html).toContain('Billing is available');
- expect(html).toContain('There is nothing to open or manage here yet.');
- expect(html).toContain('There are no hosted roles or invites to manage for this account right now.');
+ expect(html).not.toContain('Current state');
+ expect(html).not.toContain('data-shell-section="workspaces"');
+ expect(html).not.toContain('data-shell-section="access"');
expect(html).toContain('Use this billing surface only for self-hosted subscriptions, licenses, refunds, and privacy requests.');
expect(html).toContain('Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.');
expect(html).toContain('Escalate with the same self-hosted billing path and the exact failed step.');
@@ -766,8 +751,10 @@ describe('shell view', function() {
expect(html).toContain('1 workspace is suspended. Resume it before opening it again.');
});
- it('preserves the high-density grid, standard sidebar hooks, and strictly horizontal, pill-free action constraints in the rendered shell', function() {
+ it('preserves the simplified top-tab shell hooks in the rendered shell', function() {
var html = renderAuthenticatedPortalHTML(createContext());
- expect(html).toContain('portal-shell-layout');
+ expect(html).toContain('portal-shell-main');
+ expect(html).toContain('portal-shell-nav-group');
+ expect(html).not.toContain('portal-shell-layout');
});
});
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index 37bda845dc..cc64cd193c 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -90,30 +90,6 @@ function suspendedWorkspaceSectionChipLabel(count: number): string {
return count === 1 ? '1 workspace suspended' : String(count) + ' workspaces suspended';
}
-function overviewNavBadgeLabel(hosted: boolean, attentionCount: number, readyCount: number): string {
- if (!hosted) return 'Billing available';
- if (attentionCount > 0) return reviewWorkspaceChipLabel(attentionCount);
- return readyWorkspaceChipLabel(readyCount);
-}
-
-function workspacesNavBadgeLabel(hosted: boolean, totalWorkspaces: number): string {
- if (!hosted) return 'Unavailable';
- return workspaceCountLabel(totalWorkspaces);
-}
-
-function accessNavBadgeLabel(hosted: boolean, canManage: boolean): string {
- if (!hosted) return 'Unavailable';
- return canManage ? 'Manage access' : 'View roster';
-}
-
-function billingNavBadgeLabel(hostedBillingCount: number): string {
- return hostedBillingCount > 0 ? 'Hosted billing' : 'Self-hosted billing';
-}
-
-function supportNavBadgeLabel(): string {
- return 'Escalation only';
-}
-
function billingHeaderChipLabels(hostedBillingCount: number, showSelfHostedCommercial: boolean): string[] {
return [
hostedBillingCount > 0 ? 'Hosted billing attached' : 'No hosted billing attached',
@@ -347,36 +323,23 @@ function accountContextRoleMeta(account: PortalAccountSummary): string {
}
function accountContextLeadCopy(account: PortalAccountSummary): string {
- var accountPrefix = account.kind === 'msp' ? 'Hosted workspace account' : 'Hosted account';
if (account.can_manage) {
- return accountPrefix + (account.has_billing
- ? ' for workspace access, access control, and billing.'
- : ' for workspace access and access control.');
+ return account.has_billing
+ ? 'Manage workspaces, access, and billing for this account.'
+ : 'Manage workspaces and access for this account.';
}
- return accountPrefix + (account.has_billing
- ? ' where you can open workspaces and review who already has access. An owner or admin handles access changes and billing.'
- : ' where you can open workspaces and review who already has access. An owner or admin handles account changes.');
-}
-
-function accountContextAccessSummary(account: PortalAccountSummary): string {
- return account.can_manage ? 'Manage access' : 'View roster';
-}
-
-function accountContextBillingSummary(account: PortalAccountSummary): string {
- if (!account.has_billing) return 'Not attached';
- return account.can_manage ? 'Hosted billing attached' : 'Owner/admin required';
+ return account.has_billing
+ ? 'Open workspaces and review access here. Billing and account changes require an owner or admin.'
+ : 'Open workspaces and review access here. Account changes require an owner or admin.';
}
function renderAccountContextStrip(account: PortalAccountSummary): string {
- var workspaceLabel = workspaceCountLabel((account.workspaces || []).length);
- var billingLabel = accountContextBillingSummary(account);
-
return (
'<section class="portal-account-context">' +
'<div class="portal-account-context-copy">' +
'<div class="portal-account-context-meta">' +
'<span class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</span>' +
- '<span class="portal-account-context-separator">/</span>' +
+ '<span class="portal-account-context-separator">•</span>' +
'<span class="portal-account-context-access">' + escapeHTML(accountContextRoleMeta(account)) + '</span>' +
'</div>' +
'<div class="portal-account-context-row portal-account-context-row-title">' +
@@ -384,68 +347,99 @@ function renderAccountContextStrip(account: PortalAccountSummary): string {
'</div>' +
'<p>' + escapeHTML(accountContextLeadCopy(account)) + '</p>' +
'</div>' +
- '<div class="portal-account-context-summary">' +
- '<div class="portal-account-context-stat">' +
- '<span>Access</span>' +
- '<strong>' + escapeHTML(accountContextAccessSummary(account)) + '</strong>' +
+ '</section>'
+ );
+}
+
+function renderPortalContextStrip(accounts: PortalAccountSummary[], showSelfHostedCommercial: boolean): string {
+ if (accounts.length === 1) {
+ return renderAccountContextStrip(accounts[0]);
+ }
+ if (accounts.length > 1) {
+ return (
+ '<section class="portal-account-context">' +
+ '<div class="portal-account-context-copy">' +
+ '<div class="portal-account-context-meta">' +
+ '<span class="account-eyebrow">Pulse Account</span>' +
+ '<span class="portal-account-context-separator">•</span>' +
+ '<span class="portal-account-context-access">' + escapeHTML(accounts.length === 1 ? '1 hosted account' : String(accounts.length) + ' hosted accounts') + '</span>' +
+ '</div>' +
+ '<div class="portal-account-context-row portal-account-context-row-title">' +
+ '<h2>Accounts</h2>' +
+ '</div>' +
+ '<p>Open workspaces, review access, and handle billing from one account surface.</p>' +
'</div>' +
- '<div class="portal-account-context-stat">' +
- '<span>Workspaces</span>' +
- '<strong>' + escapeHTML(workspaceLabel) + '</strong>' +
+ '</section>'
+ );
+ }
+ return (
+ '<section class="portal-account-context">' +
+ '<div class="portal-account-context-copy">' +
+ '<div class="portal-account-context-meta">' +
+ '<span class="account-eyebrow">Billing account</span>' +
+ '<span class="portal-account-context-separator">•</span>' +
+ '<span class="portal-account-context-access">' + escapeHTML(showSelfHostedCommercial ? 'Self-hosted commercial' : 'Commercial account') + '</span>' +
'</div>' +
- '<div class="portal-account-context-stat">' +
- '<span>Billing</span>' +
- '<strong>' + escapeHTML(billingLabel) + '</strong>' +
+ '<div class="portal-account-context-row portal-account-context-row-title">' +
+ '<h2>Billing</h2>' +
'</div>' +
+ '<p>Use Billing for self-hosted subscriptions, licenses, refunds, and privacy requests.</p>' +
'</div>' +
'</section>'
);
}
-function shellSectionButton(section: PortalShellSection, activeSection: PortalShellSection, title: string, badge?: string): string {
- var badgeHTML = badge
- ? '<span class="portal-shell-nav-badge">' + escapeHTML(badge) + '</span>'
- : '';
- 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-row">' +
- '<span class="portal-shell-nav-label">' + title + '</span>' +
- badgeHTML +
- '</span>' +
- '</button>'
- );
+interface ShellNavEntry {
+ section: PortalShellSection;
+ title: string;
}
-function renderShellNavigation(accounts: PortalAccountSummary[], activeSection: PortalShellSection): string {
+function visibleShellSections(bootstrap: PortalBootstrapData): ShellNavEntry[] {
+ var accounts = Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];
var hosted = hasHostedAccounts(accounts);
- var workspaces = collectWorkspaces(accounts);
- var totalWorkspaces = workspaces.length;
- var readyWorkspaces = countReadyWorkspaces(workspaces);
- var attentionCount = attentionWorkspaces(workspaces).length;
+ var showSelfHostedCommercial = hasSelfHostedCommercial(bootstrap);
var hostedBillingCount = 0;
- var canManage = false;
for (var i = 0; i < accounts.length; i += 1) {
- if (accounts[i].can_manage) {
- canManage = true;
- }
if (accounts[i].has_billing) {
hostedBillingCount += 1;
}
}
+
+ var sections: ShellNavEntry[] = [];
+ if (hosted) {
+ sections.push({ section: 'workspaces', title: 'Workspaces' });
+ sections.push({ section: 'access', title: 'Access' });
+ }
+ if (hostedBillingCount > 0 || showSelfHostedCommercial) {
+ sections.push({ section: 'billing', title: 'Billing' });
+ }
+ sections.push({ section: 'support', title: 'Support' });
+ if (hosted) {
+ sections.push({ section: 'overview', title: 'Overview' });
+ }
+ return sections;
+}
+
+function shellSectionButton(section: PortalShellSection, activeSection: PortalShellSection, title: string): string {
return (
- '<aside class="portal-shell-nav" aria-label="Pulse Account sections">' +
- '<div class="portal-shell-nav-header">' +
- '<div class="portal-shell-nav-eyebrow">Pulse Account</div>' +
- '<div class="portal-shell-nav-title">' + (hosted ? 'Account' : 'Billing account') + '</div>' +
- '</div>' +
+ '<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-row">' +
+ '<span class="portal-shell-nav-label">' + title + '</span>' +
+ '</span>' +
+ '</button>'
+ );
+}
+
+function renderShellNavigation(bootstrap: PortalBootstrapData, activeSection: PortalShellSection): string {
+ var sections = visibleShellSections(bootstrap);
+ return (
+ '<nav class="portal-shell-nav" aria-label="Pulse Account sections">' +
'<div class="portal-shell-nav-group">' +
- shellSectionButton('overview', activeSection, 'Overview', overviewNavBadgeLabel(hosted, attentionCount, readyWorkspaces)) +
- shellSectionButton('workspaces', activeSection, 'Workspaces', workspacesNavBadgeLabel(hosted, totalWorkspaces)) +
- shellSectionButton('access', activeSection, 'Access', accessNavBadgeLabel(hosted, canManage)) +
- shellSectionButton('billing', activeSection, 'Billing', billingNavBadgeLabel(hostedBillingCount)) +
- shellSectionButton('support', activeSection, 'Support', supportNavBadgeLabel()) +
+ sections.map(function(entry) {
+ return shellSectionButton(entry.section, activeSection, entry.title);
+ }).join('') +
'</div>' +
- '</aside>'
+ '</nav>'
);
}
@@ -845,7 +839,7 @@ function renderShellOverviewSection(context: ShellViewContext): string {
'<div>' +
'<div class="account-panel-kicker">Overview</div>' +
'<h3>Current state</h3>' +
- '<p>Hosted workspace counts and the next available action.</p>' +
+ '<p>Hosted workspace counts, current state, and the next step.</p>' +
renderSectionContextChips(chips) +
'</div>' +
'</div>' +
@@ -1370,7 +1364,13 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string
var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];
var hosted = hasHostedAccounts(accounts);
var showSelfHostedCommercial = hasSelfHostedCommercial(context.bootstrap);
- var activeSection = context.activeSection || preferredPortalShellSection(context.bootstrap);
+ var shellSections = visibleShellSections(context.bootstrap);
+ var preferredSection = context.activeSection || preferredPortalShellSection(context.bootstrap);
+ var activeSection = shellSections.some(function(entry) {
+ return entry.section === preferredSection;
+ })
+ ? preferredSection
+ : (shellSections[0] ? shellSections[0].section : 'billing');
var hostedBillingCount = accounts.filter(function(account) {
return account.has_billing;
}).length;
@@ -1382,108 +1382,121 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string
var selfHostedBillingEscalationCopy = hosted
? 'Escalate with the same hosted billing action or self-hosted path and the exact failed step.'
: 'Escalate with the same self-hosted billing path and the exact failed step.';
- var hostedContent = accounts.length
+ var workspacesContent = accounts.length
? accounts.map(function(account) {
return (
'<section class="account-surface">' +
- '<div class="account-surface-body">' +
- renderAccountWorkspaceSection(account, context.accountAPIBasePath) +
- renderAccountAccessSection(account) +
- '</div>' +
+ renderAccountWorkspaceSection(account, context.accountAPIBasePath) +
'</section>'
);
}).join('')
- : renderNoHostedWorkspacesSection() + renderNoHostedAccessSection();
+ : renderNoHostedWorkspacesSection();
+ var accessContent = accounts.length
+ ? accounts.map(function(account) {
+ return (
+ '<section class="account-surface">' +
+ renderAccountAccessSection(account) +
+ '</section>'
+ );
+ }).join('')
+ : renderNoHostedAccessSection();
return (
'<div class="portal-shell" data-shell-section="' + activeSection + '">' +
- '<div class="portal-shell-layout">' +
- renderShellNavigation(accounts, activeSection) +
- '<div class="portal-shell-main">' +
- (accounts.length === 1 ? renderAccountContextStrip(accounts[0]) : '') +
- '<section class="portal-content-panel portal-content-panel-overview">' +
- renderShellOverviewSection(context) +
- '<div id="accounts-root">' + hostedContent + '</div>' +
- '</section>' +
- '<section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section">' +
- '<div class="billing-header">' +
- '<div>' +
- '<div class="account-panel-kicker">Billing</div>' +
- '<h2>Billing</h2>' +
- renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) +
- '</div>' +
- '<div class="billing-note">' + billingNote + '</div>' +
+ '<div class="portal-shell-main">' +
+ renderPortalContextStrip(accounts, showSelfHostedCommercial) +
+ renderShellNavigation(context.bootstrap, activeSection) +
+ (hosted
+ ? (
+ '<section class="portal-content-panel portal-content-panel-workspaces">' +
+ workspacesContent +
+ '</section>' +
+ '<section class="portal-content-panel portal-content-panel-access">' +
+ accessContent +
+ '</section>' +
+ '<section class="portal-content-panel portal-content-panel-overview">' +
+ renderShellOverviewSection(context) +
+ '</section>'
+ )
+ : '') +
+ '<section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section">' +
+ '<div class="billing-header">' +
+ '<div>' +
+ '<div class="account-panel-kicker">Billing</div>' +
+ '<h2>Billing</h2>' +
+ renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) +
'</div>' +
- (hosted
- ? ('<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + '</div>')
- : '') +
- (showSelfHostedCommercial
- ? ('<div class="billing-shell billing-shell-idle">' +
- '<div class="billing-shell-main">' +
- '<div class="billing-shell-main-head">' +
- '<div class="account-panel-kicker">Self-hosted billing</div>' +
- '<h3>Pick the self-hosted job</h3>' +
- '<p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p>' +
- '</div>' +
- '<div class="billing-action-list">' +
- renderBillingActionRow('open-manage-billing', 'Manage subscriptions', 'Billing', 'Open Stripe for self-hosted plan, invoice, and payment changes.', 'manage-billing-panel', 'manage-inline-email', ['Plan changes', 'Invoices']) +
- renderBillingActionRow('open-retrieve-billing', 'Retrieve licenses', 'Licenses', 'Recover the latest active self-hosted license and invoice link.', 'retrieve-billing-panel', 'retrieve-inline-email', ['Latest active license', 'Invoice lookup']) +
- renderBillingActionRow('open-refund-billing', 'Refund requests', 'Refunds', 'Request a self-serve refund when the purchase is still eligible.', 'refund-billing-panel', 'refund-inline-email', ['Eligibility check', 'Revocation']) +
- renderBillingActionRow('open-data-billing', 'Data and privacy', 'Privacy', 'Request export or deletion for commercial account data.', 'data-billing-panel', 'data-export-email', ['Export', 'Deletion']) +
- '</div>' +
- '<div class="billing-inline-support">' +
- '<div class="account-panel-kicker">Escalation only</div>' +
- '<h4>Use Support only after Billing fails</h4>' +
- '<p>' + selfHostedBillingEscalationCopy + '</p>' +
- '<div class="billing-inline-support-actions">' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button>' +
- '<a class="portal-support-link" href="mailto:' +
- escapeAttr(context.bootstrap.support_email || '') +
- '">' +
- escapeHTML(context.bootstrap.support_email || '') +
- '</a>' +
- '</div>' +
- '</div>' +
+ '<div class="billing-note">' + billingNote + '</div>' +
+ '</div>' +
+ (hosted
+ ? ('<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + '</div>')
+ : '') +
+ (showSelfHostedCommercial
+ ? ('<div class="billing-shell billing-shell-idle">' +
+ '<div class="billing-shell-main">' +
+ '<div class="billing-shell-main-head">' +
+ '<div class="account-panel-kicker">Self-hosted billing</div>' +
+ '<h3>Pick the self-hosted job</h3>' +
+ '<p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p>' +
+ '</div>' +
+ '<div class="billing-action-list">' +
+ renderBillingActionRow('open-manage-billing', 'Manage subscriptions', 'Billing', 'Open Stripe for self-hosted plan, invoice, and payment changes.', 'manage-billing-panel', 'manage-inline-email', ['Plan changes', 'Invoices']) +
+ renderBillingActionRow('open-retrieve-billing', 'Retrieve licenses', 'Licenses', 'Recover the latest active self-hosted license and invoice link.', 'retrieve-billing-panel', 'retrieve-inline-email', ['Latest active license', 'Invoice lookup']) +
+ renderBillingActionRow('open-refund-billing', 'Refund requests', 'Refunds', 'Request a self-serve refund when the purchase is still eligible.', 'refund-billing-panel', 'refund-inline-email', ['Eligibility check', 'Revocation']) +
+ renderBillingActionRow('open-data-billing', 'Data and privacy', 'Privacy', 'Request export or deletion for commercial account data.', 'data-billing-panel', 'data-export-email', ['Export', 'Deletion']) +
'</div>' +
- '<div class="billing-shell-detail" id="billing-detail-shell" hidden>' +
- renderBillingTaskPanel(
- 'Manage subscriptions',
- 'Open Stripe for self-hosted plan, invoice, and payment changes.',
- 'manage-billing-panel',
- '<div id="manage-billing-root"></div>'
- ) +
- renderBillingTaskPanel(
- 'Retrieve licenses',
- 'Recover the latest active self-hosted license and invoice link.',
- 'retrieve-billing-panel',
- '<div id="retrieve-billing-root"></div>'
- ) +
- renderBillingTaskPanel(
- 'Refund requests',
- 'Request a self-serve refund when the purchase is still eligible.',
- 'refund-billing-panel',
- '<div id="refund-billing-root"></div>'
- ) +
- renderBillingTaskPanel(
- 'Data and privacy',
- 'Request export or deletion for commercial account data.',
- 'data-billing-panel',
- '<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:' +
+ '<div class="billing-inline-support">' +
+ '<div class="account-panel-kicker">Escalation only</div>' +
+ '<h4>Use Support only after Billing fails</h4>' +
+ '<p>' + selfHostedBillingEscalationCopy + '</p>' +
+ '<div class="billing-inline-support-actions">' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button>' +
+ '<a class="portal-support-link" href="mailto:' +
escapeAttr(context.bootstrap.support_email || '') +
'">' +
escapeHTML(context.bootstrap.support_email || '') +
- '</a>.</div>'
- ) +
+ '</a>' +
+ '</div>' +
'</div>' +
- '</div>')
- : '') +
- '</section>' +
- '<section class="portal-content-panel portal-content-panel-support">' +
- renderSupportSection(context) +
- '</section>' +
- '</div>' +
+ '</div>' +
+ '<div class="billing-shell-detail" id="billing-detail-shell" hidden>' +
+ renderBillingTaskPanel(
+ 'Manage subscriptions',
+ 'Open Stripe for self-hosted plan, invoice, and payment changes.',
+ 'manage-billing-panel',
+ '<div id="manage-billing-root"></div>'
+ ) +
+ renderBillingTaskPanel(
+ 'Retrieve licenses',
+ 'Recover the latest active self-hosted license and invoice link.',
+ 'retrieve-billing-panel',
+ '<div id="retrieve-billing-root"></div>'
+ ) +
+ renderBillingTaskPanel(
+ 'Refund requests',
+ 'Request a self-serve refund when the purchase is still eligible.',
+ 'refund-billing-panel',
+ '<div id="refund-billing-root"></div>'
+ ) +
+ renderBillingTaskPanel(
+ 'Data and privacy',
+ 'Request export or deletion for commercial account data.',
+ 'data-billing-panel',
+ '<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>' +
+ '</div>')
+ : '') +
+ '</section>' +
+ '<section class="portal-content-panel portal-content-panel-support">' +
+ renderSupportSection(context) +
+ '</section>' +
'</div>' +
'</div>'
);
diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.css
index 45dd476cd3..6375e6fd03 100644
--- a/internal/cloudcp/portal/frontend/src/styles.css
+++ b/internal/cloudcp/portal/frontend/src/styles.css
@@ -4578,3 +4578,334 @@ header .logout-btn,
justify-content: center;
}
}
+
+/* Signed-in portal reset: simpler, flatter account surface */
+.portal-shell-main {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ padding: 0 0 32px;
+}
+
+.portal-shell-main > .portal-content-panel {
+ display: none !important;
+}
+
+.portal-shell[data-shell-section="workspaces"] .portal-content-panel-workspaces,
+.portal-shell[data-shell-section="access"] .portal-content-panel-access,
+.portal-shell[data-shell-section="billing"] .portal-content-panel-billing,
+.portal-shell[data-shell-section="support"] .portal-content-panel-support,
+.portal-shell[data-shell-section="overview"] .portal-content-panel-overview {
+ display: block !important;
+}
+
+.portal-account-context {
+ display: block;
+ padding: 0 0 12px;
+ border: none;
+ border-bottom: 1px solid var(--line);
+ border-radius: 0;
+ background: transparent;
+}
+
+.portal-account-context-copy {
+ gap: 6px;
+}
+
+.portal-account-context-meta {
+ gap: 8px;
+ flex-wrap: wrap;
+}
+
+.portal-account-context-separator {
+ color: var(--line-strong);
+}
+
+.portal-account-context-row-title h2 {
+ font-size: 30px;
+ line-height: 1.04;
+ letter-spacing: -0.04em;
+}
+
+.portal-account-context-copy p {
+ max-width: 820px;
+ font-size: 15px;
+ line-height: 1.55;
+}
+
+.portal-account-context-summary {
+ display: none !important;
+}
+
+.portal-shell-nav {
+ position: static;
+ top: auto;
+ border: none;
+ border-bottom: 1px solid var(--line);
+ background: transparent;
+}
+
+.portal-shell-nav-header {
+ display: none !important;
+}
+
+.portal-shell-nav-group {
+ display: flex;
+ flex-direction: row;
+ gap: 12px;
+ padding: 0 0 4px;
+ overflow-x: auto;
+ overscroll-behavior-x: contain;
+ scrollbar-width: none;
+}
+
+.portal-shell-nav-group::-webkit-scrollbar {
+ display: none;
+}
+
+.portal-shell-nav-link {
+ min-width: 0;
+ padding: 0 8px 10px;
+ border: none;
+ border-bottom: 2px solid transparent;
+ border-radius: 0;
+ background: transparent;
+ color: var(--ink-muted);
+}
+
+.portal-shell-nav-link:hover {
+ background: transparent;
+ color: var(--ink);
+}
+
+.portal-shell-nav-link.active {
+ border: none;
+ border-bottom: 2px solid var(--accent);
+ background: transparent;
+ color: var(--ink);
+}
+
+.portal-shell-nav-row {
+ justify-content: flex-start;
+ gap: 0;
+}
+
+.portal-shell-nav-label {
+ font-size: 14px;
+ font-weight: 600;
+}
+
+.portal-shell-nav-badge {
+ display: none !important;
+}
+
+.portal-content-panel,
+.account-content-panel,
+.account-content-panel-overview,
+.account-content-panel-workspaces,
+.account-content-panel-access,
+.portal-support-panel {
+ padding: 0;
+ border: none;
+ background: transparent;
+ box-shadow: none;
+}
+
+.account-surface + .account-surface {
+ margin-top: 24px;
+}
+
+.account-stage-header,
+.billing-header {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 12px;
+ margin-bottom: 18px;
+}
+
+.account-stage-header h3,
+.billing-header h2,
+.portal-support-panel h2 {
+ font-size: 24px;
+ line-height: 1.12;
+ letter-spacing: -0.03em;
+}
+
+.account-stage-header p,
+.billing-header p,
+.billing-note,
+.portal-support-panel > p {
+ max-width: 760px;
+ font-size: 14px;
+ line-height: 1.55;
+}
+
+.section-context-strip {
+ gap: 0;
+ margin-top: 8px;
+}
+
+.section-context-chip {
+ font-size: 12px;
+}
+
+.section-context-chip + .section-context-chip::before {
+ margin-right: 8px;
+}
+
+.overview-task-grid {
+ grid-template-columns: 1fr;
+ gap: 12px;
+}
+
+.overview-task-card,
+.billing-task-card,
+.portal-support-route-card,
+.portal-support-runbook,
+.workspace-list-wrap,
+.workspace-management-panel,
+.access-roster,
+.access-task-panel,
+.access-invite-panel,
+.access-job-note-panel,
+.access-policy-panel,
+.billing-shell-main,
+.billing-shell-detail,
+.billing-panel {
+ border: 1px solid var(--line);
+ border-radius: 12px;
+ background: #fff;
+}
+
+.overview-task-card,
+.billing-task-card,
+.portal-support-route-card,
+.portal-support-runbook,
+.billing-shell-main,
+.billing-shell-detail,
+.billing-panel {
+ padding: 18px;
+}
+
+.workspace-operations-shell,
+.access-shell,
+.billing-shell,
+.portal-support-layout {
+ grid-template-columns: 1fr;
+ gap: 14px;
+}
+
+.workspace-list-toolbar,
+.access-panel-heading {
+ padding: 16px 18px 10px;
+}
+
+.workspace-list-head {
+ grid-template-columns: minmax(0, 1.6fr) 120px 120px 160px;
+ gap: 12px;
+ padding: 8px 18px;
+}
+
+.workspace-row {
+ grid-template-columns: minmax(0, 1.6fr) 120px 120px 160px;
+ gap: 12px;
+ padding: 14px 18px;
+}
+
+.workspace-actions {
+ flex-wrap: wrap;
+}
+
+.access-management-stats {
+ display: block;
+ margin-bottom: 12px;
+}
+
+.access-stat-summary {
+ padding: 0 0 8px;
+ font-size: 12px;
+ font-weight: 500;
+ color: var(--ink-muted);
+}
+
+.access-stat-summary-error {
+ color: var(--danger);
+}
+
+.access-task-strip {
+ gap: 6px;
+ margin-top: 10px;
+}
+
+.access-task-button {
+ border-radius: 10px;
+}
+
+.access-task-button.active {
+ border-color: var(--accent);
+}
+
+.access-roster-list {
+ padding: 0 18px 8px;
+}
+
+.access-roster-head {
+ padding: 8px 18px;
+}
+
+.access-member-row {
+ padding: 12px 0;
+}
+
+.billing-overview-grid {
+ grid-template-columns: 1fr;
+ gap: 12px;
+}
+
+.billing-note {
+ padding: 0;
+ border: none;
+}
+
+.billing-action-row {
+ padding: 14px 0;
+}
+
+.portal-support-route-grid {
+ gap: 12px;
+}
+
+@media (max-width: 960px) {
+ .portal-shell-main {
+ gap: 16px;
+ }
+
+ .portal-shell-nav-group {
+ gap: 8px;
+ }
+
+ .portal-account-context {
+ padding-bottom: 10px;
+ }
+
+ .portal-account-context-row-title h2,
+ .account-stage-header h3,
+ .billing-header h2,
+ .portal-support-panel h2 {
+ font-size: 22px;
+ }
+}
+
+@media (max-width: 640px) {
+ .portal-shell-nav-link {
+ padding: 0 6px 8px;
+ }
+
+ .portal-account-context-row-title h2 {
+ font-size: 24px;
+ }
+
+ .access-management-stats {
+ grid-template-columns: 1fr;
+ }
+}