Open Search artifact hits in the viewer over the run's Artifacts tab
On a phone-width window the open run is its own page pushed on the app navigator, so RunDetailTabs was not a descendant of the shell's RunSearchSelectionScope (which wraps only the Runs tab body). The field or artifact selection was never seen and the run opened at its plain Summary. The previous widget tests injected the scope directly above RunDetailView at 900 px, where the detail is an inline pane, so they could not catch it. - RunsScreen relays the shell's search scope into the detail it builds, so the pushed page sees the selection too (also fixes field hits on phones). - An artifact hit now opens the run's Artifacts tab and the gallery opens that artifact exactly as a tap there does: selected, scrolled into view (ArtifactVisitReveal) and in the viewer. Back returns to the tab with the artifact highlighted. An unknown URL leaves the tab open with the existing "That artifact is no longer available." notice. - New test/application/search_artifact_open_test.dart drives the real Search tab -> typed query -> result tap -> run read -> viewer on a 390x844 phone, Material and Cupertino; it fails without the scope relay.
This commit is contained in:
@@ -18,6 +18,7 @@ import 'data/runs_sort_store.dart';
|
||||
import 'domain/run_decisions.dart';
|
||||
import 'ui/run_pipeline_link.dart';
|
||||
import 'ui/run_detail_view.dart';
|
||||
import 'ui/run_search_selection.dart';
|
||||
import 'ui/runs_controller.dart';
|
||||
import 'ui/runs_list.dart';
|
||||
|
||||
@@ -248,18 +249,37 @@ class _RunsScreenState extends State<RunsScreen> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Widget _detail(VoidCallback onBack) => RunDetailView(
|
||||
controller: controller,
|
||||
gateway: widget.gateway,
|
||||
onBack: onBack,
|
||||
onRunOpened: _select,
|
||||
onOpenPipeline: widget.onOpenPipeline,
|
||||
initialStageKey: widget.initialStageKey,
|
||||
initialVisit: widget.initialVisit,
|
||||
);
|
||||
/// The shell's pending search selection, read in [build] so this screen
|
||||
/// rebuilds (and refreshes an open detail page) whenever it changes.
|
||||
RunSearchSelectionScope? _searchScope;
|
||||
|
||||
/// The run detail, under the shell's search selection.
|
||||
///
|
||||
/// On a narrow window the detail is its own page on the app's navigator, so
|
||||
/// it is not a descendant of the shell's [RunSearchSelectionScope]; relaying
|
||||
/// the scope keeps a field or artifact hit's selection reachable there too.
|
||||
Widget _detail(VoidCallback onBack) {
|
||||
final view = RunDetailView(
|
||||
controller: controller,
|
||||
gateway: widget.gateway,
|
||||
onBack: onBack,
|
||||
onRunOpened: _select,
|
||||
onOpenPipeline: widget.onOpenPipeline,
|
||||
initialStageKey: widget.initialStageKey,
|
||||
initialVisit: widget.initialVisit,
|
||||
);
|
||||
final scope = _searchScope;
|
||||
if (scope == null) return view;
|
||||
return RunSearchSelectionScope(
|
||||
selection: scope.selection,
|
||||
onConsumed: scope.onConsumed,
|
||||
child: view,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_searchScope = RunSearchSelectionScope.maybeOf(context);
|
||||
final selected = controller.selectedRunId != null;
|
||||
// The same adaptive list/detail layout as Pipelines and Chat.
|
||||
final narrow = !showsListBesideDetail(context);
|
||||
|
||||
Reference in New Issue
Block a user