Skip to content

Conversation

@dharapandya85
Copy link

Pull Request Template

Use this template to quickly create a well written pull request. Delete all quotes before creating the pull request.

Description

This PR introduces a new trigger for the Figma component, it activates when comment is added to a Figma file.
Output as follows-

file_key: string
file_name: string
comment: array of strings
comment_id: integer
parent_id: integer
created_at: datetime
resolved_at: datetime
triggered_by: string
timestamp: datetime

Please include a summary of the changes and which issue has been fixed. Please also include relevant motivation
and context. List any dependencies that are required for this change.

Fixes #3200 (issue)

if no issue exists, please create an issue and ask the maintainers about this first

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce.
Please also list any relevant details for your test configuration.

  • Test A
../gradlew clean compileJava
../gradlew -p apps/server-app bootRun
  • Test B
./gradlew spotlessApply
./gradlew check

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@ivicac ivicac requested a review from monikakuster October 21, 2025 06:07
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes are unnecessary. Revert them.

tool(FigmaPostCommentAction.ACTION_DEFINITION)))
.triggers(getTriggers());
.triggers(FigmaNewCommentTrigger.TRIGGER_DEFINITION);

Copy link
Collaborator

Choose a reason for hiding this comment

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

As you can see in the Figma module, we have an openapi.yaml file. This indicates that the component is created using our OpenAPI generator tool.

Since Figma is a generated component, any manual changes will be overwritten the next time the generator is run.

To add trigger in component definition, overrride getTriggers() method in FigmaComponentHandler class.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although this trigger is currently implemented using polling, the Figma REST API documentation indicates that file comment events can be delivered via webhooks.

Therefore, this trigger could be more efficiently and reliably implemented as a dynamic webhook trigger, which would allow real-time detection of new comments without periodic polling.

To improve this implementation, consider switching from TriggerType.POLLING to TriggerType.DYNAMIC_WEBHOOK, and implement the necessary webhook registration, deregistration, and event handling logic according to Figma's webhook API.

mavenCentral()
}
}
plugins {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes are unnecessary. Revert them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes are unnecessary. Revert them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figma - New comment Trigger

2 participants