-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Create by default, but give dropdown for Preview on Github #257593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
|
@bpasero would appreciate a review on this one, since I had to make a small change or two to the contextmenuService. The issue was that without changing how we computed the anchor position, it would anchor itself well below the dropdown button when zoomed in, regardless of whether or not it was on screen. The change was to I've checked as many context menus throughout the product as I could find, but not sure if there could be an edge case I'm missing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justschen @Yoyokrazy one thing to note is that we have a context menu implementation for browser that implements a similar logic, and now with this change the two implementations differ. The one for browser is:
| const elementPosition = DOM.getDomNodePagePosition(anchor); |
It is also possible for a user on desktop to enable custom context menus (something @benibenj added recently).
Can we see for a simpler fix if possible specifically for the zooming issue (which seems to be the real issue here) and/or understand if it impacts browser as well or differently?
@bpasero I'll see if there's any implications with browser, however I do want to clarify that it's actually not an issue with zoom. It's just an issue with where the button is positioned in the DOM vs the viewport. Zooming into the issue reporter just makes the issue more apparent since it pushes the button off the form. To test this, I reverted all changes to the contextMenu service, and then changed the issue reporter window size from
and then when I simply expand the issue reporter window manually, we can see that it was "correctly" anchored, just on the initial DOM position.
I'm not an expert with the front end work involved in a lot of the DOM structure and the differences with this and the browser implementation but I'll see if it's effected. Could be that we can bring this logic over to it as well, unsure. The clipping logic seems like something we could/should use regardless of how we want to get the anchor position (via either Maybe the deeper issue is that the we don't recompute the anchor position as the window resizes. I know a lot of this code has been around for quite a while, so not sure how much relies on the nuance of the anchor hueristics we have right now. I did notice that I couldn't really find any buttons with dropdowns that could be scrolled off the screen, so I wonder if this could've just been us exposing an edge case that we've never really had any reason to see until now. |
…anchor math -- needs testing
browser layer fully tested via custom menu style
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
|
Tested all reporting action flows (preview + create) on native and custom context menus, windows + macOS as well. Changes to contextView and contextMenuService necessary now that we have a case where we can scroll a dropdown context menu off screen (calculations hadn't been built out to do viewport relative calculations and scroll offsets) |
* dropdown in issue reporter to preview * wip * cleanup * L/R padding for dropdown + preview by default * some comment cleaning * found the actual root fix. copilot wrote too much code. * some cleanup * preserve a comment * fix cutoff rendering in the browser layer due to inner div dropping height css * explanation * wip -- race condition loading stylings? * explanation of race condition, and gate the stylesheet behind the correct check * fix not being able to scroll, and fix the custom browser contextmenu anchor math -- needs testing * working -- needs cleanup + repo url appearing above button fix * wip * fix CSS for dropdown button * polish * cleanup --------- Co-authored-by: Michael Lively <milively@microsoft.com>


fix #257529
cc. @Yoyokrazy