Skip to content
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

Preferences redesign #8813

Merged
merged 42 commits into from
Jan 15, 2020
Merged

Preferences redesign #8813

merged 42 commits into from
Jan 15, 2020

Conversation

kuychaco
Copy link
Contributor

@kuychaco kuychaco commented Dec 18, 2019

Closes #8774
Closes #7746

Description

From @ampinsk

A few months ago, we introduced a feature that when you have uncommitted changes, we let you either bring the changes to your new branch or leave them on your current branch. Generally this has been really well received, but some folks have specific workflows where this introduces a lot of extra clicks and pain.

We've decided to introduce a preference for this, but our preferences are getting a little overloaded so I assessed a few different ways we could introduce this new setting, including a bigger redesign to our preferences pane

This PR implements the new preference, as well as the redesign of the preferences pane.

Screenshots

Before: Tab design
GitHub_Desktop

After: Sidebar design

  • New side navigation
  • New switching branches preference
  • Reworded the confirmation dialog preferences for less redundancy
  • Moved integration preferences to its own new tab

GitHub_Desktop-dev

GitHub_Desktop-dev

Release notes

Notes: Redesign preferences pane and add preference for stashing changes when switching branches.

@kuychaco kuychaco added this to In Progress PRs in Desktop 2.3 release via automation Dec 18, 2019
@kuychaco kuychaco marked this pull request as ready for review December 27, 2019 22:21
@kuychaco
Copy link
Contributor Author

For when y'all get back from the holidays... 🙏

@ampinsk would love a design review from you! Feel free to make modifications as you see fit (commits are welcome!)

@tierninho would appreciate your QA on this!

@kuychaco kuychaco moved this from In Progress PRs to Awaiting Review in Desktop 2.3 release Dec 27, 2019
@kuychaco
Copy link
Contributor Author

@ampinsk is it desired/expected to have that salmon background color for the merge tool section? It's from a brutalism class

@niik
Copy link
Member

niik commented Jan 2, 2020

@ampinsk is it desired/expected to have that salmon background color for the merge tool section? It's from a brutalism class

@kuychaco That style is one we used to apply in the early days when designs were not finalized yet. @joshaber dubbed it "pink brutalism" and the thinking was that by applying that style a developer could trigger something deep and unsettling within myself or @donokuda and said discomfort would result in us springing into action and finalizing the actual designs before anyone else would see the abhorrent injustice afflicted on the otherwise perfect piece of design that was the Desktop app.

In this case the merge tool selection is behind a dev feature flag because we never ended up shipping it. At some point it might be a good idea to unship all of #2802 since it's been superseded by the in-app conflict resolution work.

@outofambit
Copy link
Contributor

@niik @kuychaco just chiming in to say +1 for removing the merge tool ui from the codebase entirely!

@donokuda
Copy link
Contributor

donokuda commented Jan 2, 2020

[...] discomfort would result in us springing into action and finalizing the actual designs before anyone else would see the abhorrent injustice afflicted on the otherwise perfect piece of design that was the Desktop app.

Poppin' in here to say that the plan backfired and I ended up embracing pink brutalism 😍

Copy link
Contributor

@tierninho tierninho left a comment

Choose a reason for hiding this comment

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

Here are my test results on this feature:

  • No way to tab up/down the menu items
  • Padding here looks very narrow between the button and bottom of the window. Maybe add some?
    Screen Shot 2020-01-03 at 11 11 29 AM
  • Selecting the "Always stash on current branch" option fails to warn the user if a stash is already on that branch.
  • On multiple occasions, the "Always stash on current branch" option resulted in losing the stashed files. After files were stashed, I selected a few other branches and came back to branch with stashed files and no where to be found.
  • Overall the stashing updates were not working correctly. I select "ask me" option, then on the first attempt it asks me, but second it attempt it does not -- the changes are brought over without the prompt due to a protected branch.
  • Line is not the same width
    Screen Shot 2020-01-03 at 11 13 17 AM

@ampinsk
Copy link
Contributor

ampinsk commented Jan 7, 2020

Thank you @kuychaco this is looking so good! 💕 A couple of tiny things I noticed that I wasn't sure how to fix on my own:

Screen Shot 2020-01-07 at 1 07 47 PM

In this screenshot:

  • Looks like the text isn't lining up on the left (you can see based on the red line)
  • The non-selected tab icons should be gray

Screen Shot 2020-01-07 at 1 40 51 PM

In this screenshot:

  • The background color behind the sidebar tabs in dark mode is darker than the tabs, they should be the same dark gray
Before After
Screen Shot 2020-01-07 at 1 37 20 PM Screen Shot 2020-01-07 at 1 39 18 PM
  • For advanced settings, is it possible to get the spacing closer to the screenshot on the right? I tightened the spacing between the row items and increased the spacing between the sections

Let me know if you want to pair on any of this! ✨

