Hide Proxmox Replication tab when no replication signals exist

The Replication tab was gated on `hasPveEstate || replicationChanges.length > 0`,
which meant every PVE estate got an always-visible tab whose only content was
empty-state copy. That broke the pattern set by every other Proxmox sub-tab
(Storage, Backups, Ceph, Mail Gateway), each of which only appears when there
is actual data to show. The `hasPveEstate ||` clause was added in 111af289a
without a recorded rationale; the prior "gate by evidence" design (251e8844d)
correctly gated on `replicationChanges.length > 0` only.

Restore the original gate so Replication matches the rest of the platform
page: it shows up when there is something to show.
This commit is contained in:
rcourtman
2026-05-25 21:09:24 +01:00
parent 2b3295e6f0
commit 2315d83304
2 changed files with 3 additions and 7 deletions
@@ -130,7 +130,7 @@ describe('proxmoxPageModel', () => {
]);
});
it('keeps Replication available for a PVE estate without recent replication events', () => {
it('hides Replication for a PVE estate without replication signals', () => {
const model = buildProxmoxPageModel([
makeResource({
id: 'pve-node-1',
@@ -148,10 +148,7 @@ describe('proxmoxPageModel', () => {
}),
]);
expect(buildVisibleProxmoxTabSpecs(model).map((tab) => tab.id)).toEqual([
'overview',
'replication',
]);
expect(buildVisibleProxmoxTabSpecs(model).map((tab) => tab.id)).toEqual(['overview']);
});
it('resolves Proxmox suite scope from canonical platform hints', () => {
@@ -373,12 +373,11 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {
export function buildVisibleProxmoxTabSpecs(model: ProxmoxPageModel): ProxmoxTabSpec[] {
const visible = new Set<ProxmoxPageTabId>(['overview']);
const hasPveEstate = model.pveNodes.length > 0 || model.guests.length > 0;
if (model.storage.length > 0 || model.physicalDisks.length > 0) {
visible.add('storage');
}
if (hasPveEstate || model.replicationChanges.length > 0) {
if (model.replicationChanges.length > 0) {
visible.add('replication');
}
if (model.resources.some(hasBackupSignal) || model.pbs.length > 0) {