[Bug] Middle-click autoscroll in sidebar scrolls the main document instead
What happened?
Description
Middle-click autoscroll does not target the sidebar's own scrollable area.
In the Annotations panel and Ask AI chat, normal mouse-wheel scrolling works correctly. But when middle-click autoscroll is started inside the sidebar, moving the pointer up or down scrolls the main document view instead.
So the expectation would be: Middle-click autoscroll should target the scrollable container in which it was initiated:
- middle-click in the main document → scroll the document;
- middle-click in the sidebar → scroll the sidebar.
Steps to reproduce
- Open a Plan Review / Annotate session with a scrollable main document.
- Open the Annotations panel or Ask AI sidebar and make sure it is also vertically scrollable.
- Hover the sidebar and scroll with the mouse wheel - the sidebar scrolls correctly.
- Middle-click inside the sidebar to activate autoscroll.
- Move the pointer vertically.
Additional context
#1647 / #1648 addressed a related but separate scroll-target issue for keyboard scrolling; this report concerns middle-click autoscroll only.
Thanks for reading and considering this (again)!
Plannotator version
plannotator 0.27.19
OS
Windows
Agent
Claude Code
Where did it happen?
Plan review
I tried reproducing this on Linux Chromium with both v0.27.19 and v0.28.30, and on macOS Brave with v0.28.30.
With a long document and overflowing Annotations and Ask AI panels, middle-button autoscroll targeted the correct pane. Starting it inside either sidebar scrolled only that sidebar; starting it in the main document scrolled only the document. This also worked after clicking the document first. I enabled Chromium’s MiddleClickAutoscroll feature for these checks.
I don’t have access to Windows, so I haven’t been able to test your exact environment.
Could you update to the latest release and try once more?
Hey, thanks for your feedback @utpalsinghdev
I also don't have access to Mac unfortunately, but for Windows and using plannotator v0.28.50, I can attest that I still get the same unchanged behavior as described in the OP. The browser I'm using is Brave. If I can help with any more information, please let me know. Thanks!
Thanks for checking again on 0.28.50. The Annotations and Ask AI panels each have their own scroll area beside the document, and nothing in Plannotator handles the middle button outside links, so Chromium on Windows seems to pick the document itself. What are your Windows display scale and the browser zoom on that tab? Does it happen in Chrome or Edge too? One quick test: in DevTools, give the panel list (the element under the panel header with overflow-y: auto) the style will-change: transform, then try middle-click again. If that fixes it, we have the cause and a small fix.
Thanks for the suggestions! The browser zoom turned out to be a useful clue. I hadn't thought of testing different zoom levels before, and thanks to your suggestion, I discovered that middle-click autoscroll actually works as intended at 100% zoom. My display scale is at 100% btw.
After some further testing, I also need to correct my previous description. It turns out that the behavior depends not only on the browser zoom, but also on where I middle-click within the sidebar and how wide the viewport is:
- 100% zoom: Middle-click autoscroll works correctly throughout the sidebar.
- 110% zoom: It still works correctly in an area towards the right edge of the sidebar, while clicking further left scrolls the main document instead. I haven't been able to determine the exact boundary.
- 125% zoom: At my usual window width, I can't find any area within the sidebar where autoscroll works correctly.
- Reducing the viewport width (either by narrowing the browser window or expanding DevTools) increases the area where autoscroll works correctly, even at 125% zoom.
I also tested adding will-change: transform to the scrollable Annotations panel, but it didn't change the behavior at any zoom level, unfortunately. Also I wasn't able to test it out on Chrome/Edge yet, but will let you know once I get to it. Thanks!