Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Oct 24, 2025

WHY

Resolves #18841

Summary by CodeRabbit

  • New Features

    • Updated Figma component to version 0.1.1 with platform dependency enhancements.
  • Bug Fixes

    • Fixed field dependency mappings for improved stability in Figma project and file selection workflows.
    • Updated action versions across delete-comment, list-comments, and post-a-comment operations.

@jcortes jcortes self-assigned this Oct 24, 2025
@vercel
Copy link

vercel bot commented Oct 24, 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 24, 2025 9:30pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 24, 2025 9:30pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Walkthrough

Updates Figma component to comply with OAuth scope restrictions by removing async option methods for fetching projects and files. Removes dependency mappings from property definitions and updates versions across multiple action and source files. Updates platform dependency to version 3.1.0.

Changes

Cohort / File(s) Summary
Action version and prop mapping cleanup
components/figma/actions/delete-comment/delete-comment.mjs, components/figma/actions/list-comments/list-comments.mjs, components/figma/actions/post-a-comment/post-a-comment.mjs
Version bumped from 0.0.4 to 0.0.5 across all three files. Removed dependency mappings: ({ teamId }) => ({ teamId }) from projectId propDefinition and ({ projectId }) => ({ projectId }) from fileId propDefinition.
App method removals
components/figma/figma.app.mjs
Removed public methods listTeamProjects(teamId, ctx) and listProjectFiles(projectId, ctx) along with their corresponding async option blocks for populating UI select options.
Package and source updates
components/figma/package.json
Version bumped from 0.1.0 to 0.1.1. Updated @pipedream/platform dependency from ^1.6.1 to ^3.1.0.
Source version update
components/figma/sources/new-comment/new-comment.mjs
Version bumped from 0.0.3 to 0.0.4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • @pipedream/platform major version upgrade (1.x → 3.x): Requires verification of compatibility and potential breaking changes in the platform API used by the Figma component.
  • Removal of public methods: Verify that listTeamProjects and listProjectFiles are not referenced in other components or actions outside this changeset.
  • Consistency check: Confirm that prop mappings removed from actions align with the intent to eliminate async options and that descriptions are added for manual Project ID entry as mentioned in the feature request.

Poem

