Tell the mirror that Phase 2 is running instead of leaving it on a greyed button

The mirror's own job ends in seconds while Phase 2 runs for minutes on the owner, so the screen sat unchanged on the phase-1 panel — which reads as a hang, and the reasonable response to a hang is to start clicking.
This commit is contained in:
Gmer4Lfe
2026-08-17 12:25:16 -04:00
parent 73bbae14c1
commit e23358ea0c
2 changed files with 57 additions and 5 deletions
+27
View File
@@ -332,6 +332,33 @@ function vvRenderMirrorOnboard(opts) {
// Phase 2 means the partnership is actually established, so the instructions have genuinely
// stopped being needed. Until then showing them costs nothing — a step already done reads as a
// reminder, a step still needed and hidden is a dead end.
// Phase 2 runs on the OWNER and takes minutes — 4m05s on a measured run, longer as the arr
// library grows. The mirror's own job finishes in about three seconds, because all it does is
// send the notification, so for the rest of that window the screen showed the unchanged
// phase-1 panel with a greyed-out button and no statement that anything was happening
// elsewhere. That reads as a hang, and the reasonable response to a hang is to start clicking.
if ((opts.phase ?? 0) < 2 && opts.waiting) {
const mins = opts.waitingSince
? Math.floor((Date.now() - opts.waitingSince) / 60000) : 0;
const secs = opts.waitingSince
? Math.floor(((Date.now() - opts.waitingSince) % 60000) / 1000) : 0;
return `<div style="padding:12px 14px;background:#1a1200;border:1px solid #3a2800;border-radius:4px;">
<div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap;">
<span style="font-size:18px;line-height:1;color:#ff9800;">⟳</span>
<div style="flex:1;min-width:220px;">
<div style="color:#ff9800;font-size:12px;font-weight:600;">
Onboard in progress — please wait</div>
<div style="color:#8a6a2a;font-size:10px;margin-top:3px;line-height:1.5;">
${owner} is running Phase 2: deploying containers, syncing auth data and
bootstrapping the arr libraries. This normally takes 46 minutes and nothing is
needed from you here. This page updates itself when it finishes.</div>
${opts.waitingSince ? `<div style="color:#6a5020;font-size:10px;margin-top:4px;
font-family:monospace;">elapsed ${mins}m ${String(secs).padStart(2,'0')}s</div>` : ''}
</div>
</div>
</div>`;
}
if ((opts.phase ?? 0) >= 2) {
// Done state. This used to return the same "Join partnership · ▶ Onboard" panel as the
// not-started state, under a comment saying it collapsed — so a fully onboarded mirror