-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
unreleased-commits
- Restore support for old repository overview
#6927
Conversation
@@ -121,7 +121,7 @@ async function init(signal: AbortSignal): Promise<false | void> { | |||
|
|||
await api.expectToken(); | |||
|
|||
observe(branchSelector, add, {signal}); | |||
observe(`table[aria-labelledby="folders-and-files"] ${branchSelector}`, add, {signal}); |
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.
table[aria-labelledby="folders-and-files"]
means New repository overview
's file tree table; But I don't know is there any nice way to describe this with comment.
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.
observe(`table[aria-labelledby="folders-and-files"] ${branchSelector}`, add, {signal}); | |
observe(`${branchSelector}:not(${branchSelectorParent} ${branchSelector})`, add, {signal}); |
- We can resolve this like this way too.
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.
Either way, it should be part of the selector we have saved
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 const branchSelector = '[data-hotkey="w"]';
export const branchSelectorParent = 'details#branch-select-menu';
Since these 2 apis are available currently, It looks hard to me to adding new general selector.
${branchSelector}:not(${branchSelectorParent} ${branchSelector})
->branchSelectorWithoutBranchSelectorParent
😶- It looks too long.. and something indescribable.
table[aria-labelledby="folders-and-files"] ${branchSelector}
->branchSelectorOnNew
👎- Avoid
new
naming
- Avoid
Or merge add()
and addLegacy()
, and check is parent branchSelectorParent
in function and append with that condition?
I don't know which is more refined way.
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.
Let's merge it into a single selector and observer. Then add the condition inside
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.
unreleased-commits
: Restore on not New Repository Overview
unreleased-commits
- Restore support for old repository overview
Description
unreleased-commits
causes Switch branches to be hidden in<details>
#6922unreleased-commits
causes Switch branches to be hidden in<details>
#6922 (comment)Test URLs
Screenshot
New repository overview
disabledNew repository overview
enabled