Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Oct 14, 2025

Addresses #18663

Summary by CodeRabbit

  • New Features
    • Added a Take Screenshot action to capture webpages by URL with options for format (PNG/JPG), JPG quality, full-page capture, viewport size, custom filename, and sync directory.
    • Returns the saved screenshot file path and a brief summary after execution.
    • Enhanced validation with clear errors for invalid quality/format combinations.
    • Expanded app configuration with user-friendly fields for URL, filename, format, quality, full-page, and viewport.
  • Chores
    • Bumped package version to 0.1.0.

@vercel
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Oct 15, 2025 3:52pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 15, 2025 3:52pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Adds a ScreenshotBase app client with prop definitions and HTTP methods, a Take Screenshot action that validates inputs, calls the app to capture an image, writes it to a temp file, returns filename and path, and bumps package version while adding @pipedream/platform dependency.

Changes

Cohort / File(s) Change Summary
New Take Screenshot action
components/screenshotbase/actions/take-screenshot/take-screenshot.mjs
Adds a default-exported action object with metadata and props (screenshotbase, url, format, filename, quality, fullPage, viewportWidth, viewportHeight, syncDir), validates quality only for jpg/jpeg, calls screenshotbase.takeScreenshot, writes response buffer to a temp file, exports summary, returns [filename, filepath], and wraps errors with contextual messages.
App HTTP client and props
components/screenshotbase/screenshotbase.app.mjs
Adds populated propDefinitions (url, filename, format, quality, fullPage, viewportWidth, viewportHeight), imports axios from @pipedream/platform, implements _baseUrl(), _makeRequest({ $ = this, path, ...opts }) sending API key header and base URL, and takeScreenshot(opts = {}) calling /take with responseType: "arraybuffer".
Package metadata
components/screenshotbase/package.json
Bumps package version 0.0.10.1.0 and adds dependency "@pipedream/platform": "^3.1.0".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as Trigger
  participant A as Take Screenshot Action
  participant APP as ScreenshotBase App
  participant API as ScreenshotBase API
  participant FS as Temp Filesystem

  U->>A: Invoke run()
  A->>A: Validate format/quality
  A->>APP: takeScreenshot(options)
  APP->>APP: _makeRequest({ path: "/take", responseType: "arraybuffer" })
  APP->>API: POST /v1/take with API key
  API-->>APP: ArrayBuffer (image data)
  APP-->>A: ArrayBuffer
  A->>FS: Write temp file from buffer
  A-->>U: [filename, filepath]

  rect rgba(220, 235, 255, 0.25)
  note over A,APP: New/changed: validation, HTTP request (arraybuffer), temp file write
  end

  alt Error
    API-->>APP: Error
    APP-->>A: Throw error
    A-->>U: Error with contextual message
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I clicked—snap!—pixels in flight, 🐇
A bunny watched the buffer light.
Temp path grew, the filename sang,
Bytes stitched snug where pixels hang.
Version hopped to 0.1.0—cheer bright!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only references an external issue link and does not follow the repository’s description template, which requires a “## WHY” section explaining the motivation behind the change. It lacks the required heading and context about why the new action is being introduced. As such, the description is incomplete and does not provide sufficient information for reviewers. Please update the pull request description to include the required “## WHY” section per the repository template, detailing the motivation for adding the new Screenshotbase action and the problem it aims to solve.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Screenshotbase - New Action” concisely indicates that the pull request adds a new action to the Screenshotbase component and directly reflects the primary enhancement of introducing a take-screenshot action. It is clear and concise, avoiding unnecessary detail while remaining fully related to the main changes. Reviewers scanning the history will understand that this PR focuses on adding a new action for Screenshotbase without confusion.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch screenshotbase-new-components

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca56be6 and b541244.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/screenshotbase/actions/take-screenshot/take-screenshot.mjs (1 hunks)
  • components/screenshotbase/package.json (2 hunks)
  • components/screenshotbase/screenshotbase.app.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (7)
components/screenshotbase/package.json (1)

3-3: LGTM!

