Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1600759 - Perfherder's Graph Alt. View for Screen Readers #6001

Merged
merged 8 commits into from Mar 4, 2020

Conversation

yogmel
Copy link
Contributor

@yogmel yogmel commented Feb 13, 2020

Description of issue

Perfherder's Graph View contains graphs and elements which are not screen reader accessible.

Tasks:

  • Get Graph data into table;
  • Highlight Revision;
  • Add Tooltip information;
  • When highlight, show and focus highlighted row;
  • Toogle column's visibility;
  • Add tests.

Next PR:

  • (Needs investigation) Show trends and outliers;

Proposed Solution

Perfherder's Graph View, with the Table showing. On the left, there are legend cards, with all tests information. Turned on tests have distinct colors, such as blue and red and different icons. On the right, there is first a row of buttons: "Last day", "Add test data" and "Graphs View". Below that, there is the table, with navigation on top. The first column refers to the revision test date. The other columns correspond to each test data. There 7 columns in total (One is the date column and the other six are tests). Some rows have a yellow background. Below the table, there are two input fields and a "Highlight alerts" button.

  • A button next to "Add test data" was added, to toggle between Graph and Table view.

  • If there is any highlighted revision, its table row will have a yellow background and an aria-label of "highlighted revision".

  • Users can show and hide test via Checkbox in Legend Card:
    The same table as the first screenshot, but the first two Legend cards are turned off, that is, they are grey. This reflects in the table, which now has 5 columns instead of 7.

Testing

  • Compared some data points in the graph to the ones shown in table cells.
  • Turned highlighted revisions on and off and check if it propagated both in the graph and table.
  • Still was not able to test with SR. I will edit here once it's done.

@yogmel yogmel self-assigned this Feb 13, 2020
@yogmel yogmel added this to In progress in Outreachy a11y improvements via automation Feb 13, 2020
@codecov-io
Copy link

codecov-io commented Feb 13, 2020

Codecov Report

Merging #6001 into master will increase coverage by 0.7%.
The diff coverage is 74.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #6001     +/-   ##
=========================================
+ Coverage   72.06%   72.76%   +0.7%     
=========================================
  Files         456      458      +2     
  Lines       18905    18988     +83     
  Branches     1534     1554     +20     
