Skip to content

Keep document scrolling over embedded diagrams and code peeks - #594

Open
ketan0 wants to merge 1 commit into
mainfrom
codex/document-embed-scroll
Open

ketan0 wants to merge 1 commit into
mainfrom
codex/document-embed-scroll

Conversation

@ketan0

@ketan0 ketan0 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Scrolling a review document with the wheel or trackpad now keeps scrolling the document when the pointer passes over an embedded diagram or code peek. Before, React Flow, Monaco or the diagram's own overflow took the gesture.

Changes

  • packages/review/app/src/document-embed-scroll.ts: a capture-phase wheel listener on the review region.

    • It handles wheel events over sequence diagrams, flow diagrams, database lenses and code peeks inside the document, and scrolls the document instead.
    • Trackpad deltas are passed through, and line/page deltas from a mouse are converted to pixels.
    • Ctrl+wheel (zoom) is left alone.
    • Embedded content still scrolls with its own scrollbars.
  • styles.css: sequence diagrams and database lenses get explicit, draggable scrollbars. They show only on an axis that overflows and stay visible on macOS.

  • Code peek and diff scrollbars start below the file header (Code OSS fork):

    • a new verticalScrollbarTopInset scrollable-element option (scrollableElementOptions.ts, scrollableElement.ts, scrollbarState.ts, verticalScrollbar.ts);
    • a scrollbarBelowResourceHeader flag in the multi-diff editor factory;
    • the multi-diff widget passes MULTI_DIFF_RESOURCE_HEADER_HEIGHT.

    Before this, the vertical scrollbar ran over the sticky orders.ts-style header.

Testing

document-embed-scroll.browser.test.ts covers:

  • routing the wheel to the document over each embed type (sequence diagram, flow diagram, database lens, code peek);
  • converting line and page wheel deltas;
  • leaving fullscreen tours and pinch-to-zoom alone;
  • continuing to scroll the document when an embed fits;
  • removing the handler on cleanup.

The scrollbar inset is a layout change with no automated test.

🤖 Generated with Claude Code

@ketan0
ketan0 added this pull request to stack #568 September 25, 2026 07:19
@ketan0 ketan0 changed the title codex/document embed scroll Keep document scrolling over embedded diagrams and code peeks Sep 25, 2026
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch 2 times, most recently from dcd3c03 to 91f392d Compare September 25, 2026 08:31
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 91f392d to 07e3038 Compare September 25, 2026 08:40
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 07e3038 to 61f0672 Compare September 25, 2026 09:40
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch 2 times, most recently from 5423b84 to 41e15ac Compare September 25, 2026 10:08
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 41e15ac to 393edc6 Compare September 25, 2026 11:09
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 393edc6 to 35561f8 Compare September 25, 2026 12:04
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 35561f8 to 6e6772b Compare September 25, 2026 12:32
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch 2 times, most recently from 16f5b4d to 8bc845e Compare September 25, 2026 21:09
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from 8bc845e to dde9bb9 Compare September 25, 2026 21:11
Base automatically changed from codex/windows-packages to main September 25, 2026 22:07
Agent-Session: 01a0d12e-51ca-7230-9991-0ce7a73018b2
@ketan0
ketan0 force-pushed the codex/document-embed-scroll branch from dde9bb9 to 7cc86f7 Compare September 25, 2026 22:07

This branch was successfully deployed

No deployments
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.

1 participant