From 36f80b0bb1468797ae6282d551a4d7c1630fa0e0 Mon Sep 17 00:00:00 2001 From: Priyanka Date: Tue, 14 Sep 2021 16:07:34 +0000 Subject: [PATCH] Minor display changes for transitions and errors. Split the transitions and errors search into separate tabs in the search bar. Shortened the error tooltip on trace views. Bug: b/199891856 Test: upload any trace with errors and transitions (see bug for example). Change-Id: I9bde012761bcd83933ffb269442e49133b3b75e5 --- tools/winscope/src/App.vue | 15 +++++- tools/winscope/src/DefaultTreeElement.vue | 8 ++- tools/winscope/src/Searchbar.vue | 60 ++++++++++++++++------- tools/winscope/src/utils/consts.js | 3 +- 4 files changed, 65 insertions(+), 21 deletions(-) diff --git a/tools/winscope/src/App.vue b/tools/winscope/src/App.vue index 78e3dec25..95aa8a7d1 100644 --- a/tools/winscope/src/App.vue +++ b/tools/winscope/src/App.vue @@ -165,12 +165,23 @@ export default { }, /** Set flicker mode check for if there are tag/error traces uploaded*/ shouldUpdateTagAndErrorTraces() { - return this.tagFiles.length > 0 || this.errorFiles.length > 0; + return this.hasTagTrace() || this.hasErrorTrace(); + }, + hasTagTrace() { + return this.tagFiles.length > 0; + }, + hasErrorTrace() { + return this.errorFiles.length > 0; }, /** Activate flicker search tab if tags/errors uploaded*/ updateSearchTypes() { this.searchTypes = [SEARCH_TYPE.TIMESTAMP]; - if (this.tagAndErrorTraces) this.searchTypes.push(SEARCH_TYPE.TAG); + if (this.hasTagTrace()) { + this.searchTypes.push(SEARCH_TYPE.TRANSITIONS); + } + if (this.hasErrorTrace()) { + this.searchTypes.push(SEARCH_TYPE.ERRORS); + } }, /** Filter data view files by current show settings*/ updateShowFileTypes() { diff --git a/tools/winscope/src/DefaultTreeElement.vue b/tools/winscope/src/DefaultTreeElement.vue index 96c7dcf09..ac03f9b8f 100644 --- a/tools/winscope/src/DefaultTreeElement.vue +++ b/tools/winscope/src/DefaultTreeElement.vue @@ -52,7 +52,7 @@
- Error: {{error.message}} + {{errorTooltip(error.message)}}
@@ -80,6 +80,12 @@ export default { transitionTooltip(transition) { return transitionMap.get(transition).desc; }, + errorTooltip(errorMessage) { + if (errorMessage.length>100) { + return `Error: ${errorMessage.substring(0,100)}...`; + } + return `Error: ${errorMessage}`; + }, }, components: { Arrow, diff --git a/tools/winscope/src/Searchbar.vue b/tools/winscope/src/Searchbar.vue index efc8f0a2a..3c06a28e7 100644 --- a/tools/winscope/src/Searchbar.vue +++ b/tools/winscope/src/Searchbar.vue @@ -27,19 +27,19 @@ /> - Go to timestamp - + class="md-dense md-primary search-timestamp-button" + @click="updateSearchForTimestamp" + > + Go to timestamp + -