# Fix flicker in short context menus that have documentation aside \(\#38074\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2b3ca360c34e394c03663b2d106e8baf18d2db12)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 2b3ca360c34e394c03663b2d106e8baf18d2db12

Requested commit: 2b3ca360c34e394c03663b2d106e8baf18d2db12

Commit: 2b3ca360c34e394c03663b2d106e8baf18d2db12

Tree: 27e3519c6c6488ac424110230a4e567625bbce7f

Author: Danilo Leal

Committer: GitHub

## Message

```
Fix flicker in short context menus that have documentation aside (#38074)

Menu items in the context menu component have the ability to display a
documentation aside popover. However, because this docs aside popover
was setup as a sibling flex container to the actual menu popover, if the
menu had a short amount of items and the docs popover is bigger than the
menu, this flickering would happen, making it essentially unusable:


https://github.com/user-attachments/assets/74956254-fff6-4c5c-9f79-02998c64a105

So, this PR makes the docs aside popover in wide window sizes
absolutely-positioned relative to the menu container, which removes all
flickering. On top of that, I'm adding a `DocumentationEdge` enum that
allows to control the edge anchor of the docs aside, which is useful in
this particular mode selector example to make the layout work well.


https://github.com/user-attachments/assets/a3e811e1-86b4-4839-a219-c3b0734532b3

When the window is small, the docs aside continue to be a sibling flex
container, which causes a super subtle shift in the items within the
menu popover. This is something I want to pursue fixing, but didn't want
to delay this PR too much.

Release Notes:

- N/A
```

## Parents

- [85f7bb62770e7f6c80402c2528c520e2717a2b24](https://git.cafe/gitcafe/zed/commit/85f7bb62770e7f6c80402c2528c520e2717a2b24?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/2b3ca360c34e394c03663b2d106e8baf18d2db12?format=markdown)
