Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/web/src/pages/home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// implementation detail, and "0 of 5" told a waiting person nothing.

import { Button, EmptyState, PageShell } from "@corbits/react-ui";
import { WarningCircle } from "@corbits/icons";
import { Clock, WarningCircle } from "@corbits/icons";
import { useEffect, useState } from "react";

import { listAllWorkbenches, WorkbenchLoadingState } from "@corbits/chat-ui";
Expand Down Expand Up @@ -75,8 +75,10 @@ export function HomeRoute({
if (cancelled) return;
if ((attempt + 1) * retryMs >= stallAfterMs) {
setState({ kind: "slow" });
return;
}
// Slow is a message, not a stop: retries keep going underneath it so
// a backend that recovers after the stall still lands on its own —
// "Retry" stays as an escape hatch, never the only way forward.
retryTimer = setTimeout(() => setAttempt((count) => count + 1), retryMs);
};

Expand Down Expand Up @@ -185,12 +187,12 @@ export function HomeRoute({
return (
<PageShell width="full" className="page-fill">
<EmptyState
icon={<WarningCircle />}
icon={<Clock />}
title="Myra is taking longer than usual"
description="She's still getting set up. Give it another moment, or try again."
action={
<Button variant="outline" onClick={startOver}>
Try again
Retry
</Button>
}
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/shell/setup-progress-note.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export function SetupProgressNote() {
return (
<div className="setup-progress-note" role="status">
<p className="setup-progress-note-text">
Your workbench is still setting up the rest of its agents. Nothing to
wait for — keep going.
Your workbench is still setting up in the background. Nothing to wait
for — keep going.
</p>
<Button
variant="ghost"
Expand Down
25 changes: 24 additions & 1 deletion apps/web/test/home-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,33 @@ describe("the wait right after connecting a provider", () => {
expect(text).toContain("Myra is taking longer than usual");
expect(text).not.toMatch(/\d+ of \d+/);
const retry = Array.from(container?.querySelectorAll("button") ?? []).find(
(button) => button.textContent === "Try again",
(button) => button.textContent === "Retry",
);
expect(retry).not.toBeUndefined();
});

test("auto-navigates once Myra becomes ready even after the stall message fires, with no click", async () => {
// Myra doesn't answer until well past the stall threshold — the slow
// message must not be the end of the line. Polling keeps going
// underneath it, and the land happens on its own once she's ready.
benchWhereMyraArrivesAfter(6);
const navigated: string[] = [];
await renderHome({ retryMs: 10, stallAfterMs: 40, navigated });
for (let i = 0; i < 40; i++) {
await settle();
if ((container?.textContent ?? "").includes("longer than usual")) break;
}
expect(container?.textContent ?? "").toContain(
"Myra is taking longer than usual",
);

for (let i = 0; i < 60; i++) {
await settle();
if (navigated.length > 0) break;
}

expect(navigated).toEqual(["/w/chan_new"]);
});
});

describe('a failed memberships fetch never reads as "pick from the switcher"', () => {
Expand Down
Loading