Skip to content

Add indicator for unpushed commits - #9366

Merged
outofambit merged 8 commits into
developmentfrom
add-unpushed-commit-indicator
Apr 3, 2020
Merged

outofambit merged 8 commits into
developmentfrom
add-unpushed-commit-indicator

Conversation

@rafeca

@rafeca rafeca commented Mar 26, 2020 •

Copy link
Copy Markdown
Contributor

Closes #5873

Description

This PR adds a small indicator for commits that haven't been pushed to any remote repository (local commits).

Some considerations:

  • The indicator will be shown also for repositories with no upstream, meaning that all their commits will have the indicator. I think we should not show the indicator in that scenario, but don't have strong opinions on it (@billygriffin what do you think?).

Screenshots

Normal mode:

Screenshot 2020-03-26 at 18 30 27

Screenshot 2020-03-26 at 18 30 33

Dark mode:

Screenshot 2020-03-26 at 18 30 55

Screenshot 2020-03-26 at 18 31 01

Long commit text:

Screenshot 2020-03-26 at 18 46 49

Release notes

Notes: [Added] Add indicators to commits that haven't been pushed

@rafeca
rafeca requested a review from outofambit March 26, 2020 17:51
@billygriffin

billygriffin commented Mar 26, 2020 •

Copy link
Copy Markdown
Contributor

@rafeca I agree that if there's no remote, it doesn't make a ton of sense to show this on every commit.

I'm also interested in maybe doing a few usability tests when this gets out to beta to ensure people understand what this means. I'm a little concerned that it's not obvious that the indicator means it hasn't been pushed yet, but that might be unfounded and it is intuitive. @ampinsk thoughts on that?

@ampinsk

ampinsk commented Mar 26, 2020

Copy link
Copy Markdown
Contributor

Also agree on the no remote scenario!

I'm also interested in maybe doing a few usability tests when this gets out to beta to ensure people understand what this means. I'm a little concerned that it's not obvious that the indicator means it hasn't been pushed yet, but that might be unfounded and it is intuitive. @ampinsk thoughts on that?

Always happy to do usability tests! I hope it makes sense considering it borrows the same iconography from the repo indicators and the push/pull button. If it turns out to be super unclear to people I'm happy to rethink it as well.

Also, we could add a tooltip similar to what we do for the repo indicators:

Screen Shot 2020-03-26 at 12 02 27 PM

@rafeca

rafeca commented Mar 26, 2020

Copy link
Copy Markdown
Contributor Author

Also, we could add a tooltip similar to what we do for the repo indicators:

I'm a little concerned that it's not obvious that the indicator means it hasn't been pushed yet.

I think a tooltip will help a lot here! I'll look into it

@rafeca

rafeca commented Mar 27, 2020

Copy link
Copy Markdown
Contributor Author

Also, we could add a tooltip similar to what we do for the repo indicators:

Added in ced302a:

Screenshot 2020-03-27 at 09 36 27

@tierninho tierninho 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.

Tested the following for this change:

  • Functionality and UI for Mac/Windows ✅
  • Tooltip is present ✅
  • Indicator shows on Ahead tab for Compare branches ✅
  • Indicator only shows on remote ✅
  • When adding multiple commits at one time, all show indicator ✅
  • When selecting Update from Master, it pulls in new commits and indicator shown ✅
  • When merging in new commits from another branch, indicator shown for all ✅

⚠️ However, the indicator does not auto-update after the user clicked the Push origin button. Since the same indicator auto-updates on the Repository list, we should do the same here for consistency.

Screen Shot 2020-03-27 at 8 16 34 AM

@rafeca

rafeca commented Mar 30, 2020

Copy link
Copy Markdown
Contributor Author

⚠️ However, the indicator does not auto-update after the user clicked the Push origin button. Since the same indicator auto-updates on the Repository list, we should do the same here for consistency.

Nice catch!! I fixed this issue with the latest commits :)

@tierninho
tierninho self-requested a review March 30, 2020 17:51
tierninho
tierninho previously approved these changes Mar 30, 2020

@tierninho tierninho 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.

Indicator update looks good. Thanks for the fix!

@outofambit outofambit 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.

nailed it

Comment on lines -87 to +93
return this.props.commit.sha !== nextProps.commit.sha
return (
this.props.commit.sha !== nextProps.commit.sha ||
this.props.showUnpushedIndicator !== nextProps.showUnpushedIndicator
)

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 appreciate the restraint here :) or at least, i would have felt tempted to refactor this shouldComponentUpdate away, but i think its better not to in this PR

@outofambit outofambit self-assigned this Apr 3, 2020
@outofambit

Copy link
Copy Markdown
Contributor

@tierninho has already tested this and I've approved it so I'm going to go ahead and this merge now! 🚀

@outofambit
outofambit merged commit 7ba41b3 into development Apr 3, 2020
@outofambit
outofambit deleted the add-unpushed-commit-indicator branch April 3, 2020 21:07
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.

Differentiating commits in history between local-only and remote

5 participants