-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh: re-insert badges when side menu expands (#350)
About branch and pull request count badges. Once again I updated a feature on my fork, so here, I share it. - I noticed the counters were not accurate, now it fetches on mount, so we will see more often a valid badge counter when using the floating-contextual-collapsed-menu - If the menu was unmounted the badge never came back, now it uses `SelectorObserver` - I handled the other menu, contextual floating menu, the one that appears when the other menu is collapsed and you just hover the side menu line. - I noticed bitbucket does not have menu link icons when the menu is collapsed, so I added badges - I reduced the max number from `99999+` to `+99` since in my opinion having more than 99 it's a sign that you lost track of it, you must do some clean up to reduce the counter. Just like messaging app can easily go over 99 but they also show `+99` when you don't care enough to clean your messages. So normally users, should care about having branches over 50, and PR over 10/20. Here at work on the biggest project we never went over 20 branches and 20 PRs, normally they close in 2hrs to 6hrs. - I changed `?` to `!` for the only matter that `?` can't be centred in the badge, and i chose `!` cause it's quite common to see it when an error occurred, here the api did not responded, bad token - I made sure it works with the new pull request experience, UI V2 ![image](https://user-images.githubusercontent.com/23088305/80050885-d3db5c80-84e4-11ea-831a-998958cda9b5.png) ![g](https://user-images.githubusercontent.com/23088305/80053404-d771e200-84ea-11ea-8089-cde16b9dce00.gif) ![image](https://user-images.githubusercontent.com/23088305/80054389-17d25f80-84ed-11ea-98ba-37bc9d1eb54d.png) Close #185
- Loading branch information
Showing
4 changed files
with
224 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
.__rbb-badge { | ||
position: absolute; | ||
right: 4px; | ||
bottom: -1px; | ||
right: 5px; | ||
width: 1.5em; | ||
height: 1.5em; | ||
} | ||
|
||
.__rbb-badge-counter { | ||
font-weight: 650; | ||
font-size: 10px; | ||
border-radius: 50%; | ||
height: 100%; | ||
.__rbb-badge::before { | ||
content: ''; | ||
background: #a00; | ||
border-radius: 1em; | ||
position: absolute; | ||
width: 100%; | ||
box-sizing: border-box; | ||
align-content: center; | ||
align-items: center; | ||
padding: 2px; | ||
height: 100%; | ||
} | ||
|
||
.__rbb-badge-counter { | ||
color: #fff; | ||
font-weight: 600; | ||
font-size: 0.8em; | ||
position: absolute; | ||
text-align: center; | ||
line-height: 1.9em; | ||
right: 0; | ||
left: 0; | ||
} | ||
|
||
.__rbb-badge-counter.-max::before { | ||
content: '+'; | ||
font-weight: 200; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.