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:
@@ -17,7 +17,7 @@ void main() {
|
||||
|
||||
expect(find.byType(Scaffold), findsWidgets);
|
||||
|
||||
const message = 'No chats yet. Use New chat to start one.';
|
||||
const message = 'No chats yet';
|
||||
expect(find.text(message), findsOneWidget);
|
||||
expectNormalTextStyle(tester, message);
|
||||
});
|
||||
@@ -39,7 +39,7 @@ void main() {
|
||||
'for this operator';
|
||||
expect(find.text(message), findsOneWidget);
|
||||
expectNormalTextStyle(tester, message);
|
||||
expect(find.text('No chats yet. Use New chat to start one.'), findsNothing);
|
||||
expect(find.text('No chats yet'), findsNothing);
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.text('Retry'),
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/core/transport/connection_state.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/chat_harness_setup_state.dart';
|
||||
|
||||
import 'chat_test_harness.dart';
|
||||
import 'fake_chat_gateway.dart';
|
||||
@@ -91,13 +93,29 @@ void main() {
|
||||
) async {
|
||||
final gateway = FakeChatGateway();
|
||||
await pumpMaterialChat(tester, gateway);
|
||||
expect(
|
||||
find.text('No chats yet. Use New chat to start one.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('No chats yet'), findsOneWidget);
|
||||
expect(find.text('Start a chat'), findsOneWidget);
|
||||
expect(find.textContaining('No chats match'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('a server without a chat harness shows the setup step', (
|
||||
tester,
|
||||
) async {
|
||||
usePhoneSurface(tester);
|
||||
final gateway = FakeChatGateway()
|
||||
..sessionsHandler = () => Future.error(
|
||||
const ProtocolError('chat is not configured on this server'),
|
||||
);
|
||||
await pumpMaterialChat(tester, gateway);
|
||||
|
||||
expect(find.byKey(chatHarnessSetupKey), findsOneWidget);
|
||||
expect(find.text('pipelines harness setup claude'), findsOneWidget);
|
||||
// Not a failure: no error notice, no raw server text.
|
||||
expect(find.textContaining('not configured'), findsNothing);
|
||||
expect(find.text('No chats yet'), findsNothing);
|
||||
expect(find.text('Refresh'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('load failure wraps the reason and hides the empty message', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -114,7 +132,7 @@ void main() {
|
||||
'Bad state: server unavailable while listing chat sessions '
|
||||
'for this operator';
|
||||
expect(find.text(message), findsOneWidget);
|
||||
expect(find.text('No chats yet. Use New chat to start one.'), findsNothing);
|
||||
expect(find.text('No chats yet'), findsNothing);
|
||||
final messageBox = tester.renderObject<RenderBox>(find.text(message));
|
||||
expect(
|
||||
messageBox.size.height,
|
||||
|
||||
Reference in New Issue
Block a user