kuychaco and others added 6 commits January 8, 2020 13:37
Co-Authored-By: evelyn masso <outofambit@github.com>
Co-Authored-By: evelyn masso <outofambit@github.com>
Co-Authored-By: Amanda Pinsker <apinsker4@gmail.com>
Co-Authored-By: evelyn masso <outofambit@github.com>
Co-Authored-By: Amanda Pinsker <apinsker4@gmail.com>
@kuychaco
Copy link
Contributor Author

Okay! Styling fixes complete! Thanks @outofambit and @ampinsk for your great input 🙏

@ampinsk how does this look for the Advanced section... we can pair if you want to further tweak the spacing. Or you can make changes to the values I used in 5bbc79d

Current State Your Design
GitHub_Desktop-dev Screen Shot 2020-01-07 at 1 39 18 PM

Otherwise I think this is ready for a full code review! /cc @outofambit

@ampinsk
Copy link
Contributor

ampinsk commented Jan 10, 2020

That spacing looks great!!

Just one last thing I noticed from your screenshot is the non-selected icons should be gray 😄 Otherwise this seems ready to go!

@outofambit outofambit self-requested a review January 11, 2020 00:32
@Rexogamer Rexogamer mentioned this pull request Jan 12, 2020
Copy link
Contributor

@outofambit outofambit left a comment

Choose a reason for hiding this comment

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

left some initial thoughts, mostly around types. still need to review the .tsx files more closely.

@@ -1769,6 +1777,12 @@ export class AppStore extends TypedBaseStore<IAppState> {
askForConfirmationOnForcePushDefault
)

const strategy = localStorage.getItem(
uncommittedChangesStrategyKindKey
) as UncommittedChangesStrategyKind
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd really like to avoid using as here, though I'm not sure of a good alternative approach yet. localStorage.getItem can return undefined if the given key doesn't exist, and this implementation tells the compiler that 'undefined' is a valid UncommittedChangesStrategyKind, which will result in runtime errors.

Comment on lines +3055 to +3063
if (hasChanges) {
if (uncommittedChangesStrategy.kind === askToStash.kind) {
this._showPopup({
type: PopupType.StashAndSwitchBranch,
branchToCheckout: foundBranch,
repository,
})
return repository
}
Copy link
Contributor

Choose a reason for hiding this comment

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

😋

Comment on lines 32 to 48
export function getUncommittedChangesStrategy(
kind: UncommittedChangesStrategyKind
) {
switch (kind) {
case UncommittedChangesStrategyKind.AskForConfirmation:
return askToStash
case UncommittedChangesStrategyKind.MoveToNewBranch:
return moveToNewBranch
case UncommittedChangesStrategyKind.StashOnCurrentBranch:
return stashOnCurrentBranch
default:
return assertNever(
kind,
`Unknown UncommittedChangesStrategyKind: ${kind}`
)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I have some concerns about this function, but I think the core of my concern is that it took me a while to figure out what it was doing. Perhaps documenting this to clarify that its primary purpose is to map a kind to an actual UncommittedChangesStrategy?

It feels to me like there's a simpler version of this overall approach, but I'm not sure what it is yet...Is the main reason this exists so that we can store an UncommittedChangesStrategyKind in AppState and convert it to an UncommittedChangesStrategy whenever we use it? perhaps we could store the result of this function in AppState and avoid doing this conversion in many places?

Copy link
Contributor

@outofambit outofambit left a comment

Choose a reason for hiding this comment

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

a few more comments, nothing non-blocking. react components and styling look good to me!


readonly selectedUncommittedChangesStrategy: UncommittedChangesStrategy

readonly hasChangesAndStash: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking idea for a maybe more legible name:

Suggested change
readonly hasChangesAndStash: boolean
readonly couldOverwriteStash: boolean

Comment on lines +42 to +46
(type === TabBarType.Switch
? 'switch'
: type === TabBarType.Vertical
? 'vertical'
: 'tabs')
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to pull this out into a little switch...case with an assertNever, but not a big deal. (non-blocking)


readonly selectedUncommittedChangesStrategy: UncommittedChangesStrategy

readonly hasChangesAndStash: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing as above regarding variable name

outofambit and others added 5 commits January 14, 2020 16:40
useful for getting values out of local storage

Co-Authored-By: Katrina Uychaco <katrina@github.com>
Co-Authored-By: Katrina Uychaco <katrina@github.com>
Co-Authored-By: Katrina Uychaco <katrina@github.com>
Co-Authored-By: evelyn masso <outofambit@github.com>
outofambit
outofambit previously approved these changes Jan 15, 2020
@outofambit outofambit merged commit 91ecdb5 into development Jan 15, 2020
Desktop 2.3 release automation moved this from Review In Progress to PRs For Next Beta Jan 15, 2020
@outofambit outofambit deleted the ku-preferences-redesign branch January 17, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Desktop 2.3 release
PRs For Next Beta
Development

Successfully merging this pull request may close these issues.

Preferences redesign Please allow disabling of the "Switch branch" dialog that offers to stash changes.
7 participants