fix: sync z-index for github tree and hover overlay#278
fix: sync z-index for github tree and hover overlay#278ijsnow merged 2 commits intosourcegraph:masterfrom
Conversation
ijsnow
left a comment
There was a problem hiding this comment.
Hello and thanks for looking into this! Just one question below.
src/shared/tree/tree.scss
Outdated
| top: 0; | ||
| left: 0; | ||
| z-index: 2000; | ||
| z-index: $default-z-index; |
There was a problem hiding this comment.
From what I can tell, making the z-index be the same for both the hover overlay and the tree mount only fixes the problem because the hover overlay's mount is appended to the end of document.body but the tree mount is added further up the DOM tree? It's important to note that it doesn't actually need to be. It could just be added to the bottom making this fix not really deterministic.
What about subtracting one for the default for this? Or just making them 2000 and 1999?
| z-index: $default-z-index; | |
| z-index: $default-z-index - 1; |
There was a problem hiding this comment.
This is a good point in that restructuring the order of how this stuff gets injected could negate these changes. Pushing up the change.
|
Great, thanks! |
|
🎉 This PR is included in version 1.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR changes:
Addresses an issue surfaced in https://github.com/sourcegraph/sourcegraph/issues/242 where a hover overlay gets covered up by the Github tree sidebar. This is a simple stack level bug.
Normally I would say to just update z-index for
.hover-overlaybut it would be really easy to reintroduce this bug with a simple edit to z-index on.tree-mount. I extracted out the value to a variables.scss file so that the z-index value be shared. I suspect that variables.scss is not a great place to put this and maybe there's an existing pattern to follow here when values need to be shared between scss files, but I couldn't find anything like that in this project.Testing plan:
I have tested on: