First run: empty states with a next step, harness setup instead of errors

- One shared EmptyState (icon on a tonal disc, title, one line, primary
  action) that follows the design tokens; used by Runs (Start your first
  run), Pipelines (Browse templates), Schedules and the chat list (Start a
  chat).
- Chat on a server without an agent harness showed "Bad state: No saved
  machine is connected.": the federated list now keeps the server's own
  refusal, treats an omitted empty list as no chats, and the list shows a
  "Set up an agent" state with the harness setup command and Refresh. New
  chat shows the same step instead of a form that can only be refused.
- A run that fails because no harness CLI exists names the setup command
  beside the raw reason; error advice gains a noHarness kind.
- Templates opened before the app connected stayed on "Not connected";
  it now reads again when the connection arrives. The Pipelines empty state
  links to Templates, which had no entry point in the UI.
- The first-launch walkthrough waits briefly for the connection, so a
  connected web app is no longer told to connect; the empty-server check
  treats omitted lists and no chat harness as empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 23:29:23 +00:00
parent 9436067bf2
commit e72bee3faa
30 changed files with 696 additions and 111 deletions
@@ -108,6 +108,37 @@ Future<void> _finishWalkthrough(WidgetTester tester) async {
}
void main() {
testWidgets(
'first launch waits briefly for the connection before welcoming',
(tester) async {
final store = MemoryWalkthroughStore();
final link = ValueNotifier<bool>(false);
await tester.pumpWidget(_host(store: store, link: link));
await tester.pump();
expect(find.text(_welcome), findsNothing);
// The app connects a moment later: the welcome is the connected one,
// with no connect directions.
link.value = true;
await tester.pumpAndSettle();
expect(find.text(_welcome), findsOneWidget);
expect(find.textContaining('start by connecting'), findsNothing);
},
);
testWidgets(
'first launch without a connection still offers the connect page',
(tester) async {
final store = MemoryWalkthroughStore();
final link = ValueNotifier<bool>(false);
await tester.pumpWidget(_host(store: store, link: link));
await tester.pump(const Duration(seconds: 3));
await tester.pumpAndSettle();
expect(find.text(_welcome), findsOneWidget);
expect(find.textContaining('start by connecting'), findsOneWidget);
},
);
testWidgets('first launch shows the walkthrough once per device', (
tester,
) async {