Skip to content

Preferences redesign - #8813

Merged
outofambit merged 42 commits into
developmentfrom
ku-preferences-redesign
Jan 15, 2020
Merged

outofambit merged 42 commits into
developmentfrom
ku-preferences-redesign

Conversation

@kuychaco

@kuychaco kuychaco commented Dec 18, 2019 •

Copy link
Copy Markdown
Contributor

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 marked this pull request as ready for review December 27, 2019 22:21
@kuychaco

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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

niik commented Jan 2, 2020

Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor

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

@donokuda

donokuda commented Jan 2, 2020

Copy link
Copy Markdown
Contributor

[...] 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 😍

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

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

@joshaber

joshaber commented Jan 6, 2020

Copy link
Copy Markdown
Contributor

[...] 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 😍

Bloopin' in here to say that @donokuda is a creative genius without equal in this world.

Co-Authored-By: evelyn masso <[email protected]>
@ampinsk

ampinsk commented Jan 7, 2020 •

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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

ampinsk commented Jan 10, 2020

Copy link
Copy Markdown
Contributor

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

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

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

Comment thread app/src/lib/stores/app-store.ts Outdated

const strategy = localStorage.getItem(
uncommittedChangesStrategyKindKey
) as UncommittedChangesStrategyKind

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'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
Copy Markdown
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
Copy Markdown
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?

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

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


readonly selectedUncommittedChangesStrategy: UncommittedChangesStrategy

readonly hasChangesAndStash: boolean

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.

non-blocking idea for a maybe more legible name:

Suggested change
readonly hasChangesAndStash: boolean
readonly couldOverwriteStash: boolean

Comment thread app/src/ui/tab-bar.tsx
Comment on lines +42 to +46
(type === TabBarType.Switch
? 'switch'
: type === TabBarType.Vertical
? 'vertical'
: 'tabs')

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.

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

Comment thread app/src/ui/toolbar/branch-dropdown.tsx Outdated

readonly selectedUncommittedChangesStrategy: UncommittedChangesStrategy

readonly hasChangesAndStash: boolean

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.

same thing as above regarding variable name

outofambit
outofambit previously approved these changes Jan 15, 2020
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.

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

7 participants