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

svelte: Fix various z-index/layering issues#62726

Merged
fkling merged 1 commit into
mainfrom
fkling/62713-preserve-revision
May 16, 2024
Merged

svelte: Fix various z-index/layering issues#62726
fkling merged 1 commit into
mainfrom
fkling/62713-preserve-revision

Conversation

@fkling

@fkling fkling commented May 16, 2024

Copy link
Copy Markdown
Contributor

While looking into #62713 I stumbled upon two z-index issues:

2024-05-16_13-37
2024-05-16_13-36

I'm worried that layering already gets out of hand and is difficult to understand. So this commit removes a bunch of z-index settings to simplifying this.

Most importantly:

  • Instead of setting a z-index on the header to make the sidebar navigation work, we can "portal" the sidebar to the end of the document.
  • Likewise the repo search input is portalled to ensure that it renders above all other content.

Test plan

Opened popovers/tooltips/etc on various pages:

  • Main search input/suggestions
  • Global sidebar navigation
  • User menu
  • experimental popover
  • Code intel hovercards
  • Repo search input
  • Tooltips
  • Revision picker

While looking into #62713 I stumbled upon two z-index issues. This
commit removes a bunch of z-index settings to simplifying layering.

- Instead of setting a z-index on the header to make the sidebar
  navigation work, we can "portal" the sidebar to the end of the
  document.
- Likewise the repo search input is portalled to ensure that it renders
  above all other content.
@fkling fkling added the team/code-search Issues owned by the code search team label May 16, 2024
@fkling fkling requested a review from vovakulikov May 16, 2024 12:03
@fkling fkling self-assigned this May 16, 2024
@cla-bot cla-bot Bot added the cla-signed label May 16, 2024
Comment on lines -153 to -156
// Ensure that any content inside navigation portal block
// can't overlap any static content like sidebar navigation
// in the global header layout.
isolation: isolate;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If this is set, the search input in the header is not above the main page content.

Comment on lines -65 to -68
// This seems needed to prevent the file headers (which are position: sticky) from overlaying
// the search input. Alternatively we could portal the search input with melt, but then
// it would be more difficult to position it over the repo header.
z-index: 2;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't relevant anymore since the header is now merged into the global navbar.

@vovakulikov vovakulikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool, I had a though in my last PR about z-indexes, look much simpler and more relieble

@fkling fkling merged commit 78a9958 into main May 16, 2024
@fkling fkling deleted the fkling/62713-preserve-revision branch May 16, 2024 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/code-search Issues owned by the code search team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants