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.

Finish Pulse Account workspaces shell

rcourtmancdeb2577549f
diff --git a/docs/release-control/v6/internal/CUSTOMER_ACCOUNT_PORTAL_SPEC.md b/docs/release-control/v6/internal/CUSTOMER_ACCOUNT_PORTAL_SPEC.md
index f56a482647..e6e001f45d 100644
--- a/docs/release-control/v6/internal/CUSTOMER_ACCOUNT_PORTAL_SPEC.md
+++ b/docs/release-control/v6/internal/CUSTOMER_ACCOUNT_PORTAL_SPEC.md
@@ -1,6 +1,6 @@
# Customer Account Portal Spec
-Last updated: 2026-03-25
+Last updated: 2026-04-20
Status: PLANNED
Governance surface: `status.json.coverage_gaps.customer-account-portal-surface`
Candidate lane: `customer-account-portal`
@@ -11,8 +11,9 @@ Pulse v6 now has real customer-facing commercial surfaces across self-hosted
licensing, hosted tenants, MSP provider workflows, billing, refund/recovery
utilities, and account-scoped control-plane actions.
-Those surfaces work, but they do not yet form one coherent authenticated Pulse
-account experience.
+Those surfaces work, and `Pulse Account` now presents them through one coherent
+authenticated shell, but the current lane map still does not govern that
+account surface as one explicit product area.
The purpose of the customer account portal lane is to promote those fragmented
surfaces into one governed product area:
@@ -55,8 +56,9 @@ Today Pulse has:
- hosted organization billing and cloud pricing surfaces
- MSP provider account and tenant-management behavior
-What it does not yet have is one coherent authenticated account portal that
-joins those pieces together.
+What it does not yet have is one explicit governed lane that owns that
+now-coherent account surface end-to-end instead of leaving it split across the
+current commercial and hosted-MSP lanes.
## Goals
@@ -113,48 +115,30 @@ Needs:
## Canonical Information Architecture
-The future portal should converge on this shape:
+The canonical account shell should stay centered on this shape:
-### 1. Home
+### 1. Workspaces
-- account summary
-- active subscriptions and licenses
-- owned hosted tenants
-- outstanding recovery/billing/action-needed state
+- hosted workspaces and entry points
+- inline workspace counts at the top of the page
+- the next obvious workspace action without a separate overview destination
-### 2. Licenses
+### 2. Access
-- self-hosted licenses and activation state
-- entitlement summary
-- continuity / renewal / cancellation state
-- migration guidance where relevant
+- hosted account roster
+- invites, role changes, and access removal when permitted
+- role meaning and ownership clarity
-### 3. Pulse Cloud
+### 3. Billing
-- hosted tenants
-- tenant status and entry points
-- organization/account linkage
-- hosted account-scoped actions
+- hosted billing handoff
+- self-hosted subscriptions, licenses, refunds, and privacy tasks
+- continuity / renewal / cancellation state where relevant
-### 4. Billing
+### 4. Support
-- subscriptions
-- invoices and payment method context
-- tax / VAT / receipt surfaces
-- refund and cancellation/re-entry surfaces
-
-### 5. MSP
-
-- provider account summary
-- customers / workspaces / tenant list
-- operator-scoped admin actions
-- clear separation from normal self-hosted customer flows
-
-### 6. Recovery And Support
-
-- license retrieval
-- account verification flows
-- data request/export/delete
+- escalation only after the owned self-service path fails
+- recovery and support packet expectations
- transition path away from isolated standalone utilities
## Transitional Mapping From Current Surfaces
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index 9fbff66193..4261f672c2 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -3936,7 +3936,7 @@
},
{
"id": "customer-account-portal-surface",
- "summary": "v6 has real billing, checkout, hosted tenant, MSP account, and self-serve utility surfaces, but it still lacks one coherent authenticated Pulse account portal that unifies licenses, hosted tenants, billing, recovery, and MSP admin actions under a canonical customer control surface.",
+ "summary": "Pulse Account now provides one coherent authenticated customer shell across hosted tenants, billing, recovery, and MSP/self-serve commercial actions, but the current lane map still splits that owned account surface across L3/L4 instead of governing it as one explicit customer-account lane.",
"owner": "project-owner",
"status": "planned",
"recorded_at": "2026-03-25",
@@ -3965,6 +3965,16 @@
"path": "internal/cloudcp/account/tenant_handlers.go",
"kind": "file"
},
+ {
+ "repo": "pulse",
+ "path": "internal/cloudcp/portal/frontend/src/shell_view.test.ts",
+ "kind": "file"
+ },
+ {
+ "repo": "pulse",
+ "path": "internal/cloudcp/portal/frontend/src/shell_view.ts",
+ "kind": "file"
+ },
{
"repo": "pulse",
"path": "internal/cloudcp/portal/page.go",
@@ -4170,7 +4180,7 @@
{
"id": "customer-account-portal",
"name": "Customer account portal",
- "summary": "Promote fragmented cloud billing, hosted tenant, self-serve licensing, recovery, and MSP admin surfaces into one governed Pulse account lane with a coherent customer and operator control surface.",
+ "summary": "Promote the now-coherent Pulse Account shell and its cross-surface ownership model into one governed customer-account lane instead of leaving that surface split across L3/L4.",
"status": "planned",
"recorded_at": "2026-03-25",
"target_id": "v6-product-lane-expansion",
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 089537e91f..360c646e1d 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -824,6 +824,13 @@ in shell section from account shape: hosted accounts open on `Workspaces`,
self-hosted-only accounts open on `Billing`, and the signed-in shell keeps
precise workspace counts inline on `Workspaces` instead of exposing a separate
`Summary` tab as a primary or default destination.
+That same typed shell-section contract now excludes `overview` entirely:
+`internal/cloudcp/portal/frontend/src/types.ts`,
+`internal/cloudcp/portal/frontend/src/shell_section.ts`, and
+`internal/cloudcp/portal/frontend/src/shell.ts` may route only the governed
+`workspaces`, `access`, `billing`, and `support` destinations, with hosted
+account arrivals defaulting to `workspaces` and self-hosted-only arrivals
+defaulting to `billing`.
The same account-shape runtime contract must also keep the shell navigation
honest: the task row is `Workspaces`, `Access`, `Billing`, and `Support`.
Self-hosted-only accounts must drop hosted-only `Workspaces` and `Access`
@@ -897,17 +904,22 @@ 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
deploy instead of waiting for asset expiry.
-That same typed overview contract must also preserve a calm, flat account-tool
-visual posture across all portal scenarios: no gradients, heavy shadows, or
-decorative dashboard chrome. The shell uses a compact identity bar (account name,
-role, kind) and a horizontal tab bar for Workspaces, Access, Billing, and
-Support. Content panels render directly below the tab bar without redundant
-page headers, summary strips, or fact chips. Action buttons (Create workspace,
-Invite people, Change roles, Remove access) are integrated into toolbar rows
-within their respective bordered data cards rather than existing as
-free-floating elements above content. Hierarchy is driven by spacing,
-typography, and 1px borders rather than cards, pills, stacked metrics, or
-ornamental side rails competing with the active task.
+That same typed portal page contract must also preserve a calm, flat
+account-tool visual posture across all portal scenarios: no gradients, heavy
+shadows, or decorative dashboard chrome. The shell uses a compact identity bar
+(account name, role, kind) and a horizontal tab bar for Workspaces, Access,
+Billing, and Support. Content panels render directly below the tab bar without
+reintroducing a second shell-level hero, overview panel, summary deck, or
+metric grid ahead of the active task. The `Workspaces` panel may own one
+section header, one quiet inline facts line, and one inline next-action row
+above the workspace list when those elements are part of the same task
+surface; they must not drift into a separate overview destination or duplicate
+context strip. Action buttons (Create workspace, Invite people, Change roles,
+Remove access) are integrated into toolbar rows within their respective
+bordered data cards rather than existing as free-floating elements above
+content. Hierarchy is driven by spacing, typography, and 1px borders rather
+than cards, pills, stacked metrics, or ornamental side rails competing with
+the active task.
That same typed page contract also applies before auth: the signed-out portal
surface must keep one obvious sign-in action plus precise account-scope
presentation, instead of falling back to a separate marketing-like hero and
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 444b227189..188a980d32 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -148,6 +148,13 @@ Community limit enforcement.
portal-targeted magic link carrying tenant identity so the first
authenticated landing is Pulse Account rather than a tenant-runtime-only
redirect.
+ That same portal boundary also owns the signed-in shell shape: hosted
+ arrivals default to `Workspaces`, self-hosted-only arrivals default to
+ `Billing`, and the shell destinations are limited to `Workspaces`,
+ `Access`, `Billing`, and `Support` rather than a separate `Overview` or
+ `Summary` destination. The top of `Workspaces` may surface one quiet inline
+ facts line plus one next-action row before the list, but it must not turn
+ that summary into a second overview deck, metric grid, or competing shell.
7. Add or change Stripe provisioning plan resolution through `internal/cloudcp/stripe/provisioner.go`
8. Add or change activation/grant lifecycle or dev-mode capability widening through `pkg/licensing/dev_mode_features.go`, `pkg/licensing/service.go`, `pkg/licensing/grant_refresh.go`, and `pkg/licensing/revocation_poll.go`
9. Add or change license-server transport through `pkg/licensing/license_server_client.go` and `pkg/licensing/quickstart_bootstrap.go`
@@ -179,7 +186,11 @@ Community limit enforcement.
headers, billing action rows, and the maintained portal bundle under
`internal/cloudcp/portal/` may surface the facts an operator needs, but the
shell should not spend vertical space on duplicate context-chip strips when
- the page header and section body already communicate that scope.
+ the page header and section body already communicate that scope. `Workspaces`
+ may own one inline facts line and one inline next-action row at the top of
+ the section, but that summary treatment must stay inside the same task
+ surface instead of reviving a separate overview panel, summary strip, or
+ metric deck ahead of the real workspace list.
23. Keep self-hosted monitored-system warning CTA intents distinct on the owned
billing surface. `Learn more` links must land on the monitored-system
usage-focused billing state, while `Upgrade to add more` links must land on
@@ -1540,30 +1551,31 @@ describe supported Pulse Mobile pairing as a normal-use Relay capability, and
must not fall back to staged-beta or coming-soon messaging once the owned
pairing/runtime path is live.
The customer-account surface is now also an explicit cloud-paid ownership
-boundary. Pulse already has a real hosted control-plane portal in
+boundary. Pulse now has a coherent authenticated Pulse Account shell in
`internal/cloudcp/portal/`, account/workspace mutation APIs in
`internal/cloudcp/account/tenant_handlers.go`, and transitional self-hosted
-commercial utility pages in `pulse-pro/landing-page/`, but those surfaces do
-not yet form one coherent Pulse account product. The canonical future shape is
-`docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md`: one
+commercial utility pages in `pulse-pro/landing-page/`. The canonical product
+shape is `docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md`: one
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: signed-in workspace counts stay inline at the top of
-`Workspaces` instead of as a separate `Overview` or `Summary` tab, 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 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 one compact context strip
-instead of repeating a desktop-sized intro block or second summary box ahead
-of every task, and lower
+explicitly: signed-in hosted arrivals land on `Workspaces`, not on a separate
+`Overview` or `Summary` destination, and the top of `Workspaces` may render
+only one quiet inline facts line plus one next-action row before the workspace
+list instead of a second summary deck, metric grid, or duplicated overview
+panel. 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 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 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
@@ -1591,12 +1603,14 @@ escalation path and billing-specific handoff packet only, and hosted
workspace/access escalation routes must not render without hosted accounts.
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, 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.
+Navigation chrome, account framing, and inline workspace summary treatment
+must stay visually quieter than the active task surface, with flatter light
+treatment and 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; the
+`Workspaces` surface may add one factual inline summary line and one next-step
+row inside the section itself, but it must not bring back a second summary
+deck competing with the task.
That same owned shell must also open on the first live job instead of a
summary layer: hosted accounts should land in `Workspaces`, and self-hosted-
only accounts should land in `Billing`. The signed-in shell must not expose a
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index e8fa708100..fd44588fbe 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "e8950e21d522eef56000c6801e20706305189e18e3e3ccc36ed54a35e672fa4e",
+ "source_hash": "efda54137fc74a40c6af35cdd3e0c00fcd1864a4ea4d7eedd1c27bacaa957b15",
"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 1184093d7a..80f2d7d67b 100644
--- a/internal/cloudcp/portal/dist/portal_app.css
+++ b/internal/cloudcp/portal/dist/portal_app.css
@@ -279,23 +279,9 @@ header .logout-btn:hover,
.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 {
+.portal-shell[data-shell-section=support] .portal-content-panel-support {
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=access] .account-content-panel-access {
- display: block !important;
-}
-.portal-shell[data-shell-section=overview] .account-content-panel-workspaces,
-.portal-shell[data-shell-section=overview] .account-content-panel-access,
-.portal-shell[data-shell-section=workspaces] .account-content-panel-overview,
-.portal-shell[data-shell-section=workspaces] .account-content-panel-access,
-.portal-shell[data-shell-section=access] .account-content-panel-overview,
-.portal-shell[data-shell-section=access] .account-content-panel-workspaces {
- display: none !important;
-}
.portal-content-panel {
padding: 16px 0 0;
}
@@ -335,7 +321,6 @@ header .logout-btn:hover,
.account-content-panel {
display: block;
}
-.account-content-panel-overview,
.account-content-panel-workspaces,
.account-content-panel-access {
padding: 0;
@@ -1380,76 +1365,62 @@ header .logout-btn:hover,
.support-link {
color: var(--accent);
}
-.overview-task-grid,
-.overview-task-grid-compact {
+.workspace-summary-shell {
display: flex;
flex-direction: column;
- gap: 0;
- border: 1px solid var(--border);
- border-radius: var(--radius);
- overflow: hidden;
+ gap: 16px;
+}
+.workspace-summary-shell + .account-surface {
+ margin-top: 24px;
+ padding-top: 20px;
+ border-top: 1px solid var(--border);
}
-.overview-task-card {
+.workspace-summary-facts {
display: flex;
- flex-direction: column;
+ flex-wrap: wrap;
gap: 8px;
- padding: 12px 16px;
- border-top: 1px solid var(--border-muted);
- background: var(--bg);
-}
-.overview-task-card:first-child {
- border-top: none;
+ font-size: 12px;
+ color: var(--ink-secondary);
}
-.overview-task-card h4 {
- margin: 0;
- font-size: 14px;
- font-weight: 600;
+.workspace-summary-facts span {
+ white-space: nowrap;
}
-.overview-task-card p {
- margin: 0;
- font-size: 13px;
- color: var(--ink-secondary);
+.portal-fact-separator {
+ color: var(--border);
}
-.overview-task-list {
+.workspace-summary-inline {
display: flex;
- flex-direction: column;
- gap: 0;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 0 0 16px;
+ border-bottom: 1px solid var(--border);
}
-.overview-task-item {
+.workspace-summary-inline-copy {
display: flex;
flex-direction: column;
- gap: 2px;
- padding: 8px 0;
- border-top: 1px solid var(--border-muted);
-}
-.overview-task-item:first-child {
- border-top: none;
- padding-top: 0;
+ gap: 4px;
+ min-width: 0;
}
-.overview-task-item strong {
+.workspace-summary-inline-copy p {
+ margin: 0;
font-size: 13px;
- color: var(--ink);
-}
-.overview-task-item span {
- font-size: 12px;
color: var(--ink-secondary);
}
-.overview-task-item-action {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
+.workspace-summary-inline-copy p:first-child {
+ color: var(--ink);
}
-.overview-task-copy {
- display: flex;
- flex-direction: column;
- gap: 2px;
- min-width: 0;
+.workspace-summary-inline-copy strong {
+ color: var(--ink);
}
-.overview-task-actions {
+.workspace-summary-actions {
display: flex;
+ flex-wrap: wrap;
gap: 8px;
- margin-top: 4px;
+ justify-content: flex-end;
+}
+.workspace-summary-link:hover {
+ text-decoration: none;
}
.account-panel-kicker,
.billing-card-kicker,
@@ -1596,55 +1567,6 @@ header .logout-btn:hover,
font-size: 13px;
color: var(--ink-secondary);
}
-.portal-page-facts {
- display: none;
-}
-.portal-summary-strip {
- display: none;
-}
-.portal-account-block-header {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- gap: 12px;
- margin-bottom: 12px;
-}
-.portal-account-block-copy h3 {
- margin: 0;
- font-size: 14px;
- font-weight: 600;
-}
-.portal-account-block-copy p {
- margin: 4px 0 0;
- font-size: 13px;
- color: var(--ink-secondary);
-}
-.portal-account-block-facts {
- display: none;
-}
-.portal-account-block-actions {
- display: flex;
- gap: 8px;
-}
-.section-context-strip {
- display: none;
-}
-.account-stage-header {
- display: flex;
- flex-direction: column;
- gap: 4px;
- margin-bottom: 12px;
-}
-.account-stage-header h3 {
- margin: 0;
- font-size: 14px;
- font-weight: 600;
-}
-.account-stage-header p {
- margin: 0;
- font-size: 13px;
- color: var(--ink-secondary);
-}
.spinner {
display: inline-block;
width: 16px;
@@ -1703,6 +1625,13 @@ header .logout-btn:hover,
.portal-identity-bar h2 {
font-size: 18px;
}
+ .workspace-summary-inline {
+ flex-direction: column;
+ align-items: stretch;
+ }
+ .workspace-summary-actions {
+ justify-content: flex-start;
+ }
.workspace-list-head {
display: none;
}
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 48c71572d9..0dd7a345bf 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -728,16 +728,13 @@
var accounts = Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];
var hasHostedAccounts2 = accounts.length > 0;
var hasSelfHostedCommercial2 = bootstrap.has_self_hosted_commercial === true || !hasHostedAccounts2;
- if (!bootstrap.authenticated) {
- return "overview";
- }
if (hasHostedAccounts2) {
return "workspaces";
}
if (hasSelfHostedCommercial2) {
return "billing";
}
- return "overview";
+ return "billing";
}
// src/state.ts
@@ -2217,11 +2214,20 @@
if (account.kind === "individual") return "Hosted account";
return account.kind_label ? account.kind_label + " account" : "Account";
}
- function reviewWorkspaceHeadline(count) {
- return count === 1 ? "1 workspace needs review" : String(count) + " workspaces need review";
+ function workspaceCountLabel(count) {
+ return count === 1 ? "1 workspace" : String(count) + " workspaces";
+ }
+ function accountCountLabel(count) {
+ return count === 1 ? "1 account" : String(count) + " accounts";
+ }
+ function reviewWorkspaceChipLabel(count) {
+ return count === 1 ? "1 workspace to review" : String(count) + " workspaces to review";
}
- function readyWorkspaceHeadline(count) {
- return count === 1 ? "1 workspace is ready to use" : String(count) + " workspaces are ready to use";
+ function readyWorkspaceChipLabel(count) {
+ return count === 1 ? "1 ready workspace" : String(count) + " ready workspaces";
+ }
+ function suspendedWorkspaceChipLabel(count) {
+ return count === 1 ? "1 suspended workspace" : String(count) + " suspended workspaces";
}
function supportRunbookPathCopy(hasHostedAccounts2, hostedViewOnly, showSelfHostedCommercial) {
if (!hasHostedAccounts2) return "Billing, licenses, refunds, or privacy.";
@@ -2282,7 +2288,7 @@
}
return total;
}
- function collectOverviewWorkspaceEntries(accounts) {
+ function collectWorkspaceSummaryEntries(accounts) {
var results = [];
for (var i = 0; i < accounts.length; i += 1) {
var workspaces = Array.isArray(accounts[i].workspaces) ? accounts[i].workspaces : [];
@@ -2328,6 +2334,12 @@
function renderSectionContextChips(chips) {
return "";
}
+ function renderFactLine(className, facts) {
+ if (!facts.length) return "";
+ return '<div class="' + className + '">' + facts.map(function(fact) {
+ return "<span>" + escapeHTML(fact) + "</span>";
+ }).join('<span class="portal-fact-separator">\u2022</span>') + "</div>";
+ }
function attentionWorkspaces(workspaces) {
var results = [];
for (var i = 0; i < workspaces.length; i += 1) {
@@ -2382,6 +2394,12 @@
return '<button class="' + cls + '" type="button" data-shell-action="activate-section" data-shell-section="' + entry.section + '">' + entry.title + "</button>";
}).join("") + "</nav>";
}
+ function workspaceListAnchorID(accountID) {
+ return "workspace-list-" + accountID;
+ }
+ function workspaceRowAnchorID(accountID, workspaceID) {
+ return "workspace-row-" + accountID + "-" + workspaceID;
+ }
function renderWorkspaceCard(account, workspace, accountAPIBasePath) {
var status = workspaceHealthState(workspace);
var state = String(workspace.state || "");
@@ -2401,7 +2419,7 @@
if (account.can_manage && (state === "active" || state === "suspended" || state === "failed")) {
manageAction = '<button type="button" class="btn-secondary btn-workspace-manage" data-action="select-workspace" data-account-id="' + escapeAttr(account.id) + '" data-workspace-id="' + escapeAttr(workspace.id) + '">Lifecycle</button>';
}
- return '<article class="workspace-row workspace-row-health-' + escapeAttr(status) + " workspace-row-state-" + escapeAttr(state || "unknown") + '" data-workspace-row="' + escapeAttr(workspace.id) + '"><div class="workspace-row-primary"><div class="workspace-row-heading"><h4 class="workspace-name">' + escapeHTML(workspace.display_name) + '</h4><div class="workspace-meta">' + metaParts.join("") + '</div></div><div class="workspace-row-note">' + escapeHTML(workspaceRowNote(workspace)) + '</div></div><div class="workspace-row-status-cell workspace-row-status-cell-badge">' + healthBadgeHTML(workspace) + '</div><div class="workspace-row-status-cell workspace-row-status-cell-badge"><span class="badge badge-' + escapeHTML(state || "unknown") + '">' + escapeHTML(titleCase(state || "Unknown")) + '</span></div><div class="workspace-actions">' + openAction + manageAction + "</div></article>";
+ return '<article class="workspace-row workspace-row-health-' + escapeAttr(status) + " workspace-row-state-" + escapeAttr(state || "unknown") + '" id="' + escapeAttr(workspaceRowAnchorID(account.id, workspace.id)) + '" data-workspace-row="' + escapeAttr(workspace.id) + '"><div class="workspace-row-primary"><div class="workspace-row-heading"><h4 class="workspace-name">' + escapeHTML(workspace.display_name) + '</h4><div class="workspace-meta">' + metaParts.join("") + '</div></div><div class="workspace-row-note">' + escapeHTML(workspaceRowNote(workspace)) + '</div></div><div class="workspace-row-status-cell workspace-row-status-cell-badge">' + healthBadgeHTML(workspace) + '</div><div class="workspace-row-status-cell workspace-row-status-cell-badge"><span class="badge badge-' + escapeHTML(state || "unknown") + '">' + escapeHTML(titleCase(state || "Unknown")) + '</span></div><div class="workspace-actions">' + openAction + manageAction + "</div></article>";
}
function renderWorkspaceHandoffForm(accountID, workspaceID, accountAPIBasePath, label, buttonClassName = "btn-secondary btn-compact") {
if (!accountAPIBasePath) {
@@ -2409,7 +2427,7 @@
}
return '<form method="POST" action="' + escapeAttr(accountAPIBasePath + "/" + accountID + "/tenants/" + workspaceID + "/handoff") + '"><button type="submit" class="' + escapeAttr(buttonClassName) + '">' + escapeHTML(label) + "</button></form>";
}
- function attentionOverviewEntries(entries) {
+ function attentionWorkspaceEntries(entries) {
var results = [];
for (var i = 0; i < entries.length; i += 1) {
var status = workspaceHealthState(entries[i].workspace);
@@ -2419,7 +2437,7 @@
}
return results;
}
- function readyOverviewEntries(entries) {
+ function readyWorkspaceEntries(entries) {
var results = [];
for (var i = 0; i < entries.length; i += 1) {
if (String(entries[i].workspace.state || "") === "active" && workspaceHealthState(entries[i].workspace) === "healthy") {
@@ -2428,54 +2446,26 @@
}
return results;
}
- function overviewWorkspaceContext(entry, includeAccountName, note) {
+ function suspendedWorkspaceEntries(entries) {
+ var results = [];
+ for (var i = 0; i < entries.length; i += 1) {
+ if (String(entries[i].workspace.state || "") === "suspended") {
+ results.push(entries[i]);
+ }
+ }
+ return results;
+ }
+ function workspaceSummaryContext(entry, includeAccountName, note) {
if (!includeAccountName) return note;
return entry.account.name + " \xB7 " + note;
}
- function renderOverviewAttentionCard(accounts, entries, showSelfHostedCommercial) {
- var attention = attentionOverviewEntries(entries);
- var ready = readyOverviewEntries(entries);
- var includeAccountName = accounts.length > 1;
- var suspendedCount = countWorkspacesByState(entries.map(function(entry) {
- return entry.workspace;
- }), "suspended");
- if (!attention.length) {
- return '<article class="overview-task-card"><div class="account-panel-kicker">Needs attention</div><h4>' + escapeHTML(accounts.length > 0 ? reviewWorkspaceHeadline(0) : "0 hosted workspaces need review") + "</h4><p>" + escapeHTML(
- entries.length > 0 ? "No active workspace is failed or waiting on a completed health check." : accounts.length > 0 ? "No hosted workspace is attached to this account yet." : "No hosted account is attached to this sign-in."
- ) + '</p><div class="overview-task-list"><div class="overview-task-item"><strong>Ready</strong><span>' + escapeHTML(
- entries.length > 0 ? readyWorkspaceHeadline(ready.length) : accounts.length > 0 ? readyWorkspaceHeadline(0) : "0 hosted workspaces are ready to use"
- ) + '</span></div><div class="overview-task-item"><strong>Suspended</strong><span>' + escapeHTML(
- suspendedCount > 0 ? suspendedCount === 1 ? "1 workspace is suspended. Resume it before opening it again." : String(suspendedCount) + " workspaces are suspended. Resume them before opening them again." : "0 suspended workspaces."
- ) + "</span></div></div></article>";
- }
- return '<article class="overview-task-card overview-task-card-attention"><div class="account-panel-kicker">Needs attention</div><h4>' + escapeHTML(reviewWorkspaceHeadline(attention.length)) + '</h4><p>Each listed workspace is failed or still waiting on a completed health check.</p><div class="overview-task-list">' + attention.slice(0, 3).map(function(entry) {
- return '<div class="overview-task-item"><strong>' + escapeHTML(entry.workspace.display_name) + "</strong><span>" + escapeHTML(overviewWorkspaceContext(entry, includeAccountName, workspaceStatusCopy(entry.workspace))) + "</span></div>";
- }).join("") + "</div></article>";
- }
- function renderOverviewReadyCard(accounts, entries, accountAPIBasePath) {
- var ready = readyOverviewEntries(entries);
- var includeAccountName = accounts.length > 1;
- var totalWorkspaces = countWorkspaces(accounts);
- var canManageHosted = accounts.some(function(account) {
- return account.can_manage;
- });
- var suspendedCount = countWorkspacesByState(entries.map(function(entry) {
- return entry.workspace;
- }), "suspended");
- if (!ready.length) {
- return '<article class="overview-task-card"><div class="account-panel-kicker">Ready</div><h4>' + escapeHTML(
- !accounts.length ? "Billing is available" : readyWorkspaceHeadline(0)
- ) + "</h4><p>" + escapeHTML(
- !accounts.length ? "Use Billing for self-hosted subscriptions, licenses, refunds, and privacy requests." : totalWorkspaces > 0 ? suspendedCount === totalWorkspaces ? "Every hosted workspace is suspended right now." : "Open Workspaces to see the current state of each hosted workspace." : canManageHosted ? "No hosted workspace exists yet. Create the first one in Workspaces." : "No hosted workspace exists yet. An owner or admin must create the first one."
- ) + "</p></article>";
- }
- return '<article class="overview-task-card"><div class="account-panel-kicker">Ready</div><h4>' + escapeHTML(readyWorkspaceHeadline(ready.length)) + '</h4><p>Each listed workspace is active and passed its latest health check.</p><div class="overview-task-list">' + ready.slice(0, 3).map(function(entry) {
- return '<div class="overview-task-item overview-task-item-action"><div class="overview-task-copy"><strong>' + escapeHTML(entry.workspace.display_name) + "</strong><span>" + escapeHTML(overviewWorkspaceContext(entry, includeAccountName, workspaceRowNote(entry.workspace))) + "</span></div>" + renderWorkspaceHandoffForm(entry.account.id, entry.workspace.id, accountAPIBasePath, "Open workspace") + "</div>";
- }).join("") + "</div></article>";
- }
- function renderOverviewNextActionCard(accounts, entries, accountAPIBasePath, showSelfHostedCommercial) {
- var attention = attentionOverviewEntries(entries);
- var ready = readyOverviewEntries(entries);
+ function renderWorkspaceAnchorAction(anchorID, label, className = "btn-secondary btn-compact workspace-summary-link") {
+ return '<a class="' + escapeAttr(className) + '" href="#' + escapeAttr(anchorID) + '">' + escapeHTML(label) + "</a>";
+ }
+ function renderWorkspaceSummaryDecision(accounts, entries, accountAPIBasePath, showSelfHostedCommercial) {
+ var attention = attentionWorkspaceEntries(entries);
+ var suspended = suspendedWorkspaceEntries(entries);
+ var ready = readyWorkspaceEntries(entries);
var primaryAction = "";
var secondaryAction = "";
var title = "";
@@ -2484,43 +2474,53 @@
var creatableAccount = accounts.find(function(account) {
return account.kind === "msp" && account.can_manage;
}) || null;
- var billingAccount = accounts.find(function(account) {
- return account.has_billing && account.can_manage;
- }) || null;
var accessAccount = accounts.find(function(account) {
return account.can_manage;
}) || null;
var hostedViewOnly = accounts.length > 0 && !accessAccount;
if (attention.length) {
- title = "Open Workspaces";
- description = attention.length > 1 ? "Open Workspaces to review each failed or pending workspace." : "Open Workspaces to review " + attention[0].workspace.display_name + ".";
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button>';
- secondaryAction = accessAccount ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>' : "";
+ var attentionEntry = attention[0];
+ title = "Review " + attentionEntry.workspace.display_name;
+ description = workspaceSummaryContext(attentionEntry, accounts.length > 1, workspaceStatusCopy(attentionEntry.workspace));
+ primaryAction = renderWorkspaceAnchorAction(
+ workspaceRowAnchorID(attentionEntry.account.id, attentionEntry.workspace.id),
+ "Review workspace",
+ "btn-primary btn-compact workspace-summary-link"
+ );
+ secondaryAction = attentionEntry.account.can_manage && (attentionEntry.workspace.state === "active" || attentionEntry.workspace.state === "suspended" || attentionEntry.workspace.state === "failed") ? '<button type="button" class="btn-secondary btn-compact" data-action="select-workspace" data-account-id="' + escapeAttr(attentionEntry.account.id) + '" data-workspace-id="' + escapeAttr(attentionEntry.workspace.id) + '">Open lifecycle</button>' : '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ } else if (suspended.length) {
+ var suspendedEntry = suspended[0];
+ title = "Review " + suspendedEntry.workspace.display_name;
+ description = workspaceSummaryContext(suspendedEntry, accounts.length > 1, workspaceStatusCopy(suspendedEntry.workspace));
+ primaryAction = renderWorkspaceAnchorAction(
+ workspaceRowAnchorID(suspendedEntry.account.id, suspendedEntry.workspace.id),
+ "Review workspace",
+ "btn-primary btn-compact workspace-summary-link"
+ );
+ secondaryAction = suspendedEntry.account.can_manage ? '<button type="button" class="btn-secondary btn-compact" data-action="select-workspace" data-account-id="' + escapeAttr(suspendedEntry.account.id) + '" data-workspace-id="' + escapeAttr(suspendedEntry.workspace.id) + '">Open lifecycle</button>' : '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
} else if (ready.length) {
- title = "Open workspace";
- description = accounts.length > 1 ? "Open " + ready[0].workspace.display_name + " in " + ready[0].account.name + "." : "Open the ready workspace.";
- primaryAction = renderWorkspaceHandoffForm(ready[0].account.id, ready[0].workspace.id, accountAPIBasePath, "Open " + ready[0].workspace.display_name, "btn-primary btn-compact");
- secondaryAction = ready.length > 1 ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">See all workspaces</button>' : "";
+ var readyEntry = ready[0];
+ title = "Open " + readyEntry.workspace.display_name;
+ description = workspaceSummaryContext(readyEntry, accounts.length > 1, workspaceRowNote(readyEntry.workspace));
+ primaryAction = renderWorkspaceHandoffForm(
+ readyEntry.account.id,
+ readyEntry.workspace.id,
+ accountAPIBasePath,
+ "Open workspace",
+ "btn-primary btn-compact"
+ );
+ secondaryAction = ready.length > 1 ? renderWorkspaceAnchorAction(workspaceListAnchorID(readyEntry.account.id), "See all workspaces") : "";
} else if (creatableAccount) {
- title = "Create workspace";
- description = "No workspace is ready. Create a workspace in " + creatableAccount.name + ".";
+ title = "Create the first workspace";
+ description = "No hosted workspace is attached yet. Create the first workspace in " + creatableAccount.name + ".";
primaryAction = '<button class="btn-primary btn-compact" type="button" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(creatableAccount.id) + '">Create workspace</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
- } else if (billingAccount) {
- title = "Open billing";
- description = "Use Billing for invoices, payment methods, or subscription changes.";
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
secondaryAction = accessAccount ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>' : "";
- } else if (!accounts.length) {
- title = "Open billing";
- description = "Use Billing for self-hosted subscriptions, licenses, refunds, or privacy requests.";
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
} else if (hostedViewOnly) {
- if (totalWorkspaces > 0) {
- title = "Review workspace state";
- description = "No workspace is ready. Open Workspaces to review current state, then hand off changes to an owner or admin.";
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ if (entries.length > 0) {
+ title = "Review who can act";
+ description = "Hosted workspaces are attached here, but an owner or admin must make account-level changes.";
+ primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ secondaryAction = renderWorkspaceAnchorAction(workspaceListAnchorID(accounts[0].id), "Review workspace list");
} else {
title = "Review who can act";
description = showSelfHostedCommercial ? "No hosted workspace is attached. Review Access to see who can manage this hosted account, or use Billing for self-hosted tasks." : "No hosted workspace is attached yet. Review Access to see who can create or manage the first workspace on this account.";
@@ -2530,21 +2530,47 @@
} else if (accessAccount) {
title = "Open access";
description = "Use Access for invites, role changes, or access removal.";
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open access</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
+ primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ secondaryAction = showSelfHostedCommercial ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>' : "";
} else {
title = "Open billing or support";
- description = "Use Billing for commercial work. Use Support only after the billing path fails.";
+ description = totalWorkspaces > 0 ? "Review the workspace list here, then use Billing for commercial work or Support only after a self-service path fails." : "Use Billing for commercial work. Use Support only after the billing path fails.";
primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="support">Escalate</button>';
}
- return '<article class="overview-task-card overview-task-card-next"><div class="account-panel-kicker">Next action</div><h4>' + escapeHTML(title) + "</h4><p>" + escapeHTML(description) + '</p><div class="overview-task-actions">' + primaryAction + secondaryAction + "</div></article>";
+ return {
+ title,
+ description,
+ primaryAction,
+ secondaryAction
+ };
+ }
+ function renderWorkspaceSummaryFacts(accounts, entries) {
+ return [
+ accountCountLabel(accounts.length),
+ workspaceCountLabel(entries.length),
+ readyWorkspaceChipLabel(readyWorkspaceEntries(entries).length),
+ reviewWorkspaceChipLabel(attentionWorkspaceEntries(entries).length),
+ suspendedWorkspaceChipLabel(suspendedWorkspaceEntries(entries).length)
+ ];
+ }
+ function renderWorkspaceSummaryInline(accounts, entries, accountAPIBasePath, showSelfHostedCommercial) {
+ var decision = renderWorkspaceSummaryDecision(accounts, entries, accountAPIBasePath, showSelfHostedCommercial);
+ return '<section class="workspace-summary-inline"><div class="workspace-summary-inline-copy"><p><strong>Next:</strong> ' + escapeHTML(decision.title) + "</p><p>" + escapeHTML(decision.description) + '</p></div><div class="workspace-summary-actions">' + decision.primaryAction + decision.secondaryAction + "</div></section>";
+ }
+ function workspaceSectionHeaderCopy(accounts, entries) {
+ if (!entries.length) {
+ return accounts.some(function(account) {
+ return account.can_manage;
+ }) ? "Review hosted workspaces here, then create the next workspace when you are ready." : "Review hosted workspace state here. An owner or admin must create or change hosted workspaces.";
+ }
+ return "Review hosted workspace health here, open the next ready workspace, and use Lifecycle only when an account-level change is required.";
}
- function renderShellOverviewSection(context) {
+ function renderWorkspaceSummarySection(context) {
var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];
- var entries = collectOverviewWorkspaceEntries(accounts);
+ var entries = collectWorkspaceSummaryEntries(accounts);
var showSelfHostedCommercial = hasSelfHostedCommercial(context.bootstrap);
- return '<section class="account-content-panel account-content-panel-overview"><div class="overview-task-grid overview-task-grid-compact">' + renderOverviewAttentionCard(accounts, entries, showSelfHostedCommercial) + renderOverviewReadyCard(accounts, entries, context.accountAPIBasePath) + renderOverviewNextActionCard(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) + "</div></section>";
+ return '<section class="workspace-summary-shell"><div class="portal-page-header"><h2>Workspaces</h2><p>' + escapeHTML(workspaceSectionHeaderCopy(accounts, entries)) + "</p></div>" + renderFactLine("workspace-summary-facts", renderWorkspaceSummaryFacts(accounts, entries)) + renderWorkspaceSummaryInline(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) + "</section>";
}
function renderNoHostedWorkspacesSection() {
return '<section class="account-content-panel account-content-panel-workspaces"><div class="empty-state"><p>No hosted workspaces are attached to this account. Use Billing for self-hosted subscriptions and licenses.</p></div></section>';
@@ -2570,7 +2596,7 @@
}
workspaceManagement = '<section class="workspace-management-panel workspace-management-panel-idle" id="workspace-management-' + escapeAttr(account.id) + '" hidden><div class="workspace-management-header"><div><h3>Workspace lifecycle</h3><p>Manage this workspace or create a new one.</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) + '">Close panel</button></div><div class="workspace-management-empty" id="workspace-management-empty-' + escapeAttr(account.id) + '"><div class="workspace-management-empty-shell"><div class="workspace-management-empty-actions-card"><div class="workspace-management-empty-actions-copy"><h4>Create a workspace</h4><p>Add a new hosted workspace for a customer or operating boundary.</p></div>' + addWorkspaceForm + '</div><div class="workspace-management-empty-note">Access changes stay in Access. Billing changes stay in Billing.</div></div></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-facts"><div class="workspace-management-fact"><span>Health</span><strong id="workspace-management-health-' + escapeAttr(account.id) + '"></strong></div><div class="workspace-management-fact"><span>Lifecycle</span><strong id="workspace-management-lifecycle-' + escapeAttr(account.id) + '"></strong></div><div class="workspace-management-fact"><span>Created</span><strong id="workspace-management-created-' + escapeAttr(account.id) + '"></strong></div></div><div class="workspace-management-guidance" id="workspace-management-guidance-' + escapeAttr(account.id) + '"></div><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-wrap">' + (workspaceHeaderActions ? '<div class="workspace-list-toolbar">' + workspaceHeaderActions + "</div>" : "") + '<div class="workspace-list-head"><span>Workspace</span><span>Health</span><span>Lifecycle</span><span>Actions</span></div><div class="workspace-list">' + workspaces.map(function(workspace) {
+ var workspaceHTML = workspaces.length ? '<div class="workspace-list-wrap" id="' + escapeAttr(workspaceListAnchorID(account.id)) + '">' + (workspaceHeaderActions ? '<div class="workspace-list-toolbar">' + workspaceHeaderActions + "</div>" : "") + '<div class="workspace-list-head"><span>Workspace</span><span>Health</span><span>Lifecycle</span><span>Actions</span></div><div class="workspace-list">' + workspaces.map(function(workspace) {
return renderWorkspaceCard(account, workspace, accountAPIBasePath);
}).join("") + "</div></div>" : '<div class="empty-state"><p>' + escapeHTML(account.can_manage ? "No hosted workspaces yet. Create one to get started." : "No hosted workspaces are attached yet. An owner or admin must create the first one.") + "</p>" + (workspaceHeaderActions ? '<div style="margin-top: 8px">' + workspaceHeaderActions + "</div>" : "") + "</div>";
return '<section class="account-content-panel account-content-panel-workspaces"><div class="workspace-operations-shell workspace-operations-shell-idle" id="workspace-operations-shell-' + escapeAttr(account.id) + '"><div class="workspace-operations-detail" id="workspace-operations-detail-' + escapeAttr(account.id) + '" hidden>' + workspaceManagement + '</div><div class="workspace-operations-main">' + workspaceHTML + "</div></div></section>";
@@ -2642,6 +2668,7 @@
var workspacesContent = accounts.length ? accounts.map(function(account) {
return '<section class="account-surface">' + renderAccountWorkspaceSection(account, context.accountAPIBasePath) + "</section>";
}).join("") : renderNoHostedWorkspacesSection();
+ var workspaceSummaryContent = hosted ? renderWorkspaceSummarySection(context) : "";
var accessContent = accounts.length ? accounts.map(function(account) {
return '<section class="account-surface">' + renderAccountAccessSection(account) + "</section>";
}).join("") : renderNoHostedAccessSection();
@@ -2674,7 +2701,7 @@
'<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>"
);
}
- return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-main">' + renderIdentityBar(accounts, showSelfHostedCommercial) + renderTabBar(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">' + (hosted ? renderHostedBillingCards(accounts, showSelfHostedCommercial) : "") + (showSelfHostedBillingShell ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><h3>Self-hosted billing</h3><p>' + escapeHTML(selfHostedBillingLeadCopy) + '</p></div><div class="billing-action-list">' + selfHostedBillingActionsHTML + '</div><div class="billing-inline-support"><h4>Support</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>' + selfHostedBillingPanelsHTML + "</div></div>" : "") + '</section><section class="portal-content-panel portal-content-panel-support">' + renderSupportSection(context) + "</section></div></div>";
+ return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-main">' + renderIdentityBar(accounts, showSelfHostedCommercial) + renderTabBar(context.bootstrap, activeSection) + (hosted ? '<section class="portal-content-panel portal-content-panel-workspaces">' + workspaceSummaryContent + workspacesContent + '</section><section class="portal-content-panel portal-content-panel-access">' + accessContent + "</section>" : "") + '<section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section">' + (hosted ? renderHostedBillingCards(accounts, showSelfHostedCommercial) : "") + (showSelfHostedBillingShell ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><h3>Self-hosted billing</h3><p>' + escapeHTML(selfHostedBillingLeadCopy) + '</p></div><div class="billing-action-list">' + selfHostedBillingActionsHTML + '</div><div class="billing-inline-support"><h4>Support</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>' + selfHostedBillingPanelsHTML + "</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>";
@@ -2760,7 +2787,7 @@
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";
+ var section = target.getAttribute("data-shell-section") || deps.store.getShellState().activeSection || "billing";
deps.store.setActiveShellSection(section);
if (deps.onSectionChange) {
deps.onSectionChange(section);
diff --git a/internal/cloudcp/portal/frontend/src/account_controller.ts b/internal/cloudcp/portal/frontend/src/account_controller.ts
index 7f0fd3d77a..626ad0d053 100644
--- a/internal/cloudcp/portal/frontend/src/account_controller.ts
+++ b/internal/cloudcp/portal/frontend/src/account_controller.ts
@@ -3,7 +3,7 @@ import type { AccountRuntime } from './account_runtime';
export interface AccountControllerDeps {
runtime: AccountRuntime;
- setShellSection: (section: 'overview' | 'workspaces' | 'access' | 'billing' | 'support') => void;
+ setShellSection: (section: 'workspaces' | 'access' | 'billing' | 'support') => void;
}
export function installAccountController(deps: AccountControllerDeps): void {
diff --git a/internal/cloudcp/portal/frontend/src/billing_controller.ts b/internal/cloudcp/portal/frontend/src/billing_controller.ts
index 7c74351f13..088dbbd642 100644
--- a/internal/cloudcp/portal/frontend/src/billing_controller.ts
+++ b/internal/cloudcp/portal/frontend/src/billing_controller.ts
@@ -1,7 +1,7 @@
import { asHTMLElement } from './billing_view';
export interface BillingControllerDeps {
- setShellSection: (section: 'overview' | 'workspaces' | 'access' | 'billing' | 'support') => void;
+ setShellSection: (section: 'workspaces' | 'access' | 'billing' | 'support') => void;
toggleBillingPanel: (panelID: string) => void;
clearBillingPanel: () => void;
focusElement: (id: string) => void;
diff --git a/internal/cloudcp/portal/frontend/src/shell.ts b/internal/cloudcp/portal/frontend/src/shell.ts
index 02855a0783..631c3b4b88 100644
--- a/internal/cloudcp/portal/frontend/src/shell.ts
+++ b/internal/cloudcp/portal/frontend/src/shell.ts
@@ -88,7 +88,7 @@ export function installShell(deps: ShellDeps): void {
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;
+ var section = (target.getAttribute('data-shell-section') || deps.store.getShellState().activeSection || 'billing') as PortalShellSection;
deps.store.setActiveShellSection(section);
if (deps.onSectionChange) {
deps.onSectionChange(section);
diff --git a/internal/cloudcp/portal/frontend/src/shell_section.ts b/internal/cloudcp/portal/frontend/src/shell_section.ts
index 63c06257bc..01b3d20d2c 100644
--- a/internal/cloudcp/portal/frontend/src/shell_section.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_section.ts
@@ -7,14 +7,11 @@ export function preferredPortalShellSection(
var hasHostedAccounts = accounts.length > 0;
var hasSelfHostedCommercial = bootstrap.has_self_hosted_commercial === true || !hasHostedAccounts;
- if (!bootstrap.authenticated) {
- return 'overview';
- }
if (hasHostedAccounts) {
return 'workspaces';
}
if (hasSelfHostedCommercial) {
return 'billing';
}
- return 'overview';
+ return 'billing';
}
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index f6a0dc522f..3d9d2c4e6c 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -3,10 +3,10 @@ import { describe, expect, it } from 'vitest';
import type { PortalBillingState, PortalBootstrapData, PortalLoginState } from './types';
import { createPortalBillingState } from './state';
import {
- renderAccountsHTML,
renderAuthenticatedPortalHTML,
renderHeaderHTML,
renderSignedOutPortalHTML,
+ renderWorkspaceSummarySection,
type ShellViewContext,
} from './shell_view';
@@ -93,10 +93,40 @@ describe('shell view', function() {
expect(renderSignedOutPortalHTML(context)).not.toContain('Create account');
});
- it('renders empty accounts state with support contact', function() {
- var html = renderAccountsHTML(createContext());
+ it('renders workspace summary inside the canonical workspaces shell', function() {
+ var html = renderWorkspaceSummarySection(
+ createContext({
+ bootstrap: createBootstrap({
+ accounts: [
+ {
+ id: 'acct_summary',
+ name: 'Summary Account',
+ kind: 'msp',
+ kind_label: 'MSP',
+ role: 'owner',
+ can_manage: true,
+ has_billing: true,
+ members: [],
+ workspaces: [
+ {
+ id: 'ws_summary',
+ display_name: 'Summary Workspace',
+ state: 'active',
+ healthy: true,
+ health_status: 'healthy',
+ },
+ ],
+ },
+ ],
+ }),
+ })
+ );
- expect(html).toContain('overview-task-grid');
+ expect(html).toContain('workspace-summary-shell');
+ expect(html).toContain('workspace-summary-facts');
+ expect(html).toContain('Next:</strong> Open Summary Workspace');
+ expect(html).toContain('Summary Workspace');
+ expect(html).not.toContain('overview-task-grid');
});
it('renders authenticated portal accounts, workspaces, and hosted-only billing entrypoints', function() {
@@ -154,6 +184,12 @@ describe('shell view', function() {
expect(html).toContain('Owner');
expect(html).toContain('MSP account');
expect(html).toContain('Acme MSP');
+ expect(html).toContain('workspace-summary-facts');
+ 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('Next:</strong> Review Beta Workspace');
expect(html).toContain('Create workspace');
expect(html).not.toContain('Manage billing');
expect(html).not.toContain('Manage team');
@@ -163,7 +199,7 @@ describe('shell view', function() {
expect(html).toContain('Unhealthy</span>');
expect(html).toContain('Checking</span>');
expect(html).toContain('This workspace is in a failed state.');
- expect(html).toContain('Latest health check is still pending.');
+ expect(html).toContain('Health check pending');
expect(html).toContain('/api/accounts/acct_1/tenants/ws_active/handoff');
expect(html).toContain('Open workspace');
expect(html).toContain('data-action="select-workspace"');
@@ -204,6 +240,8 @@ describe('shell view', function() {
expect(html).not.toContain('section-context-strip');
expect(html).not.toContain('View roster');
expect(html).not.toContain('Owner or admin required');
+ expect(html).not.toContain('portal-content-panel-overview');
+ expect(html).not.toContain('data-shell-section="overview"');
});
it('defaults the authenticated hosted shell to workspaces', function() {
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index e22de2c5e3..8c74c066c4 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -19,7 +19,7 @@ export interface ShellViewContext {
activeSection?: PortalShellSection;
}
-interface OverviewWorkspaceEntry {
+interface WorkspaceSummaryEntry {
account: PortalAccountSummary;
workspace: PortalWorkspaceSummary;
}
@@ -64,6 +64,10 @@ function workspaceCountLabel(count: number): string {
return count === 1 ? '1 workspace' : String(count) + ' workspaces';
}
+function accountCountLabel(count: number): string {
+ return count === 1 ? '1 account' : String(count) + ' accounts';
+}
+
function reviewWorkspaceHeadline(count: number): string {
@@ -203,8 +207,8 @@ function collectWorkspaces(accounts: PortalAccountSummary[]): PortalWorkspaceSum
return results;
}
-function collectOverviewWorkspaceEntries(accounts: PortalAccountSummary[]): OverviewWorkspaceEntry[] {
- var results: OverviewWorkspaceEntry[] = [];
+function collectWorkspaceSummaryEntries(accounts: PortalAccountSummary[]): WorkspaceSummaryEntry[] {
+ var results: WorkspaceSummaryEntry[] = [];
for (var i = 0; i < accounts.length; i += 1) {
var workspaces = Array.isArray(accounts[i].workspaces) ? accounts[i].workspaces : [];
for (var j = 0; j < workspaces.length; j += 1) {
@@ -287,22 +291,6 @@ function renderFactLine(className: string, facts: string[]): string {
);
}
-function renderSummaryStrip(items: Array<{ label: string; value: string }>): string {
- if (!items.length) return '';
- return (
- '<div class="portal-summary-strip">' +
- items.map(function(item) {
- return (
- '<div class="portal-summary-item">' +
- '<span>' + escapeHTML(item.label) + '</span>' +
- '<strong>' + escapeHTML(item.value) + '</strong>' +
- '</div>'
- );
- }).join('') +
- '</div>'
- );
-}
-
function attentionWorkspaces(workspaces: PortalWorkspaceSummary[]): PortalWorkspaceSummary[] {
var results: PortalWorkspaceSummary[] = [];
for (var i = 0; i < workspaces.length; i += 1) {
@@ -408,6 +396,14 @@ function renderTabBar(bootstrap: PortalBootstrapData, activeSection: PortalShell
);
}
+function workspaceListAnchorID(accountID: string): string {
+ return 'workspace-list-' + accountID;
+}
+
+function workspaceRowAnchorID(accountID: string, workspaceID: string): string {
+ return 'workspace-row-' + accountID + '-' + workspaceID;
+}
+
function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWorkspaceSummary, accountAPIBasePath: string): string {
var status = workspaceHealthState(workspace);
var state = String(workspace.state || '');
@@ -441,7 +437,7 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWor
}
return (
- '<article class="workspace-row workspace-row-health-' + escapeAttr(status) + ' workspace-row-state-' + escapeAttr(state || 'unknown') + '" data-workspace-row="' + escapeAttr(workspace.id) + '">' +
+ '<article class="workspace-row workspace-row-health-' + escapeAttr(status) + ' workspace-row-state-' + escapeAttr(state || 'unknown') + '" id="' + escapeAttr(workspaceRowAnchorID(account.id, workspace.id)) + '" data-workspace-row="' + escapeAttr(workspace.id) + '">' +
'<div class="workspace-row-primary">' +
'<div class="workspace-row-heading">' +
'<h4 class="workspace-name">' + escapeHTML(workspace.display_name) + '</h4>' +
@@ -486,8 +482,8 @@ function renderWorkspaceHandoffForm(accountID: string, workspaceID: string, acco
);
}
-function attentionOverviewEntries(entries: OverviewWorkspaceEntry[]): OverviewWorkspaceEntry[] {
- var results: OverviewWorkspaceEntry[] = [];
+function attentionWorkspaceEntries(entries: WorkspaceSummaryEntry[]): WorkspaceSummaryEntry[] {
+ var results: WorkspaceSummaryEntry[] = [];
for (var i = 0; i < entries.length; i += 1) {
var status = workspaceHealthState(entries[i].workspace);
if (status === 'unhealthy' || status === 'checking') {
@@ -497,8 +493,8 @@ function attentionOverviewEntries(entries: OverviewWorkspaceEntry[]): OverviewWo
return results;
}
-function readyOverviewEntries(entries: OverviewWorkspaceEntry[]): OverviewWorkspaceEntry[] {
- var results: OverviewWorkspaceEntry[] = [];
+function readyWorkspaceEntries(entries: WorkspaceSummaryEntry[]): WorkspaceSummaryEntry[] {
+ var results: WorkspaceSummaryEntry[] = [];
for (var i = 0; i < entries.length; i += 1) {
if (String(entries[i].workspace.state || '') === 'active' && workspaceHealthState(entries[i].workspace) === 'healthy') {
results.push(entries[i]);
@@ -507,188 +503,41 @@ function readyOverviewEntries(entries: OverviewWorkspaceEntry[]): OverviewWorksp
return results;
}
-function overviewWorkspaceContext(entry: OverviewWorkspaceEntry, includeAccountName: boolean, note: string): string {
- if (!includeAccountName) return note;
- return entry.account.name + ' · ' + note;
-}
-
-function overviewBillingSeparationCopy(
- accounts: PortalAccountSummary[],
- showSelfHostedCommercial: boolean
-): { title: string; copy: string } {
- var hostedBillingCount = 0;
- var canManageHostedBilling = false;
- for (var i = 0; i < accounts.length; i += 1) {
- if (accounts[i].has_billing) {
- hostedBillingCount += 1;
- if (accounts[i].can_manage) {
- canManageHostedBilling = true;
- }
- }
- }
-
- if (!accounts.length) {
- return {
- title: 'Billing stays separate',
- copy: 'Self-hosted billing, licenses, refunds, and privacy stay in Billing.',
- };
- }
-
- if (showSelfHostedCommercial) {
- if (hostedBillingCount > 0) {
- return {
- title: 'Billing stays separate',
- copy: canManageHostedBilling
- ? 'Hosted billing stays in Billing, and self-hosted tools appear there only when relevant.'
- : 'Hosted billing stays in Billing, an owner or admin opens it, and self-hosted tools appear there only when relevant.',
- };
+function suspendedWorkspaceEntries(entries: WorkspaceSummaryEntry[]): WorkspaceSummaryEntry[] {
+ var results: WorkspaceSummaryEntry[] = [];
+ for (var i = 0; i < entries.length; i += 1) {
+ if (String(entries[i].workspace.state || '') === 'suspended') {
+ results.push(entries[i]);
}
- return {
- title: 'Billing stays separate',
- copy: 'Self-hosted tools appear in Billing only when they are relevant to this account.',
- };
}
-
- if (hostedBillingCount > 0) {
- return {
- title: 'Hosted billing stays separate',
- copy: canManageHostedBilling
- ? 'Use Billing only for hosted invoices, payment methods, or subscription changes.'
- : 'Hosted billing stays in Billing, and an owner or admin must open it.',
- };
- }
-
- return {
- title: 'Billing stays separate',
- copy: 'Use Billing only when the task is commercial, not operational.',
- };
+ return results;
}
-function renderOverviewAttentionCard(
- accounts: PortalAccountSummary[],
- entries: OverviewWorkspaceEntry[],
- showSelfHostedCommercial: boolean
-): string {
- var attention = attentionOverviewEntries(entries);
- var ready = readyOverviewEntries(entries);
- var includeAccountName = accounts.length > 1;
- var suspendedCount = countWorkspacesByState(entries.map(function(entry) {
- return entry.workspace;
- }), 'suspended');
- if (!attention.length) {
- return (
- '<article class="overview-task-card">' +
- '<div class="account-panel-kicker">Needs attention</div>' +
- '<h4>' + escapeHTML(accounts.length > 0 ? reviewWorkspaceHeadline(0) : '0 hosted workspaces need review') + '</h4>' +
- '<p>' + escapeHTML(entries.length > 0
- ? 'No active workspace is failed or waiting on a completed health check.'
- : accounts.length > 0
- ? 'No hosted workspace is attached to this account yet.'
- : 'No hosted account is attached to this sign-in.'
- ) + '</p>' +
- '<div class="overview-task-list">' +
- '<div class="overview-task-item"><strong>Ready</strong><span>' + escapeHTML(entries.length > 0
- ? readyWorkspaceHeadline(ready.length)
- : accounts.length > 0
- ? readyWorkspaceHeadline(0)
- : '0 hosted workspaces are ready to use'
- ) + '</span></div>' +
- '<div class="overview-task-item"><strong>Suspended</strong><span>' + escapeHTML(suspendedCount > 0
- ? suspendedCount === 1
- ? '1 workspace is suspended. Resume it before opening it again.'
- : String(suspendedCount) + ' workspaces are suspended. Resume them before opening them again.'
- : '0 suspended workspaces.'
- ) + '</span></div>' +
- '</div>' +
- '</article>'
- );
- }
-
- return (
- '<article class="overview-task-card overview-task-card-attention">' +
- '<div class="account-panel-kicker">Needs attention</div>' +
- '<h4>' + escapeHTML(reviewWorkspaceHeadline(attention.length)) + '</h4>' +
- '<p>Each listed workspace is failed or still waiting on a completed health check.</p>' +
- '<div class="overview-task-list">' +
- attention.slice(0, 3).map(function(entry) {
- return (
- '<div class="overview-task-item">' +
- '<strong>' + escapeHTML(entry.workspace.display_name) + '</strong>' +
- '<span>' + escapeHTML(overviewWorkspaceContext(entry, includeAccountName, workspaceStatusCopy(entry.workspace))) + '</span>' +
- '</div>'
- );
- }).join('') +
- '</div>' +
- '</article>'
- );
+function workspaceSummaryContext(entry: WorkspaceSummaryEntry, includeAccountName: boolean, note: string): string {
+ if (!includeAccountName) return note;
+ return entry.account.name + ' · ' + note;
}
-function renderOverviewReadyCard(
- accounts: PortalAccountSummary[],
- entries: OverviewWorkspaceEntry[],
- accountAPIBasePath: string
-): string {
- var ready = readyOverviewEntries(entries);
- var includeAccountName = accounts.length > 1;
- var totalWorkspaces = countWorkspaces(accounts);
- var canManageHosted = accounts.some(function(account) {
- return account.can_manage;
- });
- var suspendedCount = countWorkspacesByState(entries.map(function(entry) {
- return entry.workspace;
- }), 'suspended');
- if (!ready.length) {
- return (
- '<article class="overview-task-card">' +
- '<div class="account-panel-kicker">Ready</div>' +
- '<h4>' + escapeHTML(!accounts.length
- ? 'Billing is available'
- : readyWorkspaceHeadline(0)
- ) + '</h4>' +
- '<p>' + escapeHTML(!accounts.length
- ? 'Use Billing for self-hosted subscriptions, licenses, refunds, and privacy requests.'
- : totalWorkspaces > 0
- ? suspendedCount === totalWorkspaces
- ? 'Every hosted workspace is suspended right now.'
- : 'Open Workspaces to see the current state of each hosted workspace.'
- : canManageHosted
- ? 'No hosted workspace exists yet. Create the first one in Workspaces.'
- : 'No hosted workspace exists yet. An owner or admin must create the first one.'
- ) + '</p>' +
- '</article>'
- );
- }
+function renderWorkspaceAnchorAction(anchorID: string, label: string, className = 'btn-secondary btn-compact workspace-summary-link'): string {
+ return '<a class="' + escapeAttr(className) + '" href="#' + escapeAttr(anchorID) + '">' + escapeHTML(label) + '</a>';
+}
- return (
- '<article class="overview-task-card">' +
- '<div class="account-panel-kicker">Ready</div>' +
- '<h4>' + escapeHTML(readyWorkspaceHeadline(ready.length)) + '</h4>' +
- '<p>Each listed workspace is active and passed its latest health check.</p>' +
- '<div class="overview-task-list">' +
- ready.slice(0, 3).map(function(entry) {
- return (
- '<div class="overview-task-item overview-task-item-action">' +
- '<div class="overview-task-copy">' +
- '<strong>' + escapeHTML(entry.workspace.display_name) + '</strong>' +
- '<span>' + escapeHTML(overviewWorkspaceContext(entry, includeAccountName, workspaceRowNote(entry.workspace))) + '</span>' +
- '</div>' +
- renderWorkspaceHandoffForm(entry.account.id, entry.workspace.id, accountAPIBasePath, 'Open workspace') +
- '</div>'
- );
- }).join('') +
- '</div>' +
- '</article>'
- );
+interface WorkspaceSummaryDecision {
+ title: string;
+ description: string;
+ primaryAction: string;
+ secondaryAction: string;
}
-function renderOverviewNextActionCard(
+function renderWorkspaceSummaryDecision(
accounts: PortalAccountSummary[],
- entries: OverviewWorkspaceEntry[],
+ entries: WorkspaceSummaryEntry[],
accountAPIBasePath: string,
showSelfHostedCommercial: boolean
-): string {
- var attention = attentionOverviewEntries(entries);
- var ready = readyOverviewEntries(entries);
+): WorkspaceSummaryDecision {
+ var attention = attentionWorkspaceEntries(entries);
+ var suspended = suspendedWorkspaceEntries(entries);
+ var ready = readyWorkspaceEntries(entries);
var primaryAction = '';
var secondaryAction = '';
var title = '';
@@ -697,54 +546,74 @@ function renderOverviewNextActionCard(
var creatableAccount = accounts.find(function(account) {
return account.kind === 'msp' && account.can_manage;
}) || null;
- var billingAccount = accounts.find(function(account) {
- return account.has_billing && account.can_manage;
- }) || null;
var accessAccount = accounts.find(function(account) {
return account.can_manage;
}) || null;
var hostedViewOnly = accounts.length > 0 && !accessAccount;
if (attention.length) {
- title = 'Open Workspaces';
- description = attention.length > 1
- ? 'Open Workspaces to review each failed or pending workspace.'
- : 'Open Workspaces to review ' + attention[0].workspace.display_name + '.';
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button>';
- secondaryAction = accessAccount
- ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>'
- : '';
+ var attentionEntry = attention[0];
+ title = 'Review ' + attentionEntry.workspace.display_name;
+ description = workspaceSummaryContext(attentionEntry, accounts.length > 1, workspaceStatusCopy(attentionEntry.workspace));
+ primaryAction = renderWorkspaceAnchorAction(
+ workspaceRowAnchorID(attentionEntry.account.id, attentionEntry.workspace.id),
+ 'Review workspace',
+ 'btn-primary btn-compact workspace-summary-link',
+ );
+ secondaryAction = attentionEntry.account.can_manage && (
+ attentionEntry.workspace.state === 'active' ||
+ attentionEntry.workspace.state === 'suspended' ||
+ attentionEntry.workspace.state === 'failed'
+ )
+ ? '<button type="button" class="btn-secondary btn-compact" data-action="select-workspace" data-account-id="' +
+ escapeAttr(attentionEntry.account.id) +
+ '" data-workspace-id="' +
+ escapeAttr(attentionEntry.workspace.id) +
+ '">Open lifecycle</button>'
+ : '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ } else if (suspended.length) {
+ var suspendedEntry = suspended[0];
+ title = 'Review ' + suspendedEntry.workspace.display_name;
+ description = workspaceSummaryContext(suspendedEntry, accounts.length > 1, workspaceStatusCopy(suspendedEntry.workspace));
+ primaryAction = renderWorkspaceAnchorAction(
+ workspaceRowAnchorID(suspendedEntry.account.id, suspendedEntry.workspace.id),
+ 'Review workspace',
+ 'btn-primary btn-compact workspace-summary-link',
+ );
+ secondaryAction = suspendedEntry.account.can_manage
+ ? '<button type="button" class="btn-secondary btn-compact" data-action="select-workspace" data-account-id="' +
+ escapeAttr(suspendedEntry.account.id) +
+ '" data-workspace-id="' +
+ escapeAttr(suspendedEntry.workspace.id) +
+ '">Open lifecycle</button>'
+ : '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
} else if (ready.length) {
- title = 'Open workspace';
- description = accounts.length > 1
- ? 'Open ' + ready[0].workspace.display_name + ' in ' + ready[0].account.name + '.'
- : 'Open the ready workspace.';
- primaryAction = renderWorkspaceHandoffForm(ready[0].account.id, ready[0].workspace.id, accountAPIBasePath, 'Open ' + ready[0].workspace.display_name, 'btn-primary btn-compact');
+ var readyEntry = ready[0];
+ title = 'Open ' + readyEntry.workspace.display_name;
+ description = workspaceSummaryContext(readyEntry, accounts.length > 1, workspaceRowNote(readyEntry.workspace));
+ primaryAction = renderWorkspaceHandoffForm(
+ readyEntry.account.id,
+ readyEntry.workspace.id,
+ accountAPIBasePath,
+ 'Open workspace',
+ 'btn-primary btn-compact',
+ );
secondaryAction = ready.length > 1
- ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">See all workspaces</button>'
+ ? renderWorkspaceAnchorAction(workspaceListAnchorID(readyEntry.account.id), 'See all workspaces')
: '';
} else if (creatableAccount) {
- title = 'Create workspace';
- description = 'No workspace is ready. Create a workspace in ' + creatableAccount.name + '.';
+ title = 'Create the first workspace';
+ description = 'No hosted workspace is attached yet. Create the first workspace in ' + creatableAccount.name + '.';
primaryAction = '<button class="btn-primary btn-compact" type="button" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(creatableAccount.id) + '">Create workspace</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
- } else if (billingAccount) {
- title = 'Open billing';
- description = 'Use Billing for invoices, payment methods, or subscription changes.';
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
secondaryAction = accessAccount
? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>'
: '';
- } else if (!accounts.length) {
- title = 'Open billing';
- description = 'Use Billing for self-hosted subscriptions, licenses, refunds, or privacy requests.';
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
} else if (hostedViewOnly) {
- if (totalWorkspaces > 0) {
- title = 'Review workspace state';
- description = 'No workspace is ready. Open Workspaces to review current state, then hand off changes to an owner or admin.';
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ if (entries.length > 0) {
+ title = 'Review who can act';
+ description = 'Hosted workspaces are attached here, but an owner or admin must make account-level changes.';
+ primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ secondaryAction = renderWorkspaceAnchorAction(workspaceListAnchorID(accounts[0].id), 'Review workspace list');
} else {
title = 'Review who can act';
description = showSelfHostedCommercial
@@ -758,40 +627,80 @@ function renderOverviewNextActionCard(
} else if (accessAccount) {
title = 'Open access';
description = 'Use Access for invites, role changes, or access removal.';
- primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open access</button>';
- secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
+ primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="access">Open Access</button>';
+ secondaryAction = showSelfHostedCommercial
+ ? '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>'
+ : '';
} else {
title = 'Open billing or support';
- description = 'Use Billing for commercial work. Use Support only after the billing path fails.';
+ description = totalWorkspaces > 0
+ ? 'Review the workspace list here, then use Billing for commercial work or Support only after a self-service path fails.'
+ : 'Use Billing for commercial work. Use Support only after the billing path fails.';
primaryAction = '<button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>';
secondaryAction = '<button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="support">Escalate</button>';
}
+ return {
+ title: title,
+ description: description,
+ primaryAction: primaryAction,
+ secondaryAction: secondaryAction,
+ };
+}
+
+function renderWorkspaceSummaryFacts(accounts: PortalAccountSummary[], entries: WorkspaceSummaryEntry[]): string[] {
+ return [
+ accountCountLabel(accounts.length),
+ workspaceCountLabel(entries.length),
+ readyWorkspaceChipLabel(readyWorkspaceEntries(entries).length),
+ reviewWorkspaceChipLabel(attentionWorkspaceEntries(entries).length),
+ suspendedWorkspaceChipLabel(suspendedWorkspaceEntries(entries).length),
+ ];
+}
+
+function renderWorkspaceSummaryInline(
+ accounts: PortalAccountSummary[],
+ entries: WorkspaceSummaryEntry[],
+ accountAPIBasePath: string,
+ showSelfHostedCommercial: boolean
+): string {
+ var decision = renderWorkspaceSummaryDecision(accounts, entries, accountAPIBasePath, showSelfHostedCommercial);
return (
- '<article class="overview-task-card overview-task-card-next">' +
- '<div class="account-panel-kicker">Next action</div>' +
- '<h4>' + escapeHTML(title) + '</h4>' +
- '<p>' + escapeHTML(description) + '</p>' +
- '<div class="overview-task-actions">' +
- primaryAction +
- secondaryAction +
+ '<section class="workspace-summary-inline">' +
+ '<div class="workspace-summary-inline-copy">' +
+ '<p><strong>Next:</strong> ' + escapeHTML(decision.title) + '</p>' +
+ '<p>' + escapeHTML(decision.description) + '</p>' +
'</div>' +
- '</article>'
+ '<div class="workspace-summary-actions">' +
+ decision.primaryAction +
+ decision.secondaryAction +
+ '</div>' +
+ '</section>'
);
}
-function renderShellOverviewSection(context: ShellViewContext): string {
+function workspaceSectionHeaderCopy(accounts: PortalAccountSummary[], entries: WorkspaceSummaryEntry[]): string {
+ if (!entries.length) {
+ return accounts.some(function(account) { return account.can_manage; })
+ ? 'Review hosted workspaces here, then create the next workspace when you are ready.'
+ : 'Review hosted workspace state here. An owner or admin must create or change hosted workspaces.';
+ }
+ return 'Review hosted workspace health here, open the next ready workspace, and use Lifecycle only when an account-level change is required.';
+}
+
+export function renderWorkspaceSummarySection(context: ShellViewContext): string {
var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];
- var entries = collectOverviewWorkspaceEntries(accounts);
+ var entries = collectWorkspaceSummaryEntries(accounts);
var showSelfHostedCommercial = hasSelfHostedCommercial(context.bootstrap);
return (
- '<section class="account-content-panel account-content-panel-overview">' +
- '<div class="overview-task-grid overview-task-grid-compact">' +
- renderOverviewAttentionCard(accounts, entries, showSelfHostedCommercial) +
- renderOverviewReadyCard(accounts, entries, context.accountAPIBasePath) +
- renderOverviewNextActionCard(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) +
+ '<section class="workspace-summary-shell">' +
+ '<div class="portal-page-header">' +
+ '<h2>Workspaces</h2>' +
+ '<p>' + escapeHTML(workspaceSectionHeaderCopy(accounts, entries)) + '</p>' +
'</div>' +
+ renderFactLine('workspace-summary-facts', renderWorkspaceSummaryFacts(accounts, entries)) +
+ renderWorkspaceSummaryInline(accounts, entries, context.accountAPIBasePath, showSelfHostedCommercial) +
'</section>'
);
}
@@ -941,7 +850,7 @@ function renderAccountWorkspaceSection(account: PortalAccountSummary, accountAPI
}
var workspaceHTML = workspaces.length
- ? '<div class="workspace-list-wrap">' +
+ ? '<div class="workspace-list-wrap" id="' + escapeAttr(workspaceListAnchorID(account.id)) + '">' +
(workspaceHeaderActions ? '<div class="workspace-list-toolbar">' + workspaceHeaderActions + '</div>' : '') +
'<div class="workspace-list-head">' +
'<span>Workspace</span>' +
@@ -1230,10 +1139,6 @@ export function renderHeaderHTML(context: ShellViewContext): string {
return '<a class="logout-btn link-button" href="' + escapeAttr(context.signupPath) + '">Create account</a>';
}
-export function renderAccountsHTML(context: ShellViewContext): string {
- return renderShellOverviewSection(context);
-}
-
export function renderAuthenticatedPortalHTML(context: ShellViewContext): string {
var accounts = Array.isArray(context.bootstrap.accounts) ? context.bootstrap.accounts : [];
var hosted = hasHostedAccounts(accounts);
@@ -1267,6 +1172,7 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string
);
}).join('')
: renderNoHostedWorkspacesSection();
+ var workspaceSummaryContent = hosted ? renderWorkspaceSummarySection(context) : '';
var accessContent = accounts.length
? accounts.map(function(account) {
return (
@@ -1330,13 +1236,11 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string
(hosted
? (
'<section class="portal-content-panel portal-content-panel-workspaces">' +
+ workspaceSummaryContent +
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>'
)
: '') +
diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.css
index 2b64290486..87176efc59 100644
--- a/internal/cloudcp/portal/frontend/src/styles.css
+++ b/internal/cloudcp/portal/frontend/src/styles.css
@@ -244,27 +244,10 @@ header .logout-btn:hover,
.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 {
+.portal-shell[data-shell-section="support"] .portal-content-panel-support {
display: block !important;
}
-/* Account sub-panels */
-.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="access"] .account-content-panel-access {
- display: block !important;
-}
-
-.portal-shell[data-shell-section="overview"] .account-content-panel-workspaces,
-.portal-shell[data-shell-section="overview"] .account-content-panel-access,
-.portal-shell[data-shell-section="workspaces"] .account-content-panel-overview,
-.portal-shell[data-shell-section="workspaces"] .account-content-panel-access,
-.portal-shell[data-shell-section="access"] .account-content-panel-overview,
-.portal-shell[data-shell-section="access"] .account-content-panel-workspaces {
- display: none !important;
-}
-
.portal-content-panel {
padding: 16px 0 0;
}
@@ -312,7 +295,6 @@ header .logout-btn:hover,
.account-content-panel { display: block; }
-.account-content-panel-overview,
.account-content-panel-workspaces,
.account-content-panel-access {
padding: 0;
@@ -1183,51 +1165,75 @@ header .logout-btn:hover,
.portal-support-link:hover { text-decoration: underline; }
.support-link { color: var(--accent); }
-/* ── Overview / Summary section (simplified) ──────────────────── */
-.overview-task-grid,
-.overview-task-grid-compact {
+/* ── Workspace summary shell ──────────────────────────────────── */
+.workspace-summary-shell {
display: flex;
flex-direction: column;
- gap: 0;
- border: 1px solid var(--border);
- border-radius: var(--radius);
- overflow: hidden;
+ gap: 16px;
}
-.overview-task-card {
+.workspace-summary-shell + .account-surface {
+ margin-top: 24px;
+ padding-top: 20px;
+ border-top: 1px solid var(--border);
+}
+
+.workspace-summary-facts {
display: flex;
- flex-direction: column;
+ flex-wrap: wrap;
gap: 8px;
- padding: 12px 16px;
- border-top: 1px solid var(--border-muted);
- background: var(--bg);
+ font-size: 12px;
+ color: var(--ink-secondary);
+}
+
+.workspace-summary-facts span {
+ white-space: nowrap;
}
-.overview-task-card:first-child { border-top: none; }
-.overview-task-card h4 { margin: 0; font-size: 14px; font-weight: 600; }
-.overview-task-card p { margin: 0; font-size: 13px; color: var(--ink-secondary); }
+.portal-fact-separator {
+ color: var(--border);
+}
+
+.workspace-summary-inline {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 0 0 16px;
+ border-bottom: 1px solid var(--border);
+}
-.overview-task-list { display: flex; flex-direction: column; gap: 0; }
-.overview-task-item {
+.workspace-summary-inline-copy {
display: flex;
flex-direction: column;
- gap: 2px;
- padding: 8px 0;
- border-top: 1px solid var(--border-muted);
+ gap: 4px;
+ min-width: 0;
}
-.overview-task-item:first-child { border-top: none; padding-top: 0; }
-.overview-task-item strong { font-size: 13px; color: var(--ink); }
-.overview-task-item span { font-size: 12px; color: var(--ink-secondary); }
-.overview-task-item-action {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
+.workspace-summary-inline-copy p {
+ margin: 0;
+ font-size: 13px;
+ color: var(--ink-secondary);
+}
+
+.workspace-summary-inline-copy p:first-child {
+ color: var(--ink);
+}
+
+.workspace-summary-inline-copy strong {
+ color: var(--ink);
+}
+
+.workspace-summary-actions {
+ display: flex;
+ flex-wrap: wrap;
gap: 8px;
+ justify-content: flex-end;
}
-.overview-task-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
-.overview-task-actions { display: flex; gap: 8px; margin-top: 4px; }
+.workspace-summary-link:hover {
+ text-decoration: none;
+}
/* Remove kicker labels — they feel like a custom portal. Use section context instead. */
.account-panel-kicker,
@@ -1344,35 +1350,6 @@ header .logout-btn:hover,
.portal-page-header h2 { margin: 0; font-size: 16px; font-weight: 600; }
.portal-page-header p { margin: 0; font-size: 13px; color: var(--ink-secondary); }
-.portal-page-facts { display: none; }
-
-.portal-summary-strip { display: none; }
-
-.portal-account-block-header {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- gap: 12px;
- margin-bottom: 12px;
-}
-
-.portal-account-block-copy h3 { margin: 0; font-size: 14px; font-weight: 600; }
-.portal-account-block-copy p { margin: 4px 0 0; font-size: 13px; color: var(--ink-secondary); }
-.portal-account-block-facts { display: none; }
-.portal-account-block-actions { display: flex; gap: 8px; }
-
-.section-context-strip { display: none; }
-
-/* Account stage headers (used by overview section) */
-.account-stage-header {
- display: flex;
- flex-direction: column;
- gap: 4px;
- margin-bottom: 12px;
-}
-
-.account-stage-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
-.account-stage-header p { margin: 0; font-size: 13px; color: var(--ink-secondary); }
/* ── Spinner ──────────────────────────────────────────────────── */
.spinner {
@@ -1417,6 +1394,13 @@ header .logout-btn:hover,
.portal-identity-bar { flex-wrap: wrap; }
.portal-identity-bar h2 { font-size: 18px; }
+ .workspace-summary-inline {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .workspace-summary-actions { justify-content: flex-start; }
+
.workspace-list-head { display: none; }
.workspace-row { grid-template-columns: 1fr; gap: 8px; }
.workspace-actions { justify-content: flex-start; width: 100%; }
diff --git a/internal/cloudcp/portal/frontend/src/types.ts b/internal/cloudcp/portal/frontend/src/types.ts
index c27ef52dd9..37c1fb24f9 100644
--- a/internal/cloudcp/portal/frontend/src/types.ts
+++ b/internal/cloudcp/portal/frontend/src/types.ts
@@ -130,7 +130,7 @@ export interface PortalAccountState {
byAccountID: Record<string, PortalAccountUIEntry>;
}
-export type PortalShellSection = 'overview' | 'workspaces' | 'access' | 'billing' | 'support';
+export type PortalShellSection = 'workspaces' | 'access' | 'billing' | 'support';
export interface PortalShellState {
activeSection: PortalShellSection;