Skip to content

Add horizontal and two-axis scrolling with vlang/gui-style scroll modes - #62

Open
medvednikov wants to merge 13 commits into
masterfrom
feat/horizontal-scroll
Open

medvednikov wants to merge 13 commits into
masterfrom
feat/horizontal-scroll

Conversation

@medvednikov

@medvednikov medvednikov commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a scroll_mode to Scroll, modelled on vlang/gui's ScrollMode: vertical_only (still the default), horizontal_only, and both, through scroll_with_mode(...), Element.scroll_mode, and the VML scroll_mode property
  • implement sideways scrolling in the custom renderer, AppKit, UIKit, and Win32: a horizontal scroller, tilt-wheel/trackpad deltas, and Shift+wheel
  • add scroll_horizontal_offset(id) and scroll_to_horizontal_offset(id, offset), and make scroll_to_rect honour x and width
  • let nested Scroll elements pass a gesture along an axis they do not scroll to the enclosing one, so columns that scroll vertically inside a horizontal strip do not block it; AppKit needs a small NSScrollView subclass for this because its scroll views swallow those events
  • add examples/horizontal_scroll (a column browser) and a "Scrolling" section in the README

Behaviour changes

  • Shift+wheel now means sideways in the custom renderer and on Windows, so it no longer scrolls a vertical-only list
  • in the custom renderer, an enclosing pane's scrollbar can be grabbed where a nested scrolling pane sits beneath it
  • on AppKit, a nested Scroll that cannot follow a gesture passes it to the pane around it instead of consuming it, on either axis: when its content fits, or when it is already at the end the gesture heads for. A wheel click it has room for only part of passes the rest on; a trackpad gesture stays with the view it began on
  • on Windows, a nested Scroll passes whatever wheel distance it cannot use to the pane around it, on either axis
  • on Windows, wheel steps smaller than a notch, as precision wheels and touchpads send, add up across messages on either axis instead of each rounding to nothing
  • on AppKit, every Scroll sizes its document against what the scroll view shows rather than its frame, so a scroller that takes room of its own no longer leaves a range of its own width; a vertical list with persistent scrollbars can no longer be pushed that far sideways

Verification

  • v -d ui2_custom_rendering test ui/ui_scroll_immediate_test.v ui/ui_pointer_capture_immediate_test.v
  • v test ui/ui_test.v ui/vml_test.v examples/horizontal_scroll/
  • v run examples/build_examples.vsh and v run examples/build_examples.vsh -d ui2_custom_rendering (88 examples each)
  • make check-macos check-ios check-android check-linux check-windows
  • Windows: C generated with v -os windows -arch amd64 -o out.c examples/horizontal_scroll compiles with x86_64-w64-mingw32-gcc -std=gnu11 -fsyntax-only
  • v test . fails on the same 10 files as master
  • screenshots of the example scrolled to its last column in the custom renderer and in the native macOS build; wheel forwarding between nested scroll views and the offset functions were checked in a real AppKit window

Not covered: the Windows and UIKit backends were typechecked but not run. appkit/ui_macos_test.v does not compile on master, so the test added there has not run.

CI: the Windows jobs stop at the Test VML menu declarations step with errors in ui/chart.v and ui/menu_windows.c.v, the same ones master's scheduled run reports (#61 addresses the chart.v part), so they never reach the example build.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T22:41:01.915738Z 047bdce New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a756948154

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v Outdated
Comment thread windows/ui_windows.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e92c4148d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread windows/ui_windows.v
Comment thread appkit/ui_macos_darwin.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f832d5d6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread windows/ui_windows.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc7fae3f5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb74b8fc60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f7c9948d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread windows/ui_windows.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d13e8c2bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e7cfeadd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread windows/native_helpers_windows.h Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b94caee47d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b754b1a67d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread windows/ui_windows.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0f9e38052

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appkit/ui_macos_darwin.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4af7ad384d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread uikit/ui_ios.v
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