=========================================
+ Hits        13623    13817    +194     
+ Misses       4957     4842    -115     
- Partials      325      329      +4
Impacted Files Coverage Δ
ui/perfherder/graphs/GraphsView.jsx 0% <0%> (ø) ⬆️
ui/perfherder/graphs/GraphsViewControls.jsx 62.96% <40%> (-2.26%) ⬇️
ui/perfherder/graphs/GraphsContainer.jsx 63.3% <50%> (-0.2%) ⬇️
ui/perfherder/graphs/TableView.jsx 96.92% <96.92%> (ø)
tests/selenium/pages/log_viewer.py 100% <0%> (ø)
treeherder/model/models.py 91.41% <0%> (+0.6%) ⬆️
treeherder/webapp/api/refdata.py 92.59% <0%> (+3.7%) ⬆️
treeherder/webapp/api/jobs.py 91.3% <0%> (+3.86%) ⬆️
treeherder/webapp/api/serializers.py 96.87% <0%> (+4.16%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99d0202...8037617. Read the comment docs.

@yogmel
Copy link
Contributor Author

yogmel commented Feb 13, 2020

Hi @camd and @sarah-clements ,
I have some comments:

  • I separated in commits to facilitate review;
  • GraphsContainer make it look like a lot of changes were done, but I added only a {!showTable && ()} around the component. The other changes was made by yarn lint I suppose.
  • I couldn't figure out how to get links and content from GraphTooltip, so I will need some help in this.

Thanks!

Copy link
Contributor

@camd camd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I'd be curious if you could have Marco give it a test drive on prototype. Or perhaps you already did? :)

@yogmel
Copy link
Contributor Author

yogmel commented Feb 14, 2020

Hi @camd, I still didn't talk to him about this PR, but I would love to do it.
I will try to schedule a call with him and ask someone to deploy this at prototype, if possible.

@MarcoZehe
Copy link

Note that from a markup point of view, this looks good to me.

@sarah-clements
Copy link
Contributor

sarah-clements commented Feb 14, 2020

Great start! A few comments on the layout/visuals:

  1. I don't think we need the legend cards on the left, since any relevant information is already in the column headers. Whatever is missing can be added (such as the framework, but I don't think we need the signature hash).

  2. We don't need to make this as visually colorful as the graph. To keep it simple - and since the primary target is screen reader users - I think we should omit the colors on the columns used to differentiate the tests.

  3. For the highlighting of revisions, please make it a color that matches with the secondary or info colors (like a light info color that's used for Alerts) and have it go all the way across the column.

  4. For the aria-label of "highlighted revision" will this also convey the revision number too or is it communicated some other way?

ui/css/perf.css Outdated Show resolved Hide resolved
@ionutgoldan
Copy link
Contributor

ionutgoldan commented Feb 17, 2020

@bebef1987 @marianrai @alexandru-io please do a manual QA check for this PR, so I know you're ok with the changes done in Graphs view.

@bebef1987
Copy link
Contributor

Please add Commit information and a link to treeheder.
The current table format is not usable as the graph view

@alexandru-io
Copy link
Contributor

alexandru-io commented Feb 17, 2020

  • 1. I would place the Table/Graph view toggle before the Time range button and eventually search for a more representative toggle button graphic.

Screenshot from 2020-02-17 11-20-09

  • 2. I would replace the Date column with the Commit one, with a link to pushlog and jobs, just like in the graph view. Eventually include in a tool-tip or parenthesis the date of the revision.

Screenshot from 2020-02-17 11-29-36

  • 3. I would use another (eye-comforting) color to highlight the revisions and include the first column also in the highlight. I would also improve the number formatting for a better readability and the measurement unity (3151094.00 -> 3,151,094) and cut the zeroes when they contain no data.

Screenshot from 2020-02-17 11-31-19

  • 4. I would use the empty row in the middle of the data columns on the top to represent to color of the test data and format the signature as in the legend card:
|   color   |
| Test name |
| repo      |
| platform  |

Screenshot from 2020-02-17 11-37-44
Screenshot from 2020-02-17 11-37-33

  • 5. The color difference between Previous/Next button when they're available/not is too small when as they they're both available they look much like they are not.
    Previous = unavailable, Next = available
    Screenshot from 2020-02-17 11-44-04
    Previous = available, Next = available
    Screenshot from 2020-02-17 11-44-12

Copy link
Contributor

@alexandru-io alexandru-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great work and I didn't find functionality issues yet, but in terms of usability the fixes above seem fair to me.

@sarah-clements sarah-clements temporarily deployed to treeherder-perfherder-a-1ohv8a February 18, 2020 19:51 Inactive
@yogmel yogmel force-pushed the perfherder-alternative-graph branch from 1718e10 to 0ec9304 Compare February 19, 2020 20:50
@yogmel
Copy link
Contributor Author

yogmel commented Feb 20, 2020

This last commit adds most of the suggestions made above.

The information from the tooltip was inserted. The "job, compare" links only appear when there is a mouse hover or a keyboard focus.

There are still some additional tasks and tests to be made that I will update on the PR description.

Screenshot of Graphs's Table View. From top to bottom, there is a row of buttons: "Graphs View", "Last 14 days", "Add test data". Down below, there is a table with navigation buttons. There are 4 columns and 10 rows (except for table header). The first table header is Date. The following ones are related to tests - there is a color border on top, the test name, a hint (lower is better), and the platform. The rows contain the number, with the delta on the side. Down below the row content, there is the job and compare links. Below the table, there are 2 inputs and a button "Highlight Alerts"

@yogmel yogmel force-pushed the perfherder-alternative-graph branch from 0ec9304 to 58b09d6 Compare February 20, 2020 13:20
@alexandru-io
Copy link
Contributor

alexandru-io commented Feb 20, 2020

@yogmel this looks much better.
I tested around some scenarios and there are few issues:

  • when i tried to add a new test data in table view I am getting the error: Something went wrong TypeError: original[deltaValueKey] is undefined, but not for all tests. Couldn't identify for what tests. For example I tried to add a talos test on a graph with raptor. But only table view throws this error. After F5 the page is loaded successfully on graph view, but it's thrown back when toggling to table view.

  • Not sure how the data is sorted, but something doesn't seem right. In the screesnhot below the dates end at Feb 20 (today) and continues from Jan 21 next hour after the previous from Feb 20. According to the timerange filter, the data should indeed stop on Jan 21, but the ascending/descending date sorting should be (Jan 21 ... Feb 20)/(Feb 20 ... Jan 21). Guess you need to change the data type of the filter.
    Screenshot from 2020-02-20 15-50-13

  • Not sure whether you got to work on this or you're going to, but the information about repo and platform still looks "unfinished".

Overall this is a good piece of work. Few more fixes and we're good to go.

@yogmel yogmel force-pushed the perfherder-alternative-graph branch 2 times, most recently from e807134 to 2676d24 Compare February 27, 2020 16:42
@yogmel
Copy link
Contributor Author

yogmel commented Feb 27, 2020

In this latest push:

  • Add some tests: table_view_text.jsx and I had to create a mock data performance_testData.json.

  • Jamie's request (Screen-Reader improvements):

    • Job and compare links are not SR accessible while hidden. For that reason, I made them appear all the time, but with low opacity. When focused or hovered, the links have full opacity (file: perf.css);
    • "Table View" button is not the first element on DOM. The proposed solution here was to insert a sr-only button before the Legend Cards (file: GraphsView.jsx).
  • Add test Badge, for example "talos", "raptor" (file: TableView.jsx).

Screenshot of Graphs's Table View. From top to bottom, there is a row of buttons: Graphs View, Last 14 days, Add test data. Down below, there is a table with navigation buttons. There are 4 columns and 10 rows (except for table header). The first table header is Date. The following ones are related to tests - there is a color border on top, the test name, a hint (lower is better), a test badge, and the platform and repo. The rows contain the number, with the delta on the side. Down below the row content, there is the job and compare links.

In TableView.jsx:

  • Refactor:

    • Separate into different functions;
    • Optimized data structure;
  • Fix date sorting

  • Fix "add test data" error: @alexandru-io I think that error was triggered when tests with empty cells were chosen. If that's not the case, and the problem still persists, please let me know.

@yogmel
Copy link
Contributor Author

yogmel commented Feb 27, 2020

Not sure whether you got to work on this or you're going to, but the information about repo and platform still looks "unfinished".

@alexandru-io Thanks for your input!
Do you mean the style or the functionality? I realized later that users can click on repo and platform names on the Legend Card and it will open the "add test modal". Is that what you meant?

let prevRevision;
let pushUrl;
if (prevFlotDataPointIndex !== -1) {
prevRevision = item.data[prevFlotDataPointIndex].revision;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this logic from the tooltip can be put into a helper function to be used by both components. That way if it needs to be changed in the future, you only have to change it in that helper function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yogmel, @sarah-clements just be aware that there's an open PR 6066 that is fixing the empty pushlogs from graph tooltip that appears from the second data-point (first retrigger) of a revision. This is because prevRevision is taking the revision hash from prevFlotDataPointIndex, and if the revision is the same, the pushlog link generated is not correct.

Moving this to a helper function might make fixing this bug harder if it doesn't pass dataPointDetails and testDetails as params. I don't mind either if you include the fix into this PR. Whatever works best for you. Thanks

@sarah-clements
Copy link
Contributor

sarah-clements commented Feb 28, 2020

This looks good but let's focus on getting this approved and landed. You should do any follow up improvements/functionality and features in a separate pull request, otherwise this will get too big.

dataIndex,
dataPoint,
highlightAlerts,
highlightedRevisions,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed in this file from the last commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some functions were created and I changed the data structured sent to the table. I basically removed this and moved it into an object. I thought it was cleaner.

Before | Current

(there are some lines highlighted, but apparently Github doesn't jump to them when you click the link)

@yogmel yogmel force-pushed the perfherder-alternative-graph branch from 2676d24 to 89d0f2f Compare February 28, 2020 17:39
@yogmel
Copy link
Contributor Author

yogmel commented Feb 28, 2020

I have implemented @sarah-clements's suggestions.

About the separation of helpers' functions, I can wait for @alexandru-io merge or implement in the follow-up PR.

@sarah-clements
Copy link
Contributor

sarah-clements commented Feb 28, 2020

I tested this and I noticed that the 'highlight alerts' button next to the input boxes is controlling the highlighting for the revisions. Those are two separate features (check the implementation in the graphs view). So the toggle for highlight alerts should not control whether the revisions are highlighted. If you want to see a highlighted alert, go to the alerts view and hover over a test - click on the graphs link (the effect on the datapoint is the same). If we don't have the highlight alert functionality implemented in this pr, that button should be hidden until it's implemented.

Also, please file new bugs for the additional features to be added. @yogmel you can assign yourself to them, but we should have bugs filed.

@yogmel
Copy link
Contributor Author

yogmel commented Feb 29, 2020

@sarah-clements I have found the piece of code that gets the query params, but I would like to discuss options before making a move. This latest push hides the highlight alerts input in the table view.
I'll file all bugs at the start of next week. :)

@yogmel yogmel force-pushed the perfherder-alternative-graph branch from 011532e to 8037617 Compare March 3, 2020 14:25
@yogmel
Copy link
Contributor Author

yogmel commented Mar 3, 2020

@sarah-clements ok, changed to hide only the "Highlight Alerts" button. Input fields are still shown and highlight cells.

Copy link
Contributor

@sarah-clements sarah-clements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks for all your hard work on this :)

@sarah-clements sarah-clements merged commit 5a8c470 into mozilla:master Mar 4, 2020
Outreachy a11y improvements automation moved this from In progress to Done Mar 4, 2020
@alexandru-io
Copy link
Contributor

Yep, looks good. Even the platform | repo thing looks better now with that nuance of gray. Good job, @yogmel !

@yogmel
Copy link
Contributor Author

yogmel commented Mar 4, 2020

Thank you, everyone :)

SuyashSalampuria pushed a commit to SuyashSalampuria/treeherder that referenced this pull request May 12, 2020
…a#6001)

Create a table view in graphs for screen reader users; add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
8 participants