Skip to content

Let the mouse wheel scroll the chat over code blocks and tables - #422

Open
slorksmo wants to merge 6 commits into
futrx-com:qafrom
slorksmo:fix/code-block-wheel-scroll
Open

slorksmo wants to merge 6 commits into
futrx-com:qafrom
slorksmo:fix/code-block-wheel-scroll

Conversation

@slorksmo

Copy link
Copy Markdown
Contributor

What

Code blocks, tables, Mermaid blocks and tool output in the chat now use a new touch-scroll-x class that only contains overscroll on the x axis, so vertical wheel scrolling passes through to the chat.

Why

touch-scroll sets overscroll-behavior-y: contain. On elements that only scroll sideways this blocks scroll chaining, so the chat stops scrolling while the pointer is over them.

Fixes #416

How

  • New .touch-scroll-x in index.css: -webkit-overflow-scrolling: touch and overscroll-behavior-x: contain. Keeping the x axis contained still stops a sideways swipe on a long line from triggering back navigation.
  • Swapped touch-scroll for touch-scroll-x on the seven elements that are overflow-x-auto only: the markdown code block and table, both Mermaid containers, tool-calls/CodeBlock, EditCall and DiffView.
  • touch-scroll itself is unchanged, so the real vertical scrollers (the chat, drawers, HistoryDrawer) keep their behavior.

Testing

  • npm test: 647 passed

  • npm run build succeeds

  • Ran the change on my own instance: wheel scrolling over code blocks now scrolls the chat.

  • go test ./... passes (backend and catalog): no backend changes

  • npm test passes (frontend)

  • gofmt / go vet ./... clean: no Go changes

  • npm run build succeeds

UI changes

  • Tested in a real project workspace (not just npm run dev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Mouse wheel does not scroll the chat while the pointer is over a code block

1 participant