Skip to content

Add composable actions support to pendo-button#1

Open
tolson wants to merge 1 commit intomainfrom
tao-multiaction-button
Open

Add composable actions support to pendo-button#1
tolson wants to merge 1 commit intomainfrom
tao-multiaction-button

Conversation

@tolson
Copy link
Copy Markdown
Collaborator

@tolson tolson commented Mar 10, 2026

Add parseAction() method to support multiple action formats:

  • Array: [{"action":"submit-poll"},{"action":"dismiss"}]
  • Object: {"action":"go-to-step","stepId":"abc"}
  • String with param: go-to-step:abc123
  • Simple string: dismiss

handleClick() now emits {actions: [...]} array instead of single action, enabling composable multi-action buttons without combinatorial explosion of composite action cases.

Add parseAction() method to support multiple action formats:
- Array: [{"action":"submit-poll"},{"action":"dismiss"}]
- Object: {"action":"go-to-step","stepId":"abc"}
- String with param: go-to-step:abc123
- Simple string: dismiss

handleClick() now emits {actions: [...]} array instead of single action,
enabling composable multi-action buttons without combinatorial explosion
of composite action cases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* - "previous-step" - Go back to previous step
* - "dismiss" - Close the guide
* - "link:URL" - Open a URL
* - "launch-guide:GUIDE_ID" - Launch another guide
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if the actions are already objects, might as well split this up and have keys for the other parameters, e.g. { action: 'launch-guide', guideId: 'GUIDE_id' }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looking further down, seems it might already do that, and the comment is just a little out of date

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.

2 participants