import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; import '../../artifacts/ui/artifact_gallery_page.dart'; /// The visit's recorded stage artifacts, in recorded order. /// /// Selecting a row opens the existing artifact gallery page for exactly this /// visit, so the pane never grows a second viewer or a link-only substitute. /// The page receives the whole run so a shared `public/` file stays with the /// visit that first recorded it, and it lists exactly the rows shown here. /// /// An empty list is never described as "nothing recorded" on its own: the /// existing capture semantics say whether the capture is unavailable, still /// pending or explicitly empty for this visit. class RunVisitArtifacts extends StatelessWidget { const RunVisitArtifacts({ super.key, required this.step, required this.visitIndex, required this.runSteps, required this.configuredEndpoint, }); final JsonMap step; /// The visit's index in [runSteps], so the opened page is the same group. final int visitIndex; final List runSteps; final String configuredEndpoint; /// The same gallery as the run's Artifacts tab, focused on this visit. @override Widget build(BuildContext context) => KeyedSubtree( key: const Key('run-visit-body-artifacts'), child: ArtifactGalleryPage( key: ValueKey('run-visit-artifacts-$visitIndex'), steps: runSteps.isEmpty ? [step] : runSteps, focusIndex: runSteps.isEmpty ? 0 : visitIndex, configuredEndpoint: configuredEndpoint, embedded: true, ), ); }