Skip to content

feat(issue): paginate issue comments and events #848

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

Merged
merged 12 commits into from
Nov 18, 2018

Conversation

chinesedfan
Copy link
Member

@chinesedfan chinesedfan commented Nov 4, 2018

Question Response
Version? v1.6.0
Devices tested? iPhone 6 Plus Simulator
Bug fix? no
New feature? yes
Includes tests? no
All Tests pass? yes
Related ticket? #751

Screenshots

There are several screens that have been refactored.

  • edit-issue-comment
  • issue-settings
  • issue
  • new-issue
  • pull-merge
Before After
edit-issue-comment-old edit-issue-comment
issue-old issue
issue-settings-old issue-settings
new-issue-old new-issue
pull-merge-old pull-merge

Description

This PR loads paginated issue comments and events together by the new API client. Feeling hard to keep sorting by time with two pagination APIs, so I choose the issue timeline API, even though it is still in preview version.

To make this PR as small as possible, feature improvements can include but do not limit to,

  • fetching pull request information by GraphQL
  • fetching repository labels by the new API client
  • designing and controlling navigation params better

@coveralls
Copy link

coveralls commented Nov 4, 2018

Coverage Status

Coverage decreased (-0.09%) to 51.104% when pulling d9f40ac on chinesedfan:paginate-issue-comments into a0d6b06 on gitpoint:master.

@chinesedfan chinesedfan changed the title WIP - feat(issue): paginate issue comments and events feat(issue): paginate issue comments and events Nov 5, 2018
@housseindjirdeh
Copy link
Member

This is so so great, thank you so much. Something we've needed in the app for some time for these screens :)

Will take a look by tonight 🙌

@lex111
Copy link
Member

lex111 commented Nov 8, 2018

@chinesedfan thank you for the excellent work, but I do not yet have the opportunity to check it.

Copy link
Member

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

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

Aside from some tiny nits/comments --> this looks great 😍

THANK YOU FOR THIS, probably one of the things I was looking forward to the most once @machour started restructuring our data flow 👍

@@ -73,6 +73,7 @@ export class Client {
HTML: 'application/vnd.github.v3.html+json',
JSON: 'application/vnd.github.v3+json',
MERCY_PREVIEW: 'application/vnd.github.mercy-preview+json',
MOCKINGBIRD_PREVIEW: 'application/vnd.github.mockingbird-preview+json',
Copy link
Member

Choose a reason for hiding this comment

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

we may want to somehow keep track of when these preview APIs end up changing

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this one opened in 2016, wow lol

https://developer.github.com/changes/2016-05-23-timeline-preview-api/

But still something to keep in mind 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

The other preview API, MERCY_PREVIEW, which was for fetching topics of repository, was replaced by GraphQL. If no so-called preview versions in GraphQL, we can also switch the timeline API.

@@ -314,14 +341,20 @@ class Issue extends Component {
);
};

renderFooter = () => {
return this.props.timelineItemsPagination.nextPageUrl ? (
<LoadingCommonItem />
Copy link
Member

Choose a reason for hiding this comment

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

This is for showing the loading indicator at the bottom when user is pulling the screen up to scroll more right? Maybe we should rename this to LoadingFooterIcon or something similar?

Tiny nit though

Copy link
Member Author

Choose a reason for hiding this comment

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

Naming is one of the most difficult things in computer science. 🙈
I saw other loading components were called loading-xx-item, and thought this one was more in common use. BOOM, loading-common-item.

@chinesedfan chinesedfan merged commit 54b5ff3 into gitpoint:master Nov 18, 2018
@chinesedfan chinesedfan deleted the paginate-issue-comments branch July 12, 2019 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants