Skip to content
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

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

134130
Copy link
Contributor

@134130 134130 commented Sep 18, 2023

@@ -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});
Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member

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

Copy link
Contributor Author

@134130 134130 Sep 18, 2023

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

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.

Copy link
Member

@fregante fregante Sep 18, 2023

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never same mistake; Both are checked.

  • Disable New repository overview
    image

  • Enable New repository overview
    image

@fregante fregante added the bug label Sep 19, 2023
@fregante fregante changed the title unreleased-commits: Restore on not New Repository Overview unreleased-commits - Restore support for old repository overview Sep 19, 2023
@fregante fregante merged commit a87cd03 into refined-github:main Sep 19, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

New unreleased-commits causes Switch branches to be hidden in <details>
2 participants