Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: pkg/analysis_server/lib/src/status/diagnostics.dart

Issue 2933043003: Tweak the look of the ast and element links in the diagnostics page. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/status/pages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/diagnostics.dart
diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart
index 5455a10fc88fe32b0d54a900c8ecbfb5f4d6d416..51cf3d46f282ef545bb405094c3a458bcbb9598d 100644
--- a/pkg/analysis_server/lib/src/status/diagnostics.dart
+++ b/pkg/analysis_server/lib/src/status/diagnostics.dart
@@ -141,10 +141,13 @@ class AstPage extends DiagnosticPageWithNav {
String get description => _description ?? super.description;
@override
+ bool get showInNav => false;
+
+ @override
Future<Null> generatePage(Map<String, String> params) async {
try {
String path = params['file'];
- _description = path == null ? null : 'The AST for $path.';
+ _description = path;
Brian Wilkerson 2017/06/12 13:36:23 I liked having an indication of whether I'm lookin
devoncarew 2017/06/12 13:57:02 I'm happy to revert this, but from playing with th
Brian Wilkerson 2017/06/12 13:59:27 I didn't remember that. As long as it's clear what
await super.generatePage(params);
} finally {
_description = null;
@@ -209,9 +212,8 @@ class DiagnosticsSite extends Site implements AbstractGetHandler {
// Add non-nav pages.
pages.add(new FeedbackPage(this));
-
- secondaryPages.add(new AstPage(this));
- secondaryPages.add(new ElementModelPage(this));
+ pages.add(new AstPage(this));
+ pages.add(new ElementModelPage(this));
}
String get customCss => kCustomCss;
@@ -309,12 +311,18 @@ abstract class DiagnosticPageWithNav extends DiagnosticPage {
{String description})
: super(site, id, title, description: description);
+ bool get showInNav => true;
+
Future<Null> generateContainer(Map<String, String> params) async {
buf.writeln('<div class="columns docs-layout">');
+ bool shouldShowInNav(Page page) {
+ return page is DiagnosticPageWithNav && page.showInNav;
+ }
+
buf.writeln('<div class="one-fifth column">');
buf.writeln('<nav class="menu docs-menu">');
- for (Page page in site.pages.where((p) => p is DiagnosticPageWithNav)) {
+ for (Page page in site.pages.where(shouldShowInNav)) {
buf.write('<a class="menu-item ${page == this ? ' selected' : ''}" '
'href="${page.path}">${escape(page.title)}');
String detail = (page as DiagnosticPageWithNav).navDetail;
@@ -353,10 +361,13 @@ class ElementModelPage extends DiagnosticPageWithNav {
String get description => _description ?? super.description;
@override
+ bool get showInNav => false;
+
+ @override
Future<Null> generatePage(Map<String, String> params) async {
try {
String path = params['file'];
- _description = path == null ? null : 'The element model for $path.';
+ _description = path;
await super.generatePage(params);
} finally {
_description = null;
@@ -719,11 +730,9 @@ class ContextsPage extends DiagnosticPageWithNav {
String elementPath = '/element?file=${Uri.encodeQueryComponent(file)}';
buf.write(file);
- buf.write(' (');
- buf.writeln('<a href="$astPath">ast</a>');
+ buf.writeln(' <a href="$astPath">ast</a>');
buf.write(' ');
buf.writeln('<a href="$elementPath">element</a>');
- buf.write(')');
}
h4('Priority files ${lenCounter(priorityFiles)}', raw: true);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/status/pages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698