Merge branch 'worktree-agent-a82ec5e9fdf8ca159' into integrate/gaps-e
# Conflicts: # app/test/features/search/search_bar_layout_test.dart
This commit is contained in:
@@ -14,10 +14,10 @@ import 'ui/search_bounds_note.dart';
|
||||
import 'ui/search_result_view.dart';
|
||||
|
||||
/// Native omni-search over the Pipelines server: the search field, a compact
|
||||
/// kind menu and the syntax help in the top bar's actions pill, and a flat
|
||||
/// result list whose rows open the server's own target through [onOpen]. The
|
||||
/// screen never mutates server state and never guesses a route for an unknown
|
||||
/// or targetless hit.
|
||||
/// kind menu and the syntax help as the top bar's main pill (no title), and a
|
||||
/// flat result list whose rows open the server's own target through [onOpen].
|
||||
/// The screen never mutates server state and never guesses a route for an
|
||||
/// unknown or targetless hit.
|
||||
class SearchScreen extends StatefulWidget {
|
||||
const SearchScreen({
|
||||
super.key,
|
||||
@@ -95,12 +95,18 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||
if (!ShellBar.available(context)) {
|
||||
return _body(cupertino, controls: _controls(cupertino));
|
||||
}
|
||||
return ShellBar(actions: [_controls(cupertino)], child: _body(cupertino));
|
||||
// The field takes the title's place and fills the bar.
|
||||
return ShellBar(
|
||||
titleWidget: _controls(cupertino),
|
||||
titleWidgetMaxWidth: kSearchPillMaxWidth,
|
||||
child: _body(cupertino),
|
||||
);
|
||||
}
|
||||
final bar = SegmentedBar(
|
||||
cupertino: cupertino,
|
||||
title: 'Search',
|
||||
actions: [_controls(cupertino)],
|
||||
titleWidget: _controls(cupertino),
|
||||
titleWidgetMaxWidth: kSearchPillMaxWidth,
|
||||
);
|
||||
if (cupertino) {
|
||||
return CupertinoPageScaffold(navigationBar: bar, child: _body(cupertino));
|
||||
|
||||
@@ -4,22 +4,25 @@ import 'package:flutter/material.dart';
|
||||
import '../../../ui/input/app_search_field.dart';
|
||||
import '../../../ui/navigation/bar_icon_button.dart';
|
||||
import '../domain/search_models.dart';
|
||||
import 'search_layout.dart';
|
||||
|
||||
const searchFieldKey = ValueKey<String>('search.field');
|
||||
const searchKindKey = ValueKey<String>('search.kind');
|
||||
const searchHelpKey = ValueKey<String>('search.help');
|
||||
const searchBarControlsKey = ValueKey<String>('search.bar');
|
||||
|
||||
/// The widest the search pill grows on a wide window.
|
||||
const double kSearchPillMaxWidth = 560;
|
||||
/// The widest the search pill grows on a wide window: the result column's
|
||||
/// width, so on a wide window the field and the results share both edges.
|
||||
const double kSearchPillMaxWidth = kSearchContentMaxWidth;
|
||||
|
||||
const searchTokenHint =
|
||||
'Filter with t:pipeline or type:artifact (pipeline, run, step, field, '
|
||||
'artifact, version). Last type wins; choosing Kind replaces it. Quote '
|
||||
'tokens to search literally.';
|
||||
|
||||
/// Search's controls as one piece of the top bar's actions pill: the search
|
||||
/// field, a compact Kind menu and the query-syntax help behind an info button.
|
||||
/// Search's controls as the top bar's main pill (in place of a title): the
|
||||
/// search field filling the pill, a compact Kind menu and the query-syntax
|
||||
/// help behind an info button.
|
||||
class SearchBarControls extends StatelessWidget {
|
||||
const SearchBarControls({
|
||||
super.key,
|
||||
@@ -47,9 +50,8 @@ class SearchBarControls extends StatelessWidget {
|
||||
key: searchBarControlsKey,
|
||||
constraints: const BoxConstraints(maxWidth: kSearchPillMaxWidth),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 4),
|
||||
child: AppSearchField(
|
||||
|
||||
Reference in New Issue
Block a user