[current results ui] Add instructions to splash screen
Change-Id: I5dc46dde9448e97b4d01784c8595c9c48eef5f6a
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/165820
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/current_results_ui/lib/instructions.dart b/current_results_ui/lib/instructions.dart
new file mode 100644
index 0000000..7eb21cd
--- /dev/null
+++ b/current_results_ui/lib/instructions.dart
@@ -0,0 +1,86 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:flutter/gestures.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+
+class Instructions extends StatelessWidget {
+ Widget build(context) {
+ return SingleChildScrollView(
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Text(
+ 'Enter a query to see current test results',
+ style: TextStyle(fontSize: 24.0),
+ ),
+ paragraph('Enter query terms that are prefixes of configuration '
+ 'or test names. Multiple terms can be entered at once, separated '
+ 'by commas.'),
+ paragraph('Some example queries are:'),
+ for (final example in [
+ {
+ 'description': 'language_2/ tests on analyzer configurations',
+ 'terms': 'language_2/,analyzer'
+ },
+ {
+ 'description': 'service/de* tests on dartk- configurations',
+ 'terms': 'dartk-,service/de'
+ },
+ {'description': 'analyzer unit tests', 'terms': 'pkg/analyzer/'},
+ {
+ 'description':
+ 'all tests on dart2js strong null-safe configuration',
+ 'terms': 'dart2js-hostasserts-strong'
+ },
+ {'description': 'null-safe language tests', 'terms': 'language/'},
+ ]) ...[
+ SizedBox(height: 12),
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(
+ context,
+ '/filter=${example['terms']}',
+ );
+ },
+ child: Text.rich(
+ TextSpan(
+ text: '${example['description']}: ',
+ children: [
+ TextSpan(
+ text: example['terms'],
+ style: TextStyle(
+ color: Colors.blue[900],
+ decoration: TextDecoration.underline,
+ ),
+ )
+ ],
+ ),
+ ),
+ ),
+ ],
+ SizedBox(height: 24.0),
+ Text(
+ 'About Current Results',
+ style: TextStyle(fontSize: 24.0),
+ ),
+ paragraph('For each test, the results show how many '
+ 'of the selected configurations are passing, failing, and flaky. '
+ 'The item can be expanded to show which configurations are failing,'
+ ' and the configuration names are links to the failure logs.'),
+ paragraph('The clock icon after each test name is a link to the '
+ 'results feed, filtered to show just the history of that test.'),
+ paragraph('Results can be downloaded from the server using the '
+ 'JSON link at the bottom of the page, or as comma-separated '
+ 'text using the text link.'),
+ ]),
+ );
+ }
+
+ Widget paragraph(String text) {
+ return Container(
+ constraints: BoxConstraints(maxWidth: 500.0),
+ padding: EdgeInsets.only(top: 12.0),
+ child: Text(text, style: TextStyle(height: 1.5)));
+ }
+}
diff --git a/current_results_ui/lib/results.dart b/current_results_ui/lib/results.dart
index 7a7e6f3..37e83f8 100644
--- a/current_results_ui/lib/results.dart
+++ b/current_results_ui/lib/results.dart
@@ -4,12 +4,12 @@
import 'dart:html' as html;
-import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:provider/provider.dart';
import 'src/generated/query.pb.dart';
+import 'instructions.dart';
import 'query.dart';
const Color lightCoral = Color.fromARGB(255, 240, 128, 128);
@@ -26,7 +26,7 @@
return Consumer2<QueryResults, TabController>(
builder: (context, queryResults, tabController, child) {
if (queryResults.noQuery) {
- return Align(child: QuerySuggestionsPage());
+ return Align(child: Instructions());
}
bool isFailed(String name) =>
queryResults.counts[name].countFailing > 0;
@@ -165,7 +165,7 @@
onTap: () {
html.window.open(
'https://dart-ci.appspot.com/log/any/'
- '${result.configuration}/latest/${name}',
+ '${result.configuration}/latest/$name',
'_blank',
);
},
@@ -179,60 +179,6 @@
}
}
-class QuerySuggestionsPage extends StatelessWidget {
- Widget build(context) {
- return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(
- 'Enter a query to see current test results',
- style: TextStyle(fontSize: 24.0),
- ),
- SizedBox(height: 24.0),
- Text(
- 'Enter query terms that are prefixes of configuration or test names.'),
- Text('Multiple terms can be entered at once, separated by commas.'),
- SizedBox(height: 12.0),
- Text('Some example queries are:'),
- for (final example in [
- {
- 'description': 'language_2/ tests on analyzer configurations',
- 'terms': 'language_2/,analyzer'
- },
- {
- 'description': 'service/de* tests on dartk- configurations',
- 'terms': 'dartk-,service/de'
- },
- {'description': 'analyzer unit tests', 'terms': 'pkg/analyzer/'},
- {
- 'description': 'all tests on dart2js strong null-safe configuration',
- 'terms': 'dart2js-hostasserts-strong'
- },
- {'description': 'null-safe language tests', 'terms': 'language/'},
- ]) ...[
- SizedBox(height: 12),
- Text.rich(
- TextSpan(
- text: '${example['description']}: ',
- children: [
- TextSpan(
- text: example['terms'],
- style: TextStyle(
- color: Colors.blue[900],
- decoration: TextDecoration.underline,
- ),
- recognizer: TapGestureRecognizer()
- ..onTap = () => Navigator.pushNamed(
- context,
- '/filter=${example['terms']}',
- ),
- )
- ],
- ),
- ),
- ],
- ]);
- }
-}
-
class ResultsSummary extends StatelessWidget {
const ResultsSummary() : super();