The version bump to 0.1.0 is appropriate for the first functional release, and the @pipedream/platform dependency aligns with the axios import used in the app module.

Based on learnings: @pipedream/platform version 3.1.0 is the latest published release and is suitable for this integration.

Also applies to: 15-17

components/screenshotbase/actions/take-screenshot/take-screenshot.mjs (2)

1-15: LGTM!

The imports are appropriate and the action metadata is well-structured with clear naming and annotations.


67-69: LGTM!

The validation correctly enforces that quality is only applicable to jpg/jpeg formats with a clear error message.

components/screenshotbase/screenshotbase.app.mjs (4)

1-1: LGTM!

The axios import from @pipedream/platform is the correct approach for Pipedream components.

Based on learnings: @pipedream/platform provides the axios client used for HTTP requests in Pipedream components.


6-52: LGTM!

The propDefinitions are well-structured with clear labels, appropriate types, helpful descriptions, and correct optional flags. All properties align with the ScreenshotBase API requirements.


54-67: LGTM!

The HTTP client implementation follows Pipedream best practices with a clean separation of concerns: base URL, request construction, and authentication header injection.


68-74: LGTM!

The takeScreenshot method correctly specifies responseType: "arraybuffer" for receiving binary image data and cleanly forwards additional options.

GTFalcao
GTFalcao previously approved these changes Oct 14, 2025
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@GTFalcao GTFalcao moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Oct 14, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Changes Required in Component (Source and Action) Backlog Oct 15, 2025
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Screenshotbase-New-Action-28cbf548bb5e816f936dc57772e556f4

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
components/screenshotbase/actions/take-screenshot/take-screenshot.mjs (1)

60-64: syncDir prop is unused.

This prop is defined but never used. The screenshot is written to /tmp/ (line 86) instead of using this.syncDir.

Either remove the unused prop or update line 86 to use it:

-      const downloadedFilepath = `/tmp/${this.filename}`;
+      const downloadedFilepath = `${this.syncDir}/${this.filename}`;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c25a223 and 132f445.

📒 Files selected for processing (2)
  • components/screenshotbase/actions/take-screenshot/take-screenshot.mjs (1 hunks)
  • components/screenshotbase/screenshotbase.app.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (4)
components/screenshotbase/screenshotbase.app.mjs (1)

1-73: LGTM! Well-structured app integration.

The ScreenshotBase app implementation is solid:

  • Proper use of axios from @pipedream/platform
  • Well-defined prop definitions with appropriate types and descriptions
  • Clean API client structure with _baseUrl(), _makeRequest(), and takeScreenshot() methods
  • Correct responseType: "arraybuffer" for binary image data
components/screenshotbase/actions/take-screenshot/take-screenshot.mjs (3)

67-69: LGTM! Proper validation for quality parameter.

The validation correctly ensures that quality is only allowed when the format is jpg or jpeg, matching the API constraints.


72-84: LGTM! Correct parameter mapping to API.

The parameter mapping properly converts camelCase prop names to the API's expected snake_case format (full_page, viewport_width, viewport_height), and correctly handles the boolean-to-numeric conversion for full_page.


86-87: Good fix! Base64 conversion removed.

The response is now written directly to the file without the unnecessary base64 round-trip that was flagged in the previous review. This is the correct approach since takeScreenshot already returns an ArrayBuffer/Buffer.

@michelle0927 michelle0927 moved this from Changes Required to Ready for QA in Component (Source and Action) Backlog Oct 15, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Ready for Release in Component (Source and Action) Backlog Oct 16, 2025
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Screenshotbase-New-Action-28cbf548bb5e816f936dc57772e556f4

@michelle0927
Copy link
Collaborator Author

/approve

@GTFalcao GTFalcao merged commit 6d19333 into master Oct 16, 2025
10 checks passed
@GTFalcao GTFalcao deleted the screenshotbase-new-components branch October 16, 2025 16:19
@github-project-automation github-project-automation bot moved this from Ready for Release to Done in Component (Source and Action) Backlog Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants