Search results and pill span the pane; lock stage page to the full detail pane
Remove the 840 px Search reading cap (results column and bar pill) so both fill the pane at Fold and wide widths. Add a width test for the stage page at 880 and 1400 and deep-link/query flags to the search probe entry.
This commit is contained in:
@@ -20,7 +20,11 @@ import 'package:pipelines_app/application/pipelines_app.dart';
|
||||
import 'package:pipelines_app/application/server_endpoint.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
||||
import 'package:pipelines_app/features/search/ui/search_bar_controls.dart'
|
||||
show searchFieldKey;
|
||||
import 'package:pipelines_app/ui/input/app_search_field.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||
|
||||
/// The run every run-scoped hit names. Its recorded sequences are deliberately
|
||||
@@ -122,7 +126,8 @@ List<JsonMap> probePipelines() => [
|
||||
},
|
||||
];
|
||||
|
||||
const _releaseSource = 'name: Release train\n'
|
||||
const _releaseSource =
|
||||
'name: Release train\n'
|
||||
'stages:\n'
|
||||
' plan:\n'
|
||||
' type: model\n'
|
||||
@@ -147,7 +152,11 @@ JsonMap probePipelineDetail(int id, int requestedVersion) {
|
||||
'source': _releaseSource,
|
||||
'versions': [
|
||||
for (var v = 1; v <= latest; v++)
|
||||
{'version': v, 'stages': summary['stages'], 'created_at': '2026-10-0${v}T10:00:00'},
|
||||
{
|
||||
'version': v,
|
||||
'stages': summary['stages'],
|
||||
'created_at': '2026-10-0${v}T10:00:00',
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -167,7 +176,12 @@ const List<({String haystack, JsonMap hit})> probeHits = [
|
||||
'target': 'pipeline:24',
|
||||
'score': 3,
|
||||
'recency': '2026-10-20T09:18:00Z',
|
||||
'pipeline': {'id': 24, 'name': 'Release train', 'version': 5, 'stages': 2},
|
||||
'pipeline': {
|
||||
'id': 24,
|
||||
'name': 'Release train',
|
||||
'version': 5,
|
||||
'stages': 2,
|
||||
},
|
||||
},
|
||||
),
|
||||
(
|
||||
@@ -310,7 +324,11 @@ const List<({String haystack, JsonMap hit})> probeHits = [
|
||||
JsonMap? probeReply(JsonMap request) {
|
||||
final id = request['id'];
|
||||
final type = '${request['type']}';
|
||||
JsonMap error(String message) => {'id': id, 'type': 'error', 'error': message};
|
||||
JsonMap error(String message) => {
|
||||
'id': id,
|
||||
'type': 'error',
|
||||
'error': message,
|
||||
};
|
||||
switch (type) {
|
||||
case 'subscribe':
|
||||
case 'unsubscribe':
|
||||
@@ -455,9 +473,26 @@ class _FixtureSink implements WebSocketSink {
|
||||
dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||
}
|
||||
|
||||
/// Static-server capture flags, so a plain file server (no index.html
|
||||
/// fallback for `/runs/7`) can still open a deep location:
|
||||
///
|
||||
/// `?route=/runs/7/stage/build%3Fvisit%3D1` opens that app location;
|
||||
/// `?q=release` types that query into Search once its field is shown.
|
||||
void main() {
|
||||
final params = Uri.base.queryParameters;
|
||||
final cupertino = params['platform'] == 'cupertino';
|
||||
final route = params['route'];
|
||||
if (route != null && route.startsWith('/')) {
|
||||
final platform = cupertino ? 'platform=cupertino' : '';
|
||||
final joiner = route.contains('?') ? '&' : '?';
|
||||
web.window.history.replaceState(
|
||||
null,
|
||||
'',
|
||||
platform.isEmpty ? route : '$route$joiner$platform',
|
||||
);
|
||||
}
|
||||
final query = params['q'];
|
||||
if (query != null && query.isNotEmpty) _typeSearchWhenShown(query);
|
||||
useAppUrlStrategy();
|
||||
runApp(
|
||||
PipelinesApp(
|
||||
@@ -467,3 +502,34 @@ void main() {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Types [query] into Search's field once it is shown, through the field's
|
||||
/// own change and submit callbacks, exactly as typing would.
|
||||
void _typeSearchWhenShown(String query) {
|
||||
void attempt(Duration _) {
|
||||
AppSearchField? found;
|
||||
void visit(Element element) {
|
||||
if (found != null) return;
|
||||
final widget = element.widget;
|
||||
if (widget is AppSearchField && widget.fieldKey == searchFieldKey) {
|
||||
found = widget;
|
||||
return;
|
||||
}
|
||||
element.visitChildren(visit);
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.rootElement?.visitChildren(visit);
|
||||
final field = found;
|
||||
if (field == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback(attempt);
|
||||
WidgetsBinding.instance.scheduleFrame();
|
||||
return;
|
||||
}
|
||||
field.controller.text = query;
|
||||
field.onChanged?.call(query);
|
||||
field.onSubmitted?.call(query);
|
||||
}
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
WidgetsBinding.instance.addPostFrameCallback(attempt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user