Skip to content

Display a badge indicating the number of changed files - #4840

Merged
iAmWillShepherd merged 12 commits into
desktop:masterfrom
yongdamsh:impl-#4772
Jun 12, 2018
Merged

iAmWillShepherd merged 12 commits into
desktop:masterfrom
yongdamsh:impl-#4772

Conversation

@yongdamsh

@yongdamsh yongdamsh commented May 31, 2018 •

Copy link
Copy Markdown
Contributor

This change resolves #4772

Changes

  • 47f3029 Add a new component file
  • a629c57 Apply styles to the badge
  • ec0e651 Refactoring with createState function
  • a216ca6 Change FilesChangedBadge component to stateless

Demo

filechangedbadge_demo

@yongdamsh

Copy link
Copy Markdown
Contributor Author

This PR is ready for review!

@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 31, 2018

@iAmWillShepherd iAmWillShepherd left a comment

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.

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.


/** The number that can be displayed as a specific value */
const LargeNumber = 300
const badgeCount =

This comment was marked as spam.

public render() {
const badgeCount = this.state.badgeCount

if (!badgeCount) {

This comment was marked as spam.

Comment thread app/src/ui/repository.tsx Outdated
symbol={OcticonSymbol.primitiveDot}
/>
) : null}
<FilesChangedBadge numFilesChanged={numFilesChanged} />

This comment was marked as spam.

@iAmWillShepherd iAmWillShepherd self-assigned this May 31, 2018
@yongdamsh

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd Thanks for the review 🙏 I reflected them.

iAmWillShepherd
iAmWillShepherd previously approved these changes Jun 1, 2018
@iAmWillShepherd

Copy link
Copy Markdown
Contributor

This is looking good, just need approval from @desktop/design to get it over the line.

@donokuda donokuda self-assigned this Jun 1, 2018

@donokuda donokuda left a comment

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.

✨Thanks for tackling this! 😄
I only have one suggestion. Other than that, this is looking good!

Comment thread app/styles/ui/_tab-bar.scss Outdated
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.

@j-f1

j-f1 commented Jun 1, 2018

Copy link
Copy Markdown
Contributor

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?

@donokuda

donokuda commented Jun 1, 2018

Copy link
Copy Markdown
Contributor

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.)

donokuda
donokuda previously approved these changes Jun 4, 2018
Comment thread app/src/ui/repository.tsx Outdated
className="indicator"
symbol={OcticonSymbol.primitiveDot}
/>
<FilesChangedBadge numFilesChanged={numFilesChanged} />

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

DigiCripto
DigiCripto previously approved these changes Jun 5, 2018
@iAmWillShepherd
iAmWillShepherd dismissed donokuda’s stale review June 5, 2018 13:09

We're going to throw this behind the enableNotificationOfBranchUpdate feature flag

@yongdamsh

Copy link
Copy Markdown
Contributor Author

🚴

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

}

/** The number that can be displayed as a specific value */
const LargeNumber = 300

This comment was marked as spam.

Comment thread app/src/ui/repository.tsx Outdated
.length
const hasChanges = numFilesChanged > 0

if (!hasChanges) {

This comment was marked as spam.

@yongdamsh

Copy link
Copy Markdown
Contributor Author

@shiftkey Thanks for the review! I reflected them.

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but I see @donokuda and @iAmWillShepherd are assigned to this and they might have additional feedback yet

@iAmWillShepherd
iAmWillShepherd merged commit 99fb58d into desktop:master Jun 12, 2018
@iAmWillShepherd

Copy link
Copy Markdown
Contributor

Thanks for your contribution @yongdamsh! 🎉

@yongdamsh
yongdamsh deleted the impl-#4772 branch June 13, 2018 08:42
@shiftkey shiftkey mentioned this pull request Jun 20, 2018
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 2018
@desktop desktop unlocked this conversation Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants