Skip to content
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

file operation context menu offset error #188903

Open
weartist opened this issue Jul 26, 2023 · 5 comments
Open

file operation context menu offset error #188903

weartist opened this issue Jul 26, 2023 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues system-context-menu Issue related to context menu drawn by the OS

Comments

@weartist
Copy link
Contributor

weartist commented Jul 26, 2023

Type: Bug

When the name of a folder is very long, right-clicking the pop-up menu will still locate the real length of the name, may be offset too far:
image

image

Normal situation:
image

If this is indeed a bug, I will try to fix it

VS Code version: Code 1.79.2 (Universal) (695af09, 2023-06-14T08:58:52.392Z)
OS version: Darwin arm64 22.4.0
Modes:
Remote OS version: Linux x64 3.10.0-1160.el7.x86_64
Remote OS version: Linux x64 3.10.0-1160.el7.x86_64

System Info
Item Value
CPUs Apple M1 Pro (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 4, 4, 4
Memory (System) 16.00GB (0.06GB free)
Process Argv --crash-reporter-id a0e70e19-77dc-4670-9ebc-f19a3a98c398
Screen Reader no
VM 0%
Item Value
Remote SSH: wutong_test
OS Linux x64 3.10.0-1160.el7.x86_64
CPUs Intel(R) Xeon(R) CPU E5-2696 v3 @ 2.30GHz (72 x 2299)
Memory (System) 62.75GB (8.08GB free)
VM 18%
Item Value
Remote SSH: wutong_test
OS Linux x64 3.10.0-1160.el7.x86_64
CPUs Intel(R) Xeon(R) CPU E5-2696 v3 @ 2.30GHz (72 x 2299)
Memory (System) 62.75GB (8.08GB free)
VM 18%
Extensions (20)
Extension Author (truncated) Version
vscode-edge-devtools ms- 2.1.2
jupyter-keymap ms- 1.1.2
remote-containers ms- 0.299.0
remote-ssh ms- 0.102.0
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.79.5
vscode-remote-extensionpack ms- 0.24.0
remote-explorer ms- 0.4.0
remote-server ms- 1.2.1
vscode-icons vsc 12.4.0
copilot Git 1.98.275
vscode-language-pack-zh-hans MS- 1.79.2023061409
python ms- 2023.12.0
vscode-pylance ms- 2023.7.30
jupyter ms- 2023.5.1101742258
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
autodocstring njp 0.6.1

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
hideindicator:30785051
pythongtdpath:30769146
i26e3531:30792625
pythonnosm12tcf:30779713
pythonidxpt:30784022
pythonnocebcf:30776496
e537b577:30795824
dsvsc013:30795093

@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.80.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@bpasero
Copy link
Member

bpasero commented Jul 26, 2023

I can reproduce and the part where this happens using mouse will be fixed with #188923. I jumped ahead to address it because I was recently in the area of improving context menu locations when mouse is used.

However, if you are using the keyboard and thus the anchor is a HTMLElement, you will still hit this and then maybe the explorer should be playing with the available options:

anchorAlignment?: AnchorAlignment;
anchorAxisAlignment?: AnchorAxisAlignment;

When opening the context menu here:

this.contextMenuService.showContextMenu({

Or alternatively, compute the position and cap it at the max width.

@lramos15 lramos15 added bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues system-context-menu Issue related to context menu drawn by the OS labels Jul 26, 2023
@weartist
Copy link
Contributor Author

weartist commented Aug 4, 2023

@bpasero I verified that the mouse behaved as expected, Thank you! But I still want to ask a simple question, can you tell me what is the name of the command that shows the menu through the keyboard?

@bpasero
Copy link
Member

bpasero commented Aug 4, 2023

I think Shift+F10 on Windows for example.

@weartist
Copy link
Contributor Author

weartist commented Aug 4, 2023

I think Shift+F10 on Windows for example.

That's it, and now it looks like menu at the maximum width displayed, it feels okay, do we need to try modifying to pop up in the center of the width of the display?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues system-context-menu Issue related to context menu drawn by the OS
Projects
None yet
Development

No branches or pull requests

4 participants