Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Browser extension: No hover tooltips on GitHub PRs after switching tabs #3228

Closed
KattMingMing opened this issue Apr 4, 2019 · 5 comments
Closed
Assignees
Labels
browser-extension bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. github Issues that occur with GitHub as code host
Milestone

Comments

@KattMingMing
Copy link
Contributor

KattMingMing commented Apr 4, 2019

2019-04-08 17 58 45

@KattMingMing
Copy link
Contributor Author

After refreshing the background page of the browser extension and refreshing the GitHub PR page I was able to get tooltips to show. There was no hover tooltip or any other indications that code intel was working until I did this – I also added and removed the extension.

@felixfbecker
Copy link
Contributor

Interesting. Were there any errors in the console or background page console?

@felixfbecker felixfbecker added browser-extension needs-more-info Issues that need more information from the submitter. labels Apr 4, 2019
@chrismwendt
Copy link
Contributor

@chrismwendt chrismwendt added bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. and removed needs-more-info Issues that need more information from the submitter. labels Apr 9, 2019
@chrismwendt
Copy link
Contributor

I found a repro. I added repro steps to the description + a GIF showing the bug.

@lguychard lguychard added this to the 3.3 milestone Apr 9, 2019
@lguychard lguychard added the github Issues that occur with GitHub as code host label Apr 9, 2019
@felixfbecker
Copy link
Contributor

Thanks for the repro @chrismwendt! This only happens after switching tabs. The hover overlay mount, which is appended to the #js-repo-pjax-container, gets removed and not readded. I guess this is because GitHub swaps out the content of #js-repo-pjax-container, but will never remove/add #js-repo-pjax-container itself, so we don't add the mount again. I don't actually know why we don't just put the mount on document.body, I think this was a hacky attempt to make hover overlays disappear on page navigation, but I have since added proper handling for that. Using document.body fixes the issue.

felixfbecker added a commit that referenced this issue Apr 9, 2019
@felixfbecker felixfbecker changed the title Browser extension: No hover tooltips on GitHub PRs Browser extension: No hover tooltips on GitHub PRs after switching tabs Apr 9, 2019
lguychard referenced this issue Feb 10, 2020
Rel https://github.com/sourcegraph/sourcegraph/issues/3228#issuecomment-481174882

On GitLab merge request pages, the diff tab is always present. As a result, when switching tabs, the hover overlay remains visible, since it is by default mounted to `document.body`, and as such is not affected by the change in visibility of the diff tab.

This PR introduces the ability to customize the hover overlay mount location, through `CodeHost.getHoverOverlayMountLocation()`. If `CodeHost.getHoverOverlayMountLocation()` is unspecified, or if it returns `null`, the hover overlay will be mounted to document.body. If the custom mount location is removed from the DOM, the hover overlay will be mounted to document.body again.
lguychard referenced this issue Feb 10, 2020
Rel https://github.com/sourcegraph/sourcegraph/issues/3228#issuecomment-481174882

On GitLab merge request pages, the diff tab is always present. As a result, when switching tabs, the hover overlay remains visible, since it is by default mounted to `document.body`, and as such is not affected by the change in visibility of the diff tab.

This PR introduces the ability to customize the hover overlay mount location, through `CodeHost.getHoverOverlayMountLocation()`. If `CodeHost.getHoverOverlayMountLocation()` is unspecified, or if it returns `null`, the hover overlay will be mounted to document.body. If the custom mount location is removed from the DOM, the hover overlay will be mounted to document.body again.
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
browser-extension bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. github Issues that occur with GitHub as code host
Projects
None yet
Development

No branches or pull requests

4 participants