Skip to content

Conversation

@FloEdelmann
Copy link
Member

References #3081.

Screenshot_2020-06-08_22-32-22

@yakov116
Copy link
Member

yakov116 commented Jun 8, 2020

Your on 🔥

@fregante
Copy link
Member

@FloEdelmann if you want to take care of this issue, I think it's only a matter of adding if branchselector.is('.btn-sm'), mybutton.classList.add('btn-sm')

`data-hotkey` attributes are unique like IDs
Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Affected by this bug: #3001

Repro is different:

  1. Visit Bugs tab: https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
  2. Click the repository’s Pull requests tab
  3. Go back in the browser (history.back())

}

const issuesTab = (await elementReady('.pagehead [data-hotkey="g i"]'))?.parentElement;
const issuesTab = (await elementReady('[data-hotkey="g i"]'))?.parentElement;
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, they are not unique:

Screenshot_2020-06-10_13-43-27

@FloEdelmann
Copy link
Member Author

The init function is not called at all when clicking on the browser's back button. That means that the Issues tab is automatically re-selected when navigating back. How can we catch that case?

@fregante
Copy link
Member

fregante commented Jun 12, 2020

That can be done via repeatOnAjaxEvenOnBackButton: true, but that shouldn't be needed.

Refer to the previous fix: af843eb

In that case our code was fine, but it GitHub was adding the class due to data-selected-links attribute.

@FloEdelmann
Copy link
Member Author

The data-selected-links is actually still removed from the Bugs tab: 1da152b#diff-932095cc3c0dff00495b4c392d78f0afR60

I suspect we can't remove it from the Issues tab, right?

If the Issues tab still has it, however, GitHub will select it when going back to the Bugs tab (which is actually the Issues page).

@FloEdelmann
Copy link
Member Author

FloEdelmann commented Jun 12, 2020

I've now tested removing data-selected-links from the Issues tab and it indeed fixes the #3001 bug. It also looks like everything is still working as expected, only the Issues tab no longer is rendered via PJAX, but triggers a full page load.

@FloEdelmann FloEdelmann marked this pull request as ready for review June 12, 2020 15:08
@fregante fregante merged commit efc8791 into refined-github:master Jun 18, 2020
@FloEdelmann FloEdelmann deleted the restore-bugs-tab branch June 18, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants