Repository navigation
Add a store for cloneable repositories - #6278
Merged
Merged
Conversation
Or else nothing is gonna work
Contributor
|
Are there some release notes related to #5937 that we could/should include here? Maybe something like: [Improved] Maintains state on tabs for different methods of cloning repositories Thoughts? |
iAmWillShepherd
previously approved these changes
Nov 30, 2018
Member
Author
|
@iAmWillShepherd Sorry for the post-review update but I found a race condition that I had missed when the accounts store was updating at the same time as the apiRepositoriesStore was so I decided it was better to fix it now before this PR lands. |
iAmWillShepherd
previously approved these changes
Dec 3, 2018
iAmWillShepherd
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Appreciate your documentation is so clear and concise 👍
This was referenced Dec 6, 2018
Member
Author
|
Ready for one last lookie-loo! |
Contributor
|
Shifting this to 1.5.1 per our team sync today. |
iAmWillShepherd
approved these changes
Dec 10, 2018
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
As part of the onboarding work I'm doing in #5686 I'm going to need access to the list of "cloneable" repositories in the blank slate. Currently the logic for fetching repositories available to the user from the API is contained within the clone dialog itself. This PR extracts that logic into a separate store responsible for loading and refreshing the list of repositories.
The improvements in this PR made the disadvantages of our current shared state model all the more noticeable (you couldn't switch between tabs and maintain selection) so I took the opportunity to remove the shared state n favor of per-tab as users would expect (see #5937). Each tab now maintains its own selection, filter text, path, etc.
Closes #5937 by maintaining separate state for each of the tabs in the clone dialog.
Description
Additional benefits of this change
Memoization
This PR introduces a memoization pattern that we haven't used before in the app which I think could use some further explanation. See the react blog for a good write-up but basically I've made the
CloneGithubRepositorycomponent pure and stateless and used memoization to ensure that we only recompute the filter list groups when necessary.Release notes
[Improved] Clone dialog remembers selections, filter text, and path in each tab
[Improved] The list of repositories in the clone dialog are no longer loaded from the API every time the dialog is opened or when the selected tab changes.
TODO
Automatically refresh the repository list when some amount of time has elapsed since last time?See if we can't get rid of the null state for repositories in theCloneGitHubRepositorycomponent