Repository navigation
Display a badge indicating the number of changed files - #4840
Conversation
|
This PR is ready for review! |
iAmWillShepherd
left a comment
There was a problem hiding this comment.
This is looking really good! Just a few changes needed to get it merged in 👍
| readonly numFilesChanged: number | ||
| } | ||
|
|
||
| interface IFilesChangedBadgeState { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** The number that can be displayed as a specific value */ | ||
| const LargeNumber = 300 | ||
| const badgeCount = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| public render() { | ||
| const badgeCount = this.state.badgeCount | ||
|
|
||
| if (!badgeCount) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| symbol={OcticonSymbol.primitiveDot} | ||
| /> | ||
| ) : null} | ||
| <FilesChangedBadge numFilesChanged={numFilesChanged} /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@iAmWillShepherd Thanks for the review 🙏 I reflected them. |
|
This is looking good, just need approval from @desktop/design to get it over the line. |
donokuda
left a comment
There was a problem hiding this comment.
✨Thanks for tackling this! 😄
I only have one suggestion. Other than that, this is looking good!
| background-color: var(--tab-bar-count-background-color); | ||
| margin-left: 4px; | ||
| padding: 2px 5px; | ||
| font-size: var(--font-size); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
I feel like the list header is redundant now (the count is displayed in the tab, and the only thing we’d lose would be the checkbox to de/select everything). What do you think? |
I can see that; however, I'm fine with keeping the list header how it is currently. The header will help reinforce the meaning behind the counter (i.e., the number of files changed.) |
| className="indicator" | ||
| symbol={OcticonSymbol.primitiveDot} | ||
| /> | ||
| <FilesChangedBadge numFilesChanged={numFilesChanged} /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We're going to throw this behind the enableNotificationOfBranchUpdate feature flag
|
🚴 |
shiftkey
left a comment
There was a problem hiding this comment.
Some suggestions about naming things to make it a bit more readable and self-descriptive
| import * as React from 'react' | ||
|
|
||
| interface IFilesChangedBadgeProps { | ||
| readonly numFilesChanged: number |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| /** The number that can be displayed as a specific value */ | ||
| const LargeNumber = 300 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .length | ||
| const hasChanges = numFilesChanged > 0 | ||
|
|
||
| if (!hasChanges) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@shiftkey Thanks for the review! I reflected them. |
shiftkey
left a comment
There was a problem hiding this comment.
LGTM, but I see @donokuda and @iAmWillShepherd are assigned to this and they might have additional feedback yet
|
Thanks for your contribution @yongdamsh! 🎉 |
This change resolves #4772
Changes
createStatefunctionFilesChangedBadgecomponent to statelessDemo