Clarify empty server states

Show calm, actionable empty states for pipelines, runs, and chats while keeping filtered and failed loads distinct. Add focused widget coverage and document the remaining verification limits.
This commit is contained in:
2026-11-12 01:02:31 +00:00
parent 4f1b45571f
commit dbd525a7b1
11 changed files with 201 additions and 17 deletions
@@ -84,7 +84,7 @@ class ChatSessionsBody extends StatelessWidget {
emptyMessageOverride ??
(sessions.isEmpty
? error == null
? 'No chat sessions on this server yet.'
? 'No chats yet. Use New chat to start one.'
: null
: 'No chats match "${query.trim()}".');
@@ -77,11 +77,13 @@ class PipelineFilters {
);
}
/// The empty-state sentence for the list plus its optional reset action.
/// The empty-state sentence for the list, an optional line naming the next
/// step, and an optional reset action.
class PipelineEmptyState {
const PipelineEmptyState(this.message, {this.clearAction});
const PipelineEmptyState(this.message, {this.detail, this.clearAction});
final String message;
final String? detail;
final String? clearAction;
}
@@ -153,7 +155,10 @@ PipelineEmptyState? pipelineListEmptyState(
) {
if (items.isNotEmpty) return null;
if (all.isEmpty) {
return const PipelineEmptyState('No pipelines are defined on this server.');
return const PipelineEmptyState(
'No pipelines yet.',
detail: 'Create one from a template in Templates.',
);
}
final name = filters.name;
final onlyName =
@@ -192,6 +192,15 @@ class PipelineListPanel extends StatelessWidget {
textAlign: TextAlign.center,
style: _mutedStyle(context),
),
if (empty.detail != null)
Padding(
padding: const EdgeInsets.only(top: 4),
child: Text(
empty.detail!,
textAlign: TextAlign.center,
style: _mutedStyle(context),
),
),
if (empty.clearAction != null)
PipelineTextButton(
label: empty.clearAction!,
+20 -6
View File
@@ -163,18 +163,32 @@ class RunsList extends StatelessWidget {
// Filtered and sorted once per build: the getter recomputes every read.
final visible = controller.visibleRuns;
if (visible.isNotEmpty) return _groupedRuns(context, header, visible);
// A server with no runs at all is not a filter problem: say what the list
// is for and where its first run comes from. A free-text query counts as
// a filter too, so a search on an empty server reads as "nothing found".
final noRunsAtAll = controller.runs.isEmpty &&
controller.activeFilterCount == 0 &&
controller.query.trim().isEmpty;
return BelowTopBar(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
...header,
Expanded(
child: _state(
context,
icon: const Icon(Icons.inbox_outlined),
title: 'No runs found.',
subtitle: 'Try changing or clearing the filters.',
),
child: noRunsAtAll
? _state(
context,
icon: const Icon(Icons.inbox_outlined),
title: 'No runs yet.',
subtitle:
'Start one from Pipelines and its runs appear here.',
)
: _state(
context,
icon: const Icon(Icons.inbox_outlined),
title: 'No runs found.',
subtitle: 'Try changing or clearing the filters.',
),
),
],
),