feat(app): pulse the run graph's recorded current stage
Mark the run's recorded current stage on the run graph while it executes. The halo is a foreground painter outside the node box, so it adds no size, hit target or semantics, and it is derived only from RunGraphState.activeStage, which is non-null only while the run reports executing. Reduced motion keeps a still ring instead of animating. Widget tests cover the sole active node, a finished run with no halo or ticker, reduced motion, toggling it at runtime and unchanged node extents.
This commit is contained in:
@@ -87,25 +87,26 @@ Widget _materialHost(
|
||||
double scale = 1,
|
||||
Size size = const Size(900, 700),
|
||||
DateTime Function()? now,
|
||||
bool disableAnimations = false,
|
||||
}) {
|
||||
return MaterialApp(
|
||||
builder: (context, child) => MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaler: TextScaler.linear(scale),
|
||||
disableAnimations: disableAnimations,
|
||||
),
|
||||
child: child!,
|
||||
),
|
||||
home: Scaffold(
|
||||
body: Builder(
|
||||
builder: (context) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(textScaler: TextScaler.linear(scale)),
|
||||
child: SizedBox(
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
child: RunGraphView(
|
||||
graph: graph,
|
||||
run: run,
|
||||
selectedStage: selected,
|
||||
onStageSelected: onSelected ?? (_) {},
|
||||
now: now,
|
||||
),
|
||||
),
|
||||
body: SizedBox(
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
child: RunGraphView(
|
||||
graph: graph,
|
||||
run: run,
|
||||
selectedStage: selected,
|
||||
onStageSelected: onSelected ?? (_) {},
|
||||
now: now,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -205,7 +206,9 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('the expanded run graph keeps the route legend', (tester) async {
|
||||
await tester.pumpWidget(_materialHost(linearGraph(), _runningRun()));
|
||||
await tester.pumpWidget(
|
||||
_materialHost(linearGraph(), _runningRun(), disableAnimations: true),
|
||||
);
|
||||
await _settle(tester);
|
||||
await tester.tap(find.byKey(const Key('graph-expand')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
Reference in New Issue
Block a user