Skip to content

feat: add scroll shortcuts for top and bottom targets - #21

Merged
ziflex merged 1 commit into
mainfrom
feat/scroll-shortcuts
May 24, 2026
Merged

feat: add scroll shortcuts for top and bottom targets#21
ziflex merged 1 commit into
mainfrom
feat/scroll-shortcuts

Conversation

@ziflex

@ziflex ziflex commented May 23, 2026

Copy link
Copy Markdown
Member

This pull request adds support for named scroll targets ("top" and "bottom") to the scroll dispatch system in the web HTML module. This enhancement allows users to easily scroll elements or documents to the top or bottom using a simple payload, improving both the API's expressiveness and usability. The changes include updates to documentation, implementation, parsing logic, tests, and templates.

Scroll Dispatch Enhancements:

  • Added support for named scroll targets (to: "top" and to: "bottom") in the scroll dispatch payload, allowing direct scrolling to the top or bottom of elements or documents. [1] [2] [3] [4] [5]
  • Updated documentation and usage examples in README.md to describe the new scroll targets and clarify accepted payloads for scroll dispatch. [1] [2]

Testing Improvements:

  • Extended test coverage to ensure correct behavior for the new to: "top" and to: "bottom" scroll targets, including error handling for unsupported targets.
  • Updated functional tests in FQL scripts to verify scroll-to-top and scroll-to-bottom actions for both documents and containers.

Dependency Updates:

  • Added and updated several dependencies in go.work.sum to support new features and maintain compatibility. [1] [2] [3] [4]

Minor Fixes:

  • Minor struct field reordering for clarity in test code.

Copilot AI review requested due to automatic review settings May 23, 2026 23:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Web HTML module’s CDP dispatch-based scrolling to support named absolute scroll targets (to: "top" / to: "bottom"), making common “jump to start/end” actions possible without specifying coordinates.

Changes:

  • Added parsing and dispatch routing for named scroll targets (top, bottom) alongside existing coordinate-based to targets.
  • Updated the CDP element scroll JS template to handle "top" / "bottom" modes.
  • Expanded documentation and added/extended tests (unit + FQL functional) to cover the new targets and invalid target errors.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/modules/web/html/dynamic/element/dispatch/scroll.fql Adds functional coverage for to: "top" / to: "bottom" on documents and containers.
modules/web/html/README.md Documents the new named to scroll targets and updates examples.
modules/web/html/drivers/memory/element_removal_test.go Minor test struct field reordering (no behavioral change).
modules/web/html/drivers/cdp/templates/dispatch.go Adds "top" / "bottom" handling to element scroll dispatch template.
modules/web/html/drivers/cdp/dom/dispatch.go Routes document scroll dispatch to ScrollTop / ScrollBottom for the new modes.
modules/web/html/drivers/cdp/dom/dispatch_payload.go Adds new scroll modes and parsing logic for named targets vs coordinate targets.
modules/web/html/drivers/cdp/dom/dispatch_payload_test.go Adds unit tests for coordinate to, named targets, and unsupported target errors.
go.work.sum Updates workspace dependency checksums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ziflex
ziflex merged commit e930de7 into main May 24, 2026
33 checks passed
@ziflex
ziflex deleted the feat/scroll-shortcuts branch May 24, 2026 00:12
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.

2 participants