wip(app): runs-day-groups (retained from the cancelled overrun lane)

This commit is contained in:
2026-10-22 21:59:06 +01:00
parent 1bcc26a4fd
commit ebf86a31fb
3 changed files with 113 additions and 7 deletions
+26 -7
View File
@@ -74,13 +74,7 @@ class RunsList extends StatelessWidget {
Expanded(
child: controller.visibleRuns.isEmpty
? const Center(child: Text('No runs found.'))
: ListView.separated(
itemCount: controller.visibleRuns.length,
separatorBuilder: (context, index) =>
const Divider(height: 1),
itemBuilder: (context, index) =>
_runTile(context, controller.visibleRuns[index]),
),
: _groupedRuns(context),
),
],
);
@@ -113,6 +107,31 @@ class RunsList extends StatelessWidget {
),
);
Widget _groupedRuns(BuildContext context) {
final groups = groupRunsByDay(controller.visibleRuns, DateTime.now());
final entries = <({String? label, JsonMap? run})>[];
for (final group in groups) {
entries.add((label: group.label, run: null));
entries.addAll(group.runs.map((run) => (label: null, run: run)));
}
return ListView.builder(
itemCount: entries.length,
itemBuilder: (context, index) {
final entry = entries[index];
if (entry.label case final label?) {
final style = usesCupertinoHost(context)
? CupertinoTheme.of(context).textTheme.textStyle
: Theme.of(context).textTheme.labelLarge;
return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16, 12, 16, 4),
child: Semantics(header: true, child: Text(label, style: style)),
);
}
return _runTile(context, entry.run!);
},
);
}
Widget _emptyError(BuildContext context) => Center(
child: Column(
mainAxisSize: MainAxisSize.min,