feat: add scroll shortcuts for top and bottom targets - #21
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-basedtotargets. - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
to: "top"andto: "bottom") in the scroll dispatch payload, allowing direct scrolling to the top or bottom of elements or documents. [1] [2] [3] [4] [5]README.mdto describe the new scroll targets and clarify accepted payloads for scroll dispatch. [1] [2]Testing Improvements:
to: "top"andto: "bottom"scroll targets, including error handling for unsupported targets.Dependency Updates:
go.work.sumto support new features and maintain compatibility. [1] [2] [3] [4]Minor Fixes: