Skip to content

Commit

Permalink
fix: update github branch switcher selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
EnixCoda committed Sep 23, 2024
1 parent d7d4c4a commit e62324b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/platforms/GitHub/DOMHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ const selectors = {
normal: {
reactApp: `react-app[app-name="react-code-view"] [data-target="react-app.reactRoot"]`,
codeTab: '#code-tab',
branchSwitcher: [`summary[title="Switch branches or tags"]`, `#branch-select-menu`].join(),
branchSwitcher: [
`summary[title="Switch branches or tags"]`,
`#branch-select-menu`,
`#branch-picker-repos-header-ref-selector`,
`#branch-picker-repos-header-ref-selector-wide`,
].join(),
fileNavigation: `.file-navigation`,
breadcrumbs: `[data-testid="breadcrumbs"]`,
breadcrumbsFilename: `[data-testid="breadcrumbs-filename"]`,
Expand Down
6 changes: 3 additions & 3 deletions src/platforms/GitHub/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ export const GitHub: Platform = {
},
shouldExpandSideBar() {
return Boolean(
(DOMHelper.isInCodePage() && !DOMHelper.isNativePRFileTreeShown()) ||
URLHelper.isInCommitPage() ||
(URLHelper.isInPullPage() && !DOMHelper.isNativePRFileTreeShown()),
(DOMHelper.isInCodePage() || URLHelper.isInCommitPage() || URLHelper.isInPullPage()) &&
!DOMHelper.isNativeFileTreeShown() &&
!DOMHelper.isNativePRFileTreeShown(),
)
},
shouldExpandAll() {
Expand Down

0 comments on commit e62324b

Please sign in to comment.