🐇 OAuth's call came clear and strong,
Remove the scope where we don't belong,
Projects and files, no more to fetch,
Our props now lean, our code's a sketch!
Versions climb, dependencies too,
Figma flows fresh—compliant and true. 🎨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR successfully addresses the primary objective of removing async options logic from the Project prop by eliminating the listTeamProjects and listProjectFiles methods from figma.app.mjs and removing dependency mappings from delete-comment.mjs, list-comments.mjs, and post-a-comment.mjs [#18841]. However, the issue requires adding description text to advise users to obtain the Project ID from the Figma URL, and no evidence of this requirement being implemented is present in the provided code changes summary. This represents an incomplete implementation of the stated requirements. The PR needs to include description text for the projectId prop in the affected action files to guide users to obtain the Project ID from the Figma URL, as specified in issue #18841. This description should be added to all action files where async options were removed to ensure users have the necessary guidance for providing the required project information.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Out of Scope Changes Check ❓ Inconclusive Most changes align with the stated objectives of removing async options and version bumping. However, the @pipedream/platform dependency in package.json was upgraded from ^1.6.1 to ^3.1.0, which is a significant major version bump. This dependency upgrade is not mentioned in issue #18841 and represents a substantial change that could introduce breaking changes or additional scope beyond the stated requirement to remove async options and add user guidance text. Please clarify the reason for the @pipedream/platform dependency upgrade from ^1.6.1 to ^3.1.0. Verify whether this upgrade is necessary for the async options removal to function correctly, or if it was introduced as an unrelated change. If necessary, update the issue description or PR description to document why this dependency bump was required.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "[FEATURE] Figma - Remove Async Options on Project prop" clearly and specifically describes the main change in the changeset. The changes across multiple files demonstrate the removal of async option methods and dependency mappings from the Figma component, which directly aligns with the title. The title is concise, specific, and accurately represents the primary purpose of the PR without vague terminology or unnecessary noise.
✨ 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 figma-remove-async-options-project-prop

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/figma/actions/delete-comment/delete-comment.mjs (1)

30-38: Make commentId required and fix description for delete action.

This inherits optional: true and a “reply” description from the shared prop, which doesn’t fit deletion and can cause invalid calls with undefined.

-    commentId: {
-      propDefinition: [
-        figmaApp,
-        "commentId",
-        ({ fileId }) => ({
-          fileId,
-        }),
-      ],
-    },
+    commentId: {
+      propDefinition: [
+        figmaApp,
+        "commentId",
+        ({ fileId }) => ({ fileId }),
+      ],
+      optional: false,
+      description: "The ID of the comment to delete.",
+    },
components/figma/actions/list-comments/list-comments.mjs (1)

18-23: Remove the unused projectId prop from this action.

The description text is correctly defined in figmaApp with proper instructions for extracting the Project ID from the Figma URL. However, the projectId prop is declared in this action but never used—the run method only destructures and uses fileId to call listFileComments. This unused prop should be removed from lines 18-23.

🧹 Nitpick comments (5)
components/figma/sources/new-comment/new-comment.mjs (1)

37-42: Harden error handling for non-Axios errors.

Accessing error.response.status can throw if response is undefined. Use optional chaining.

-        if (error.response.status === 400) {
+        if (error?.response?.status === 400) {
           throw new ConfigurationError("A Figma Organization Plan or higher is required to use webhooks. See Figma's [pricing page](https://www.figma.com/pricing) for more details.");
         }
components/figma/actions/delete-comment/delete-comment.mjs (1)

17-23: Remove unused projectId prop here.

projectId isn’t referenced in run() and no longer drives fileId options. Remove to streamline the UI.

     props: {
       ...common.props,
-    projectId: {
-      propDefinition: [
-        figmaApp,
-        "projectId",
-      ],
-    },
     fileId: {
components/figma/figma.app.mjs (1)

27-39: Guard options when fileId is unset and prefer slice over substr.

Prevents accidental /comments calls with undefined and uses non-deprecated string API.

-      async options({ fileId }) {
-        const files = await this.listFileComments(fileId);
-        return files.map((item) => {
-          const message = item.message.length > 50
-            ? `${item.message.substr(0, 50)}...`
-            : item.message;
+      async options({ fileId }) {
+        if (!fileId) return [];
+        const comments = await this.listFileComments(fileId);
+        return comments.map((item) => {
+          const message = item.message.length > 50
+            ? `${item.message.slice(0, 50)}...`
+            : item.message;
components/figma/actions/post-a-comment/post-a-comment.mjs (2)

18-23: Remove unused projectId prop.

Not referenced in run(). Removing reduces user friction post-async options removal.

     props: {
       ...common.props,
-    projectId: {
-      propDefinition: [
-        figmaApp,
-        "projectId",
-      ],
-    },
     fileId: {

52-55: Build payload conditionally to avoid sending comment_id: undefined.

Cleaner request body; avoids accidental API complaints.

-    const data = {
-      message,
-      comment_id: commentId,
-    };
+    const data = commentId
+      ? { message, comment_id: commentId }
+      : { message };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c5f4f2 and 6a31b48.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • components/figma/actions/delete-comment/delete-comment.mjs (1 hunks)
  • components/figma/actions/list-comments/list-comments.mjs (1 hunks)
  • components/figma/actions/post-a-comment/post-a-comment.mjs (1 hunks)
  • components/figma/figma.app.mjs (1 hunks)
  • components/figma/package.json (2 hunks)
  • components/figma/sources/new-comment/new-comment.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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (7)
components/figma/sources/new-comment/new-comment.mjs (1)

10-10: Version bump LGTM. Aligns with the package update and no behavior change here.

components/figma/figma.app.mjs (2)

15-16: Descriptions updated — meets the PR requirement.

Clear URL-based instructions for Project ID and File ID. Nice.

Also applies to: 20-21


3-3: Verification confirms no remaining references to removed methods.

The search found zero matches for listTeamProjects and listProjectFiles across the repository, confirming the removed async options are fully cleaned up with no dangling references.

components/figma/package.json (1)

3-3: Confirm platform v3 compatibility across this package.

Verified: Figma component correctly uses axios and ConfigurationError from @pipedream/platform v3.1.0. All imports are standard v3 APIs with no deprecated v1.x dependencies detected. Version constraint ^3.1.0 is appropriate.

components/figma/actions/list-comments/list-comments.mjs (3)

9-9: LGTM!

Version bump is appropriate for the prop mapping changes.


31-42: LGTM!

The run method correctly fetches and returns file comments with appropriate summary exports.


24-29: Description text is present and appropriate in the fileId propDefinition.

Verification confirms that the fileId propDefinition in components/figma/figma.app.mjs includes the required description text guiding users on how to obtain the File ID from Figma URLs. The implementation is consistent with projectId: both provide clear navigation steps, specify where to find the ID in the URL, and include concrete examples.

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.

[FEATURE] Figma - Remove Async Options on Project prop

1 participant