You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
more-dropdown compatibility with "Repository refresh" design #3215
I like the max-width solution, but it’s a little risky because other extensions add tabs too.
@kidonng yes, but that’s just 1 item out, 1 item in. I’m talking about 1 item out (the More dropdown) and 5 items in (once it overflows): could that work?
I underestimated the problem. Just navigated through GitHub's code:
So insert all the .js-responsive-underlinenav-item before the listener is added? Impossible. Hook window.addEventlistner? Dirty. Make another listener? Tedious and error-prone. Well, I don't really have more ideas.
These 2 links are connected by the data-tab-item attribute
when [data-tab-item="insights-tab"] is hidden from the nav, the other element in the dropdown with the same attribute is shown
items are removed from the nav regardless of whether they have a matching item in the dropdown (I think as long as they have the js-responsive-underlinenav-item class)
Given this, I think that this could be a solution:
Activity
aminya commentedon Jun 11, 2020
yakov116 commentedon Jun 11, 2020
@aminya thats #3081
fregante commentedon Jun 18, 2020
Is it possible to have the dropdown on the bar, but when it "overflows" its contents end up in the native dropdown?
E.g.
Becomes
kidonng commentedon Jun 19, 2020
Isn't this what we have in #3186?
notlmn commentedon Jun 19, 2020
We can start by adding a
max-widthto.js-repo-nav, but that still keeps the dropdown trigger to the right.There's some layout issues using
position: relativeon nav, and there's also figuring outmax-widthin the first place.Just some thoughts.
fregante commentedon Jun 19, 2020
I like the max-width solution, but it’s a little risky because other extensions add tabs too.
@kidonng yes, but that’s just 1 item out, 1 item in. I’m talking about 1 item out (the More dropdown) and 5 items in (once it overflows): could that work?
kidonng commentedon Jun 19, 2020
I underestimated the problem. Just navigated through GitHub's code:
So insert all the
.js-responsive-underlinenav-itembefore the listener is added? Impossible. Hookwindow.addEventlistner? Dirty. Make another listener? Tedious and error-prone. Well, I don't really have more ideas.fregante commentedon Jun 19, 2020
GitHub’s selectors are "live", so new elements are automatically picked up.
I looked into it just now and it looks somewhat possible:
data-tab-itemattribute[data-tab-item="insights-tab"]is hidden from the nav, the other element in the dropdown with the same attribute is shownjs-responsive-underlinenav-itemclass)Given this, I think that this could be a solution:
kyleknighted commentedon Jun 23, 2020