App: run failure reasons, Run again, labelled tabs, actionable errors, nav fixes

- Run rows show a failed run's reason (else its diagnostic's first line,
  full text in a tooltip) or a short result preview; the Summary leads
  with "Why it failed".
- Run again for succeeded/canceled/interrupted runs opens the New run form
  pre-filled (prompt, workspace, report format) at the latest version with
  the original offered.
- Run detail and stage tabs show their names; touch shows captions on the
  Runs header and artifact viewer actions (desktop keeps tooltips).
- ErrorNotice maps not connected / server too old / permission / timeout
  to what to do, raw detail behind Details (Schedules, create chat, Runs,
  Pipelines banners).
- Settings has no Back arrow; Schedules keeps the rail on wide windows;
  phone Settings leads with Connection and Notifications and has a
  Jump to topic menu.
- Walkthrough: Open Connection (skipped when connected), labelled Copy.
- Pluralised counts; no duplicate status/rail names for screen readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 20:16:22 +00:00
parent c441400f36
commit 545291e04a
68 changed files with 1719 additions and 156 deletions
@@ -39,8 +39,14 @@ class FloatingDestinationBar extends StatefulWidget {
this.edge = FloatingBarEdge.bottom,
this.alignment,
this.showLabels = false,
this.maxLabelScale,
});
/// The largest text scale [showLabels] captions follow; null follows the
/// system's. A page's own tabs cap it so large text cannot stack them over
/// the content they switch.
final double? maxLabelScale;
/// Main app navigation keeps names visible; dense page tabs can stay icons.
final bool showLabels;
@@ -188,13 +194,20 @@ class _FloatingDestinationBarState extends State<FloatingDestinationBar>
Widget _row(BuildContext context, double width) {
if (widget.showLabels) {
return FloatingDestinationLabels(
final labels = FloatingDestinationLabels(
key: FloatingDestinationBar.rowKey,
labels: [for (final item in items) item.label],
selected: currentIndex,
buttonBuilder: (index) => _button(context, index),
onTap: widget.onTap,
);
final max = widget.maxLabelScale;
return max == null
? labels
: MediaQuery.withClampedTextScaling(
maxScaleFactor: max,
child: labels,
);
}
final gap = _gap(width);
// As tall as the selected (largest) button; the others are centred on
+17
View File
@@ -53,6 +53,7 @@ class AppListRow extends StatelessWidget {
this.timeWidget,
this.subtitle,
this.compactSubtitle,
this.detail,
this.subtitleLeading,
this.subtitleTrailing,
this.menu,
@@ -88,6 +89,10 @@ class AppListRow extends StatelessWidget {
/// Replaces [subtitle] in a compact row, which has less room for facts.
final Widget? compactSubtitle;
/// An optional third line under the subtitle (a failed run's reason), one
/// ellipsised line in the subtitle style unless the widget styles itself.
final Widget? detail;
final Widget? subtitleLeading;
final Widget? subtitleTrailing;
final Widget? menu;
@@ -271,6 +276,17 @@ class AppListRow extends StatelessWidget {
// A compact row has no room beside its title: the time takes a line of
// its own under the subtitle.
final timeLine = compact ? time : null;
final detailLine = detail == null
? null
: Padding(
padding: const EdgeInsets.only(top: _lineGap),
child: DefaultTextStyle(
style: styles.subtitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
child: detail!,
),
);
if (line == null && subtitleLeading == null && subtitleTrailing == null) {
if (timeLine == null) return titleLine;
return Column(
@@ -311,6 +327,7 @@ class AppListRow extends StatelessWidget {
),
],
),
?detailLine,
?timeLine,
],
);
@@ -0,0 +1,101 @@
import 'package:flutter/material.dart';
import '../adaptive/platform.dart';
/// Whether icon-only actions show a visible caption: on touch devices, which
/// have no hover to reveal a tooltip. Desktop keeps icons with tooltips.
bool showsActionCaptions(BuildContext context) =>
!prefersCompactHitTargets(context);
/// A toolbar action that is an [IconButton] with its tooltip on desktop and,
/// on touch, the icon over a short visible [caption] in the same 48 dp tall
/// target, so a phone user can read what it does without long-pressing.
///
/// [label] is the full accessible name (and desktop tooltip); [caption] is
/// the short word drawn under the icon, defaulting to [label].
class LabelledIconButton extends StatelessWidget {
const LabelledIconButton({
super.key,
required this.icon,
required this.label,
required this.onPressed,
this.caption,
this.isSelected = false,
this.iconSize,
this.child,
});
final IconData icon;
final String label;
final String? caption;
final VoidCallback? onPressed;
final bool isSelected;
final double? iconSize;
/// Replaces the icon glyph (a progress indicator or a badged icon).
final Widget? child;
@override
Widget build(BuildContext context) {
final glyph = child ?? Icon(icon, size: iconSize);
if (!showsActionCaptions(context)) {
return IconButton(
tooltip: label,
isSelected: isSelected,
constraints: const BoxConstraints(
minWidth: kMinInteractiveDimension,
minHeight: kMinInteractiveDimension,
),
onPressed: onPressed,
icon: glyph,
);
}
final theme = Theme.of(context);
final color = onPressed == null
? theme.disabledColor
: isSelected
? theme.colorScheme.primary
: theme.colorScheme.onSurfaceVariant;
return Semantics(
button: true,
enabled: onPressed != null,
selected: isSelected,
label: label,
excludeSemantics: true,
child: InkResponse(
onTap: onPressed,
radius: kMinInteractiveDimension * 0.75,
child: ConstrainedBox(
constraints: const BoxConstraints(
minWidth: kMinInteractiveDimension,
minHeight: kMinInteractiveDimension,
maxHeight: kMinInteractiveDimension,
// A long caption scales down rather than widening the toolbar.
maxWidth: kMinInteractiveDimension + 8,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: FittedBox(
fit: BoxFit.scaleDown,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
IconTheme.merge(
data: IconThemeData(color: color, size: 22),
child: glyph,
),
const SizedBox(height: 2),
Text(
caption ?? label,
maxLines: 1,
style: theme.textTheme.labelSmall?.copyWith(color: color),
),
],
),
),
),
),
),
);
}
}
+116
View File
@@ -0,0 +1,116 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../core/error_advice.dart';
import '../../core/error_reason.dart';
const errorNoticeDetailsKey = ValueKey<String>('error-notice-details');
const errorNoticeCopyKey = ValueKey<String>('error-notice-copy');
/// A failure as the operator should read it: a sentence saying what to do
/// for the common kinds (not connected, server too old, permission, timeout)
/// with the raw detail behind "Details" (selectable, with Copy); any other
/// failure shows its own message.
///
/// [error] is the exception or the message a controller kept.
class ErrorNotice extends StatefulWidget {
const ErrorNotice({
super.key,
required this.error,
this.textAlign = TextAlign.start,
this.actions = const <Widget>[],
});
final Object error;
/// Buttons for the failure (Retry), on one wrapping row with Details.
final List<Widget> actions;
final TextAlign textAlign;
@override
State<ErrorNotice> createState() => _ErrorNoticeState();
}
class _ErrorNoticeState extends State<ErrorNotice> {
bool _open = false;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final color = theme.colorScheme.error;
final advice = errorAdvice(widget.error);
final error = widget.error;
// Any other failure reads exactly as it was reported.
final message =
advice?.sentence ??
(error is String
? error
: describeErrorReason(error, fallback: 'Something went wrong.'));
final center = widget.textAlign == TextAlign.center;
final text = Semantics(
liveRegion: true,
child: Text(
message,
textAlign: widget.textAlign,
style: TextStyle(color: color),
),
);
final alignment = center ? WrapAlignment.center : WrapAlignment.start;
if (advice == null) {
if (widget.actions.isEmpty) return text;
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: center
? CrossAxisAlignment.center
: CrossAxisAlignment.start,
children: [
text,
Wrap(alignment: alignment, children: widget.actions),
],
);
}
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: center
? CrossAxisAlignment.center
: CrossAxisAlignment.start,
children: [
text,
Wrap(
alignment: alignment,
children: [
...widget.actions,
TextButton.icon(
key: errorNoticeDetailsKey,
onPressed: () => setState(() => _open = !_open),
icon: Icon(_open ? Icons.expand_less : Icons.expand_more),
label: Text(_open ? 'Hide details' : 'Details'),
),
],
),
if (_open)
Row(
mainAxisSize: center ? MainAxisSize.min : MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: SelectableText(
advice.detail,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
),
IconButton(
key: errorNoticeCopyKey,
tooltip: 'Copy details',
icon: const Icon(Icons.copy, size: 18),
onPressed: () =>
Clipboard.setData(ClipboardData(text: advice.detail)),
),
],
),
],
);
}
}
+2
View File
@@ -21,8 +21,10 @@ class RunStatusIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
final color = runStatusColor(state, Theme.of(context).colorScheme);
// The label is the glyph's accessible name; the tooltip must not repeat it.
return Tooltip(
message: label,
excludeFromSemantics: true,
child: Semantics(
label: label,
image: true,
+4
View File
@@ -0,0 +1,4 @@
/// `1 stage`, `2 stages`: [count] with [one], or [many] (default `${one}s`)
/// for any count but one.
String countLabel(num count, String one, [String? many]) =>
'$count ${count == 1 ? one : many ?? '${one}s'}';