Skip to content

Render the overview page with React - #1096

Merged
Ashi Krishnan (queerviolet) merged 59 commits into
masterfrom
qv/react
May 8, 2019
Merged

Ashi Krishnan (queerviolet) merged 59 commits into
masterfrom
qv/react

Conversation

@queerviolet

@queerviolet Ashi Krishnan (queerviolet) commented Apr 1, 2019 •

Copy link
Copy Markdown
Contributor

This PR introduces React, which we then use to render the preview page.

The conversion is fairly straightforward, mostly maintaining the page structure and appearance while converting the plumbing to React. We now use a React context—the PullRequestContext, defined in context.tsx, to pass mutation functions down to components. The context object, initialized at page load time, also maintains the current state of the PR, and sends it to the root component via an event listener.

Fixes #416

TODO:

  • Render the header and details view
  • Render timeline events:
    • Commit
    • Review
    • Merged
  • Render diffs
  • Comment widget
  • Action bar
  • Wire actions via a pull request context
    • For checking out branches
    • For exiting review mode
    • For submitting comments
    • For editing comments

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the structure of this!! Breaking things up into smaller files is really nice. I think having a components folder within preview-src for tsx files would be helpful.

One other piece I noticed was missing is the reviewers/labels sidebar section

Comment thread preview-src/header.tsx Resolved
Comment thread preview-src/header.tsx Resolved
Comment thread preview-src/timeline.tsx Resolved
Comment thread src/common/timelineEvent.ts Resolved
Comment thread preview-src/timeline.tsx Resolved
Comment thread preview-src/header.tsx Resolved
@queerviolet Ashi Krishnan (queerviolet) changed the title Render the overview page with React [WIP] Render the overview page with React Apr 8, 2019
@queerviolet

Copy link
Copy Markdown
Contributor Author

Okay, got through those changes, and finally got us saving and restoring draft comments appropriately. PTAL Rachel Macfarlane (@RMacfarlane) Stanley Goldman (@StanleyGoldman)

Comment thread preview-src/header.tsx Resolved
Comment thread preview-src/header.tsx Resolved
Comment thread preview-src/comment.tsx Resolved
Comment thread preview-src/comment.tsx Resolved
Comment thread preview-src/comment.tsx Resolved
Comment thread preview-src/context.tsx Resolved
Comment thread preview-src/timeline.tsx Resolved
@StanleyGoldman

Copy link
Copy Markdown
Contributor

Two things just noticed, don't want to forget.

  • On leaving a comment, timeout remains pending
  • On leaving a comment, user avatar does not appear

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot load avatars from GitHub Enterprise URLs

4 participants