Skip to content

Plumb componentId through buttons on workflow interactions#3380

Merged
vegaro merged 3 commits into
mainfrom
cesar/wfl-46-button-workflow-trigger
Apr 24, 2026
Merged

Plumb componentId through buttons on workflow interactions#3380
vegaro merged 3 commits into
mainfrom
cesar/wfl-46-button-workflow-trigger

Conversation

@vegaro

@vegaro vegaro commented Apr 23, 2026

Copy link
Copy Markdown
Member

Note

Stacked on top of #3377 (ButtonComponent.id). Base will update to main once that PR merges.

Summary

  • Plumbs componentId through ButtonComponentStyle, populated from ButtonComponent.id in StyleFactory.
  • Tracks a "workflow_trigger" value as the component interaction event.
  • InternalPaywall's action handler currently just logs. The actual dispatch to PaywallViewModel.handleWorkflowAction lands in the multipage-workflow wiring PR that depends on this one

Note

Medium Risk
Touches paywall button action mapping and analytics tracking paths; misconfigured buttons (missing componentId) now fall back to NavigateBack, so behavior changes should be validated on real paywalls.

Overview
Adds explicit workflow trigger support for V2 paywall buttons by renaming the serialized ButtonComponent.Action.Workflow to WorkflowTrigger while keeping the backend JSON "type": "workflow" mapping.

Plumbs the button id into ButtonComponentStyle.componentId via StyleFactory, emits a new PaywallAction.External.WorkflowTrigger(componentId), and tracks a component_value of "workflow_trigger" for component-interaction analytics. InternalPaywall now recognizes this action (currently logs only), and tests are updated accordingly.

Reviewed by Cursor Bugbot for commit 186f654. Bugbot is set up for automated code reviews on this repo. Configure here.

Base automatically changed from cesar/wfl-46-button-component-id to main April 23, 2026 11:02
@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.32%. Comparing base (e4bf4e0) to head (186f654).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...t/purchases/paywalls/components/ButtonComponent.kt 20.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3380   +/-   ##
=======================================
  Coverage   79.32%   79.32%           
=======================================
  Files         361      361           
  Lines       14448    14448           
  Branches     1964     1964           
=======================================
  Hits        11461    11461           
  Misses       2194     2194           
  Partials      793      793           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vegaro vegaro force-pushed the cesar/wfl-46-button-workflow-trigger branch 5 times, most recently from 0c34228 to 8ac3fa4 Compare April 23, 2026 17:51
@vegaro vegaro changed the base branch from main to cesar/add-workflow-action April 23, 2026 17:53
@vegaro vegaro changed the title Add TriggerWorkflowAction and plumb componentId through buttons Plumb componentId through buttons on workflow interactions Apr 23, 2026
@vegaro vegaro force-pushed the cesar/wfl-46-button-workflow-trigger branch 2 times, most recently from a1073d3 to 47f4bb5 Compare April 23, 2026 18:04
@vegaro vegaro marked this pull request as ready for review April 23, 2026 18:05
@vegaro vegaro requested a review from a team as a code owner April 23, 2026 18:05
@vegaro vegaro requested a review from facumenzella April 23, 2026 18:05

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm lacking some context so just left some questions. Code looks good in general though, but thinking about leaving to others to approve.

@vegaro vegaro force-pushed the cesar/wfl-46-button-workflow-trigger branch from 47f4bb5 to 08a6ac2 Compare April 24, 2026 07:50
Base automatically changed from cesar/add-workflow-action to main April 24, 2026 08:27
@vegaro vegaro requested a review from a team as a code owner April 24, 2026 08:27
# Conflicts:
#	ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/button/ButtonComponentState.kt

# Conflicts:
#	ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/button/ButtonComponentState.kt
@vegaro vegaro force-pushed the cesar/wfl-46-button-workflow-trigger branch from 08a6ac2 to ee0e6bf Compare April 24, 2026 10:06

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ee0e6bf. Configure here.


@Serializable
public object Workflow : Action
public object WorkflowTrigger : Action

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

like it

