Skip to content

docs: Document screenshot padding viewport clamping behavior#150

Draft
promptless[bot] wants to merge 1 commit intomainfrom
promptless/screenshot-viewport-clamping
Draft

docs: Document screenshot padding viewport clamping behavior#150
promptless[bot] wants to merge 1 commit intomainfrom
promptless/screenshot-viewport-clamping

Conversation

@promptless
Copy link
Contributor

@promptless promptless bot commented Jan 25, 2026

Open this suggestion in Promptless to view citations and reasoning process

Updates the screenshot action documentation to clarify that padding is automatically clamped to viewport bounds. This ensures users understand that screenshots with padding extending beyond the viewport will still capture correctly, rather than failing.

Trigger Events

doc-detective/core PR #424: Enhance Appium integration and screenshot handling

Promptless Research (1 GitHub PR)

Agent Response

I've completed my review of PR #424 and created a documentation suggestion.

Summary

PR #424: Enhance Appium integration and screenshot handling

This PR contains several changes, most of which are internal infrastructure improvements:

  • Internal changes (no docs needed): Port availability checks, enhanced Appium error messages with platform-specific troubleshooting tips, cross-platform compatibility improvements (127.0.0.1/localhost fallback), and test cleanup helpers

  • User-facing change (documented): Screenshot coordinate clamping - when padding extends beyond viewport bounds, it's now automatically clamped instead of potentially causing issues

Documentation Update

I created a suggestion that adds a brief note to the screenshot action documentation clarifying that padding is automatically clamped to viewport bounds. This helps users understand that screenshots with elements near the edge of the viewport will still capture correctly even with generous padding values.

Changed file: docs/get-started/actions/screenshot.mdx

Change: Updated the padding property description from:

padding: (Optional) Add padding around the element before cropping. Can be a single number (all sides) or an object { top, right, bottom, left }.

To:

padding: (Optional) Add padding around the element before cropping. Can be a single number (all sides) or an object { top, right, bottom, left }. Padding that extends beyond the viewport is automatically clamped.


Help us improve Promptless — If this suggestion missed the mark, please share quick feedback.

If you want Promptless to make further changes on this PR, feel free to leave a comment tagging Promptless (It won't show up in the user drop down but Promptless will get it!)

- `elementAttribute`: (Optional) Object of attribute key-value pairs that the element must have.
- `elementAria`: (Optional) The computed accessible name of the element. Supports regex patterns.
- `padding`: (Optional) Add padding around the element before cropping. Can be a single number (all sides) or an object `{ top, right, bottom, left }`.
- `padding`: (Optional) Add padding around the element before cropping. Can be a single number (all sides) or an object `{ top, right, bottom, left }`. Padding that extends beyond the viewport is automatically clamped.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Citation: Based on changes in src/tests/saveScreenshot.js that add viewport bounds clamping for screenshot coordinates. The code clamps negative x/y values to 0, limits width/height to viewport dimensions, and ensures minimum 1px dimensions.
View source

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

0 participants