This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add keyboard shortcuts to report.html
AbandonedPublic

Authored by dcoughlin on Sep 24 2015, 7:24 AM.

Details

Summary

Adds three keyboard shortcuts to report.html
to make navigation faster:

Jump to next path: j
Jump to previous path: k
Show Help: ?

Diff Detail

Event Timeline

skomski updated this revision to Diff 35622.Sep 24 2015, 7:24 AM
skomski retitled this revision from to [analyzer] Add keyboard shortcuts to report.html .
skomski updated this object.
skomski set the repository for this revision to rL LLVM.
skomski added a subscriber: cfe-commits.
dcoughlin edited edge metadata.Sep 29 2015, 6:12 PM

Thanks for the patch! This looks very useful. What browsers does the JavaScript support?

One thing I noticed is that after immediately loading a new report page the 'j' and 'k' shortcuts don't work for me. In Safari, I get:

TypeError: null is not an object (evaluating 'document.location.hash.match(/Path\d+|EndPath/)')
Jumpkeyboard-shortcuts.js:3
onkeydownkeyboard-shortcuts.js:29

After clicking on the location link in the summary the keys do work. (I guess this has to with the # in the location?) Would it be possible to make these navigation keys go to the end of the path after the page has loaded but before the user has clicked on the location link?

tools/scan-build/keyboard-shortcuts.js
24

Will this work on international keyboards where ? is not Shift + '/'? (E.g., AZERTY or QWERTZ?)

skomski updated this revision to Diff 36490.Oct 5 2015, 3:02 AM
skomski edited edge metadata.
skomski removed rL LLVM as the repository for this revision.

Included mousetrap to get keyboard shortcuts working on all international keyboards.
Fixed behaviour without hash path present: Jump to #Path1 on j or k

skomski set the repository for this revision to rL LLVM.Oct 5 2015, 3:03 AM

Thanks for the update. Unfortunately, we can't accept the mousetrap code. Any code contributed to clang needs to be under the UIUC license. The original copyright owner would need to contribute the code under that license.

I think it would be fine to revert to your previous version -- but with a FIXME stating that this doesn't work on non-QWERTY keyboards.

Other than that, this LGTM.

dcoughlin commandeered this revision.Dec 7 2016, 7:50 PM
dcoughlin edited reviewers, added: skomski; removed: dcoughlin.

Commandeering and closing this revision as it has been more than a year.

dcoughlin abandoned this revision.Dec 7 2016, 7:50 PM
dcoughlin marked an inline comment as done.