-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Preferences redesign #8813
Conversation
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! |
@ampinsk is it desired/expected to have that salmon background color for the merge tool section? It's from a |
@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. |
Poppin' in here to say that the plan backfired and I ended up embracing pink brutalism 😍 |
There was a problem hiding this 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?
- 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
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: In this screenshot:
In this screenshot:
Let me know if you want to pair on any of this! ✨ |
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>
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
Otherwise I think this is ready for a full code review! /cc @outofambit |
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! |
Co-Authored-By: Amanda Pinsker <apinsker4@gmail.com>
There was a problem hiding this 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.
app/src/lib/stores/app-store.ts
Outdated
@@ -1769,6 +1777,12 @@ export class AppStore extends TypedBaseStore<IAppState> { | |||
askForConfirmationOnForcePushDefault | |||
) | |||
|
|||
const strategy = localStorage.getItem( | |||
uncommittedChangesStrategyKindKey | |||
) as UncommittedChangesStrategyKind |
There was a problem hiding this comment.
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.
if (hasChanges) { | ||
if (uncommittedChangesStrategy.kind === askToStash.kind) { | ||
this._showPopup({ | ||
type: PopupType.StashAndSwitchBranch, | ||
branchToCheckout: foundBranch, | ||
repository, | ||
}) | ||
return repository | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😋
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}` | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this 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 |
There was a problem hiding this comment.
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:
readonly hasChangesAndStash: boolean | |
readonly couldOverwriteStash: boolean |
(type === TabBarType.Switch | ||
? 'switch' | ||
: type === TabBarType.Vertical | ||
? 'vertical' | ||
: 'tabs') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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>
Closes #8774
Closes #7746
Description
From @ampinsk
This PR implements the new preference, as well as the redesign of the preferences pane.
Screenshots
Before: Tab design
![GitHub_Desktop](https://user-images.githubusercontent.com/7910250/71534361-32842700-28b3-11ea-88af-b91194ca5dde.png)
After: Sidebar design
Release notes
Notes: Redesign preferences pane and add preference for stashing changes when switching branches.