Comment on lines +44 to +49
internal fun PaywallAction.workflowInteraction(): ButtonComponentInteraction? =
if (this is PaywallAction.External.WorkflowTrigger) {
ButtonComponentInteraction(value = "workflow_trigger")
} else {
null
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's move it to a PaywallActionExtensions.kt alongside navigationUrlForComponentInteraction(), or pull it inline into ButtonComponentView where it's used.

@facumenzella facumenzella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The PR description had a mismatch with the implementation: the Summary bullet said the interaction event was "trigger_workflow_action", but the code emits "workflow_trigger" (matching the Cursor-generated section below the fold). Updated the description to say "workflow_trigger" so it stays in sync with the code.

@facumenzella facumenzella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me

// Should not reach here: Action.WorkflowTrigger is handled before calling toPaywallAction.
// Reached only if componentId is null (misconfigured button).
is ButtonComponentStyle.Action.WorkflowTrigger -> {
Logger.e("ButtonComponentState: reached toPaywallAction for Workflow action — componentId may be null")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do you think about adding something like
if (BuildConfig.DEBUG) error("WorkflowTrigger reached toPaywallAction — componentId is null")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note that BuildConfig.DEBUG will only work for us, not on developer's apps. If we wanted to do that, we could use appConfig.isDebugBuild, but maybe we want to keep that behavior internal...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@vegaro vegaro enabled auto-merge April 24, 2026 13:38
@vegaro vegaro added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 1bdaa5a Apr 24, 2026
36 checks passed
@vegaro vegaro deleted the cesar/wfl-46-button-workflow-trigger branch April 24, 2026 14:16
matteinn pushed a commit to matteinn/purchases-android that referenced this pull request May 5, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Unified StoreReplacementMode API (RevenueCat#3234) via Will Taylor
(@fire-at-will)
* Add placement and targeting context to paywall events (RevenueCat#3253) via Dan
Pannasch (@dpannasch)
### 🐞 Bugfixes
* Fix null Placements when offering_ids_by_placement is absent (RevenueCat#3254)
via Dan Pannasch (@dpannasch)

## RevenueCatUI SDK
### Paywallv2
#### ✨ New Features
* Wire multipage workflow navigation into PaywallViewModel (RevenueCat#3381) via
Cesar de la Vega (@vegaro)

### 🔄 Other Changes
* Add `triggerType` to `WorkflowTrigger` (RevenueCat#3393) via Cesar de la Vega
(@vegaro)
* Extract private function `NavigateTo.toPaywallAction` (RevenueCat#3392) via
Cesar de la Vega (@vegaro)
* Bump revenucatui-tests gradle cache key (RevenueCat#3391) via Toni Rico
(@tonidero)
* Create `WorkflowTriggerType` and `WorkflowTriggerActionType` (RevenueCat#3386)
via Cesar de la Vega (@vegaro)
* Update baseline profiles (RevenueCat#3390) via RevenueCat Git Bot (@RCGitBot)
* Plumb `componentId` through buttons on workflow interactions (RevenueCat#3380)
via Cesar de la Vega (@vegaro)
* Add `ButtonComponent.Action.Workflow` (RevenueCat#3385) via Cesar de la Vega
(@vegaro)
* Add `componentId` to `ButtonCoomponentStyle` (RevenueCat#3384) via Cesar de la
Vega (@vegaro)
* Migrate all suspendCoroutine usages to suspendCancellableCoroutine
(RevenueCat#3365) via Jaewoong Eum (@skydoves)
* Add `WorkflowNavigator` for multipage workflow step navigation (RevenueCat#3379)
via Cesar de la Vega (@vegaro)
* build(deps): bump fastlane-plugin-revenuecat_internal from `b822f01`
to `d24ab26` (RevenueCat#3383) via dependabot[bot] (@dependabot[bot])
* Add `id` field to `ButtonComponent` (RevenueCat#3377) via Cesar de la Vega
(@vegaro)
* Add CI workflows for generating Baseline Profiles (RevenueCat#3372) via Jaewoong
Eum (@skydoves)
* add min sdk level for paywalls and customer center (RevenueCat#2465) via
Muhammad-Sharif Moustafa (@mshmoustafa)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: updates version strings, changelogs, and
documentation deployment targets without changing runtime logic beyond
the reported version identifier.
> 
> **Overview**
> Cuts the `10.3.0` release by updating all version references from
`10.3.0-SNAPSHOT` to `10.3.0` across build config (`gradle.properties`,
`.version`, `Config.frameworkVersion`) and sample/test app dependency
pins.
> 
> Updates release documentation publishing to sync Dokka output to the
`10.3.0` S3 path and changes `docs/index.html` to redirect to `10.3.0`.
Also promotes release notes by moving `CHANGELOG.latest.md` entries into
a new `CHANGELOG.md` section for `10.3.0`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
056ce62. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

3 participants