Merge branch 'worktree-agent-a099cbf073f6e9e51' into integrate/shell-wide

# Conflicts:
#	app/lib/features/runs/ui/run_detail_tabs.dart
This commit is contained in:
2026-10-31 12:51:39 +00:00
30 changed files with 1197 additions and 197 deletions
@@ -9,6 +9,10 @@ const scheduleSearchFieldKey = ValueKey<String>('schedule-search-field');
const scheduleFilterKey = ValueKey<String>('schedule-filter');
const scheduleRefreshKey = ValueKey<String>('schedule-refresh');
/// The strip width (inside its padding) from which the field, filter and
/// count share one row.
const double kScheduleToolbarRowWidth = 520;
/// Refresh for the list, as a bar action: the platform's activity indicator
/// in the same touch target while a read is in flight.
class ScheduleRefreshAction extends StatelessWidget {
@@ -36,9 +40,12 @@ class ScheduleRefreshAction extends StatelessWidget {
);
}
/// Search and the enabled filter, and the count; the refresh control too when
/// no bar above carries it ([onRefresh] null leaves it to the bar). The list
/// floats it as a glass strip under the page's bar.
/// Search and the enabled filter, with the count as a muted label; the
/// refresh control too when no bar above carries it ([onRefresh] null leaves
/// it to the bar). The list floats it as a glass strip under the page's bar.
///
/// On a strip at least [kScheduleToolbarRowWidth] wide everything shares one
/// row; narrower, the field takes its own row above the filter and count.
class ScheduleListToolbar extends StatelessWidget {
const ScheduleListToolbar({
super.key,
@@ -55,57 +62,60 @@ class ScheduleListToolbar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
child: _search(context),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
Expanded(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 480),
child: _filter(context),
),
),
),
if (onRefresh case final refresh?) ...[
const SizedBox(width: 8),
ScheduleRefreshAction(
controller: controller,
cupertino: cupertino,
onRefresh: refresh,
),
],
],
),
),
if (controller.hasLoaded)
Padding(
padding: const EdgeInsets.fromLTRB(12, 8, 12, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(controller.countLabel, style: _metaStyle(context)),
Text(
'Saved run configurations, not pipeline definitions.',
style: _metaStyle(context),
),
],
return Padding(
padding: const EdgeInsets.all(12),
child: LayoutBuilder(
builder: (context, constraints) {
final refresh = switch (onRefresh) {
final refresh? => ScheduleRefreshAction(
controller: controller,
cupertino: cupertino,
onRefresh: refresh,
),
),
const SizedBox(height: 12),
],
null => null,
};
if (constraints.maxWidth >= kScheduleToolbarRowWidth) {
return Row(
children: [
Expanded(child: _search(context)),
const SizedBox(width: 12),
_filter(context),
const SizedBox(width: 12),
Flexible(child: _count(context)),
if (refresh != null) ...[const SizedBox(width: 8), refresh],
],
);
}
// Narrow: the count follows the filter, and wraps under it when
// large text leaves no room beside it.
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_search(context),
const SizedBox(height: 8),
Wrap(
spacing: 12,
runSpacing: 8,
crossAxisAlignment: WrapCrossAlignment.center,
children: [_filter(context), _count(context), ?refresh],
),
],
);
},
),
);
}
/// The count, muted; empty space until the first read lands so the
/// strip keeps its size.
Widget _count(BuildContext context) => Text(
controller.hasLoaded ? controller.countLabel : '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: _metaStyle(context),
);
Widget _search(BuildContext context) => AppSearchField(
fieldKey: scheduleSearchFieldKey,
controller: searchController,
@@ -150,10 +160,11 @@ class ScheduleListToolbar extends StatelessWidget {
}
TextStyle? _metaStyle(BuildContext context) => cupertino
? CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith(
? CupertinoTheme.of(context).textTheme.textStyle.copyWith(
fontSize: 15,
color: CupertinoColors.secondaryLabel.resolveFrom(context),
)
: Theme.of(context).textTheme.bodySmall?.copyWith(
: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
);
}
@@ -13,9 +13,13 @@ const scheduleListKey = ValueKey<String>('schedule-list');
const scheduleRetryKey = ValueKey<String>('schedule-retry');
const scheduleToolbarKey = ValueKey<String>('schedule-toolbar');
/// The widest the search and filter strip grows on a wide window.
/// The widest the search and filter strip grows on a wide window. The rows
/// share its width, so a row's time ends under the strip's trailing edge.
const double kScheduleToolbarMaxWidth = 720;
/// The widest a row grows: the strip plus its 12px leading inset.
const double kScheduleListMaxWidth = kScheduleToolbarMaxWidth + 12;
/// Platform-adaptive list body. It owns no navigation chrome; the shell frames
/// it as the Schedules destination.
///
@@ -74,7 +78,12 @@ class SchedulesListView extends StatelessWidget {
return BelowTopBar(child: _loadingState(context));
}
if (controller.schedules.isEmpty) {
return BelowTopBar(child: _emptyState('No schedules yet.'));
return BelowTopBar(
child: _emptyState(
'No schedules yet.',
detail: 'Saved run configurations, not pipeline definitions.',
),
);
}
final content = controller.visibleSchedules.isEmpty
? BelowTopBar(child: _emptyState(controller.emptyMessage))
@@ -100,14 +109,20 @@ class SchedulesListView extends StatelessWidget {
itemCount: schedules.length,
itemBuilder: (context, index) {
final schedule = schedules[index];
return ScheduleListRow(
key: ValueKey<String>(
'schedule-row-$index-${schedule.id ?? 'unknown'}',
return Align(
alignment: AlignmentDirectional.centerStart,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: kScheduleListMaxWidth),
child: ScheduleListRow(
key: ValueKey<String>(
'schedule-row-$index-${schedule.id ?? 'unknown'}',
),
schedule: schedule,
cupertino: cupertino,
divider: index < schedules.length - 1,
onOpen: () => onOpen(schedule),
),
),
schedule: schedule,
cupertino: cupertino,
divider: index < schedules.length - 1,
onOpen: () => onOpen(schedule),
);
},
);
@@ -132,11 +147,28 @@ class SchedulesListView extends StatelessWidget {
);
}
Widget _emptyState(String message) {
Widget _emptyState(String message, {String? detail}) {
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Text(message, textAlign: TextAlign.center),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(message, textAlign: TextAlign.center),
if (detail != null)
Builder(
builder: (context) => Text(
detail,
textAlign: TextAlign.center,
style: TextStyle(
color: cupertino
? CupertinoColors.secondaryLabel.resolveFrom(context)
: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
],
),
),
);
}