GithubHelp home page GithubHelp logo

github-pull-review's People

Contributors

illicitonion avatar kegsay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

illicitonion yuit

github-pull-review's Issues

Done/Not Done lists per PR

We have the concept of done markers in #24. This should be used to present a 2 column table of "Done" and "Not done" items. Each item is a comment thread (Line comments on same line or "Needs action:" overview comments with linked comment IDs as "Done").

Diff parser breaks for submodule updates

https://review.rocks/#/repos/illicitonion/testrepo-hassubmodule/2/diffs?_k=fnpt66

Err getting diffs: {}(anonymous function) @ bundle.js:1851
bundle.js:1852 TypeError: Cannot read property '1' of null
    at https://review.rocks/bundle.js:3207:53
    at Array.map (native)
    at Function.calculateLineData (https://review.rocks/bundle.js:3194:44)
    at new Patch (https://review.rocks/bundle.js:3011:30)
    at new FileDiff (https://review.rocks/bundle.js:2662:26)
    at https://review.rocks/bundle.js:1682:16
    at Array.map (native)
    at Object.module.exports.getDiffsFromGithubApi (https://review.rocks/bundle.js:1681:21)
    at https://review.rocks/bundle.js:2016:34
    at tryCatcher (https://review.rocks/bundle.js:9558:23)
    at Promise._settlePromiseFromHandler (https://review.rocks/bundle.js:7664:31)
    at Promise._settlePromiseAt (https://review.rocks/bundle.js:7738:18)
    at Promise._settlePromises (https://review.rocks/bundle.js:7854:14)
    at Async._drainQueue (https://review.rocks/bundle.js:5144:16)
    at Async._drainQueues (https://review.rocks/bundle.js:5154:10)
    at Async.drainQueues (https://review.rocks/bundle.js:5036:14)

Code edit suggestions

You should be able to provide code suggestions when viewing up to HEAD commits. Perhaps double-clicking a line brings you into an "editor view" with a "Suggest" button? When you hit the button it will leave a commit comment with the diff hunk embedded in it to the effect of:

Suggestion:

@@ -11,1 +11,1
- var foo = "bar";
+ var foo = "beer";

When Github Pull Review sees a comment matching this form it can then pretty-display the diff hunk and add 2 buttons (YUP/NOPE) and if you hit YUP it will do the commit. Commit can be done using something like http://www.mdswanson.com/blog/2011/07/23/digging-around-the-github-api-take-2.html

Anchor tag line comments

We really need anchor tags on:

  • Files
  • Line numbers (per-file too)
    • Github looks to use the format diff-$SHA_OF_FILE[L|R]$NUM - e.g. diff-48205bd927ef9295872L57
    • the SHA is pretty opaque, so it'd be nice to do diff-$FILEPATH-[L-R]$NUM e.g. diff-foo/bar.py-L89
    • But id= attributes have limited character ranges (ASCII) which I guess is why they chose SHAs...
  • Line comments
    • Do like github and have the id=the comment ID

When you hit the BASE -> COMMENT button, the comment will be somewhere as a line comment so we should jump to it.

When you hit COMMENT -> HEAD, the file may be really small/big, so should jump to the start of the file in question.

Sort out list / auth pages

Specifically, /list should be accessible from somewhere and we need an auth page so we can remove InfoGetter.

Comments are not remembered

Write a line comment then swap to another tab (e.g. commits) and then back again, and poof your comment has magically disappeared. Same applies to going to unified view. We really should remember this...

Collapse moved sections

Subsections of diff chunks may be the same because they were moved. We should [...] them. Good heuristic would be:

if there is a 15+ line block which has been +/-d:

  • collapse both of them
  • Link one to the other (anchor)
  • Allow expansion of it somehow

We can't compare on lines alone though (think keeping within 80 char limits, you shuffle words about)
so we should try to do this based on tokenised words (but careful with semantics here on actual code where indentation matters like python)

New PR doesn't fully clobber old PR

If you're on the file diff view and type in a new PR and hit "View", it clobbers the PR object but doesn't re-collect the diffs, getting this weird stale set of diffs.

Overview page incorrectly says "awaiting your response"

This is because there is an outstanding action. The logic should check if the last comment on the line is by the author and then move from "awaiting your response" to "awaiting their action" if all actions are like this.

Side by side diffs layout

Two tables was a mistake. One table spanning lots of rows is better. Two tables was a mistake because:

  • We want to word wrap lines because Ugh Scrolling. If the right side goes onto a new line but the left side doesn't... we need some communication mechanism (or mediator) between the two tables. With a single table, this Just Works.
  • When you select a line to comment on, there's a ton of logic to do the same on the other table and hide the resulting duplicate comment box. Apart from being a terrible thing to do, it breaks when you preview the comment which resizes the view (needing some communication mechanism again...)
  • Some code highlighters can subtly adjust the size of the text. Depending on the code on each side, this can add up to a row or two by the time you get to the bottom of the file :(

In short, use a single table for side-by-side diffs.

Uncaught error

Uncaught Error: Action 'get_commit_diffs_response' was emitted but failed to pass the schema. Expected 'diff' to be of type object but was actually of type undefined

When trying to view the commit diff (1->HEAD) on an added file: event-schemas/schema/v1/m.room.third_party_invite

Action todo state should actually be tri-state

States should be:

TODO (they left you something to do, and you haven't done it)
Done (you have done it)
InQuestion (they've left you something to do, you've asked a question, waiting on their reply)

Toggle button to make all diffs in a PR be unified rather than split.

It seems that one can switch the diffs for individual files to be unified rather than split, but there doesn't seem to be a way to convert all of the files to be unified.

I would find it useful if the tool recorded the preference for unified vs split across browser sessions, and applied the preference to all PRs since some of my devices have narrow screens where unified diffs are easier to read.

Error messages

We display absolutely no error messages at all currently. Let's fix that.

Done markers

Each actionable comment (that is, first comment on a line, or any overview comment with the text "Needs action:") has a check box "Done?". If you tick it, it replies with a comment "Done." (which is suppressed on the UI). Subsequent replies on line comments "undones" the comment thread. This is done by unticking the box (which prompts for a "Reason:").

Examples: (A=Reviewer, B=Reviewee)

Basic:

  • A: Post line comment [1 undone item]
  • B: Pushes commits
  • B: Ticks done box (replies with "Done.") [0 undone items]

Basic with non-actionable overview:

  • A: Posts line comments [2 undone items]
  • A: Posts "LGTM modulo comments" [2 undone items]
  • B: Pushes commits
  • B: Ticks "done" boxes [0 undone items]

Basic with actionable overview:

  • A: Posts line comments [2 undone items]
  • A: Posts actionable overview comment (Tick "Actionable?" box with prefixes comment with "Needs action:" [3 undone items]
  • B: Pushes commits
  • B: Ticks "done" boxes [0 undone items]

Ping-pong:

  • A: Posts line comment [1 undone item]
  • B: Ticks done box [0 undone items]
  • A: Posts on same line. This is undone as last comment isn't "Done." [1 undone item]
  • B:Ticks done box [0 undone items]
  • ...

Overview comments:

  • A: Post overview comment marked as "Actionable?".
  • B: Marks overview comment as Done (with optional reason) - This inserts the comment "[url to comment id] Done. [reason]" so we can pair up multiple actionable overview comments (line comments are easier since the line determines the thread).

Hook up prev/next diffs and add icons

Each comment has a prev/next diff which aren't hooked up. They should:

  • Be replaced with icons BASE -> O -> O -> CMT etc
  • Be greyed out if you're already viewing those diffs

Show commit comments

A commit object has a commit.comment_count value - if it's >0, we should follow its top-level comments_url property and display commit comments.

UX for comments on different commits

There is currently a "Show all comments" button which is cool I guess. My beef is with the comment header which Unhelpfully says the short SHA e.g. (abcd123). This is bad because you have no clue if this is ancient or really recent.

Given we know the commits and the order... we should probably say "1 commit ago" or "1 commit later" rather than the hash (and maybe <a> the text to dump you to the commit itself on GH)

Not all comments are shown :(

We should probably do pagination to get at all the comments... else we only get the first 30 from /comments. Looks like there is a Link: header which basically appends &page=2

Mobile CSS

It looks very littlebig planet atm...

Comment to HEAD on Actions page

Should be hooked up so it goes to /diffs, to the right file (needs anchoring), to the right base/head comparison (needs query params), to the right line (needs anchoring).

Comment line is wrong when viewing non BASE-HEAD diffs

If you view a SHA-HEAD diff and leave a line comment, it leaves a comment on that line number on the BASE-HEAD diff, which may be woefully different to the intended line. This is actually kinda hard to fix without doing per-commit comments (which GH supports and shows in the PR UI but we don't do yet).

Type checking

Use Flow for type checking rather than the current action bodge.

Listing commits on *base* branch

List N commits done on the TARGET (base) next to merge button (expand to commit list, expand again to file diff) - complicated by merging from master to branch (which should reduce the count)

Expand diff chunks to the rest of the file

You should be able to click hunks to expose more of the file.

Steps:

  • Do a GET to the file in question
  • Match it up to the diff chunk
  • Linkify the hunk to expose it when clicked (first cut do it all, paginate in later cuts)

Travis CI

Would be good to use it. And you know, have some tests.

Store system

We need a new concept of a Store class. This stores the currently active PullRequest and is the de jure source for PR info. This entity is the thing which should dispatch PullRequestTriggers when the underlying PR is updated.

We should remove LineCommentsTrigger and FileDiffsTrigger and replace them with PullRequestTrigger which has a before and after prop for the PullRequest, along with changed fields.

The intention here is to avoid the controller doing too much (managing state rather than orchestrating other components) and to allow us to do things like "local echo" comments without instigating HTTP hits (we could do it all locally and then have the store broadcast the change).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.