Repository navigation
More consistent logic for showing/hiding the NBBD prompt - #9320
Conversation
…r the user chooses to dismiss the prompt
| export interface IDivergingBranchBannerState { | ||
| /** Show the diverging notification banner */ | ||
| readonly isPromptVisible: boolean | ||
|
|
||
| /** Has the user dismissed the notification banner? */ | ||
| readonly isPromptDismissed: boolean | ||
|
|
||
| /** Show the diverging notification nudge on the tab */ | ||
| readonly isNudgeVisible: boolean | ||
| } |
There was a problem hiding this comment.
I've decided two put these 3 flags under the same object rather than having 3 separate flags starting with divergingBranchBannerXXXX. This also makes it slightly easier to update the state from the app-store.
|
|
||
| public _setDivergingBranchBannerVisibility( | ||
| /** This shouldn't be called directly. See `Dispatcher`. */ | ||
| public _updateDivergingBranchBannerState( |
There was a problem hiding this comment.
This method now can update any of the 3 NBBD flags by passing an object with the flags to update. This reduces some repetition and makes sure that only 1 update is emitted when changing multiple flags at once.
The main tradeoff is that the method is a bit more "dynamic" in the sense that it accepts a Partial of an interface as an argument (still, everything is still correctly covered by TypeScript).
tierninho
left a comment
There was a problem hiding this comment.
Ran through some tests and overall it looks good.
I noticed that the blue nudge is still present even when the user dismisses the prompt and even when the user navigates away to the Changes tab. Only until the user returns to the History tab does it disappear. This is more of a nit-pick and I'll leave it to you to decide to change it.
Co-Authored-By: evelyn masso <[email protected]>
Infer branch for NDDB more consistently
|
I just changed the base branch of this PR to be |
|
@outofambit I checked with @ampinsk and the PR looks good to her! ✨ |
outofambit
left a comment
There was a problem hiding this comment.
one suggestion, otherwise this is great! excited to see it on beta!
Co-Authored-By: evelyn masso <[email protected]>

Partially addresses #5293
This branch is based on #9319
Description
This PR partially addresses #6875 by fixing the point 2. stated in #6875 (comment) .
In order to fix this, I've decided to add a third flag that controls whether the user has currently dismissed the banner (this way if the user dismisses the banner, it doesn't get shown again when the diverging logic gets executed afterwards).
In terms of behaviour, I've tried to follow what was stated in the original NBBD issue. This is a quick summary:
Something important to note is that this whole logic gets reset every time the user changes branches (or the app gets restarted). This means that if the user checks out a branch and goes back to the current branch, they'll see the blue nudge and the prompt again even if they have dismissed the prompt.
This is caused by the way the NBBD flags are stored, we could probably persist them in a different place to keep the state for longer.
cc/ @billygriffin, @nerdneha , @ampinsk
Screenshots
Before:
After:
Release notes
Notes: no-notes