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.

Keep portal suspended states honest

rcourtman64224f164b27
diff --git a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
index b71ae88b48..c24a8721d8 100644
--- a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
+++ b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
@@ -249,6 +249,10 @@ Core rules:
current workspace state; they must say that nothing is ready yet and that
the first hosted workspace still needs owner/admin creation before routine
work can start.
+37. `Overview` must keep `Needs attention` honest when only suspended
+ workspaces remain. The shell may not imply active work is ready merely
+ because a suspended workspace exists; suspended-only states must say that
+ no active workspace is ready for routine use right now.
## Screen Model
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 4e6517e9d2..ff44de9062 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -341,6 +341,9 @@ That same typed overview contract must also keep `Ready` honest when no hosted
workspace exists yet: hosted accounts with zero workspaces may not route the
user into current workspace review, and must instead render that nothing is
ready until the first hosted workspace exists.
+That same typed overview contract must also keep `Needs attention` honest when
+only suspended workspaces remain: hosted workspace history alone may not make
+the shell imply that active work is ready.
plus a package-local `tsc --noEmit` gate, so future account-shell work should
extend the typed source boundary instead of reviving opaque global runtime
objects, document-wide render events, or untyped embedded asset edits.
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 690b5ac235..264fc21d36 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -902,6 +902,9 @@ That same owned `Overview` surface must also keep `Ready` honest when no
hosted workspace exists yet: hosted accounts with zero workspaces may not tell
the user to review current workspace state, and must instead say that nothing
is ready yet until the first hosted workspace exists.
+That same owned `Overview` surface must also keep `Needs attention` honest
+when only suspended workspaces remain: a suspended-only account may not imply
+that active work is ready simply because hosted workspace history exists.
That same canonical shell/runtime boundary now also owns the bootstrap truth
for when self-hosted commercial history is relevant. Hosted-only accounts must
not render self-hosted license, refund, privacy, or support-escalation copy
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index 1c59c8e758..590a725c31 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "2b04882678dc1fd7fd9160747d190ba62581f1c44ab3a6632f04a0c55756b78f",
+ "source_hash": "187fd85844db24178a14cfc69113eaf92dddd85f57cdef1a82a86d70268bacc9",
"build_inputs": [
"package.json",
"tsconfig.json",
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 5ce0ee4d9c..51b0d3460f 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -2211,6 +2211,7 @@
}
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;
@@ -2220,7 +2221,7 @@
return '<article class="overview-task-card"><div class="account-panel-kicker">Needs attention</div><h4>Nothing urgent</h4><p>' + escapeHTML(
entries.length > 0 ? "No active workspace is currently asking for review." : "No hosted workspace is currently asking for review."
) + '</p><div class="overview-task-list"><div class="overview-task-item"><strong>Healthy now</strong><span>' + escapeHTML(
- entries.length > 0 ? "Active workspaces look clear for routine use." : "There is no hosted workspace waiting for review yet."
+ ready.length > 0 ? "Active workspaces look clear for routine use." : entries.length > 0 ? "No active workspace is ready for routine use right now." : "There is no hosted workspace waiting for review yet."
) + '</span></div><div class="overview-task-item"><strong>' + escapeHTML(suspendedCount > 0 ? "Suspended stays parked" : billingSeparation.title) + "</strong><span>" + escapeHTML(
suspendedCount > 0 ? String(suspendedCount) + " suspended workspace" + (suspendedCount === 1 ? " stays" : "s stay") + " out of the way until you deliberately resume it." : billingSeparation.copy
) + "</span></div></div></article>";
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index 6608300466..4f1aa249c3 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -563,6 +563,39 @@ describe('shell view', function() {
expect(html).not.toContain('Choose the right task path');
});
+ it('keeps overview attention copy honest when only suspended workspaces remain', function() {
+ var html = renderAuthenticatedPortalHTML(
+ createContext({
+ bootstrap: createBootstrap({
+ accounts: [
+ {
+ id: 'acct_view_suspended',
+ name: 'Suspended Hosted Account',
+ kind: 'cloud',
+ kind_label: 'Cloud',
+ role: 'read_only',
+ can_manage: false,
+ has_billing: true,
+ workspaces: [
+ {
+ id: 'ws_view_suspended',
+ display_name: 'Paused Workspace',
+ state: 'suspended',
+ healthy: true,
+ health_status: 'healthy',
+ },
+ ],
+ },
+ ],
+ }),
+ })
+ );
+
+ expect(html).toContain('No active workspace is ready for routine use right now.');
+ expect(html).toContain('1 suspended workspace stays out of the way until you deliberately resume it.');
+ expect(html).not.toContain('Active workspaces look clear for routine use.');
+ });
+
it('renders self-hosted overview copy when no hosted accounts are attached', function() {
var html = renderAuthenticatedPortalHTML(
createContext({
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index a3d0d88a43..fdeb2057d4 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -624,6 +624,7 @@ function renderOverviewAttentionCard(
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;
@@ -639,8 +640,10 @@ function renderOverviewAttentionCard(
: 'No hosted workspace is currently asking for review.'
) + '</p>' +
'<div class="overview-task-list">' +
- '<div class="overview-task-item"><strong>Healthy now</strong><span>' + escapeHTML(entries.length > 0
+ '<div class="overview-task-item"><strong>Healthy now</strong><span>' + escapeHTML(ready.length > 0
? 'Active workspaces look clear for routine use.'
+ : entries.length > 0
+ ? 'No active workspace is ready for routine use right now.'
: 'There is no hosted workspace waiting for review yet.'
) + '</span></div>' +
'<div class="overview-task-item"><strong>' + escapeHTML(suspendedCount > 0 ? 'Suspended stays parked' : billingSeparation.title) + '</strong><span>' + escapeHTML(suspendedCount > 0