Skip to content

Commit

Permalink
Highlight comments that start with "await:" (#42)
Browse files Browse the repository at this point in the history
Allow reviewers to help developers focus their attention on the comments that they want to see again (e.g. the reason why they voted Waiting on Author or Rejected).
  • Loading branch information
alejandro5042 authored Jan 8, 2020
1 parent 11cae9b commit fbcefbd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ Reviewing a large PR? Press the auto-collapse button to make your tree manageabl

![Collapse folders.](static/collapse-folders.png)

Finally, PR threads that start with `note:` (case insensitive) will appear expanded on page load, **even if they are closed**. They are also highlighted with a light border:
PR threads that start with `note:` (case insensitive) will appear expanded on page load, **even if they are closed**. They are also highlighted with a light border. Use this to mark interesting things for your reviewers in your PR!

![Sticky comments are highlighted.](static/sticky-comment-highlighting.png)

Use this to mark interesting things for your reviewers in your PR!
PR comments that start with `await:` (case insensitive) will appear highlighted. Use this to help developers focus their attention on the comments that you want to see again (e.g. the reason why you voted Waiting on Author or Rejected).

![Await comments are highlighted.](static/await-comments.png)

### Better owners review

Expand Down
16 changes: 15 additions & 1 deletion src/azdo-pr-dashboard.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==

// @name AzDO Pull Request Improvements
// @version 2.30.1
// @version 2.31.0
// @author Alejandro Barreto (National Instruments)
// @description Adds sorting and categorization to the PR dashboard. Also adds minor improvements to the PR diff experience, such as a base update selector and per-file checkboxes.
// @license MIT
Expand Down Expand Up @@ -52,6 +52,7 @@
addBaseUpdateSelector();
makePullRequestDiffEasierToScroll();
applyStickyPullRequestComments();
highlightAwaitComments();
addAccessKeysToPullRequestTabs();
if (/\/DevCentral\/_git\/ASW\//i.test(window.location.pathname)) {
addNICodeOfDayToggle();
Expand All @@ -63,6 +64,19 @@
applyNicerScrollbars();
}

function highlightAwaitComments() {
// Comments that start with this string are highlighted. No other behavior is given to them.
const lowerCasePrefix = 'await:';

addStyleOnce('highlight-await-comments', /* css */ `
.vc-discussion-thread-box .vc-discussion-thread-comment .vc-discussion-thread-renderparent[content^="${lowerCasePrefix}" i] {
border: 2px solid rgb(var(--palette-accent3));
border-radius: 5px;
margin: 7px 0px;
padding: 10px 15px;
}`);
}

function applyStickyPullRequestComments() {
// Comments that start with this string become sticky. Only the first comment of the thread counts.
const lowerCasePrefix = 'note:';
Expand Down
Binary file added static/await-comments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fbcefbd

Please sign in to comment.