fix(runs): honest empty state — feature off vs. no runs yet
Some checks are pending
Security / Security check (push) Waiting to run
Some checks are pending
Security / Security check (push) Waiting to run
The empty state unconditionally claimed background runs were switched off, even on hubs where the operator had enabled them. The hub now reports the flag on the list RPC (detached_enabled); the hint picks the truthful variant. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
5aa69104e7
commit
ae97b88257
7 changed files with 34 additions and 10 deletions
|
|
@ -24,6 +24,7 @@ class RunsPage extends StatefulWidget {
|
|||
|
||||
class _RunsPageState extends State<RunsPage> {
|
||||
List<DetachedRun> _runs = const [];
|
||||
bool _detachedEnabled = false;
|
||||
String? _error;
|
||||
bool _loaded = false;
|
||||
Timer? _poll;
|
||||
|
|
@ -49,12 +50,13 @@ class _RunsPageState extends State<RunsPage> {
|
|||
|
||||
Future<void> _refresh() async {
|
||||
try {
|
||||
final runs = await HubService.instance.listDetachedRuns(
|
||||
final snapshot = await HubService.instance.listDetachedRuns(
|
||||
project: Workspace.instance.activeSlug,
|
||||
);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_runs = runs;
|
||||
_runs = snapshot.runs;
|
||||
_detachedEnabled = snapshot.enabled;
|
||||
_error = null;
|
||||
_loaded = true;
|
||||
});
|
||||
|
|
@ -126,7 +128,10 @@ class _RunsPageState extends State<RunsPage> {
|
|||
? ChainEmptyState(
|
||||
icon: Icons.rocket_launch_outlined,
|
||||
title: l.runsEmptyTitle,
|
||||
hint: l.runsEmptyHint,
|
||||
// The hub reports whether the operator enabled the
|
||||
// feature — never claim "switched off" while it is on
|
||||
// and there simply are no runs yet (usertest finding).
|
||||
hint: _detachedEnabled ? l.runsEmptyEnabledHint : l.runsEmptyHint,
|
||||
// The guide carries the plain-language explanation plus
|
||||
// the exact operator steps (config snippet) — a click
|
||||
// target instead of a raw config key in the hint.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue