feat(js,react): add support for personalization to trigger, wait and targeting#691
Merged
Conversation
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds user-property template processing for tour wait conditions (e.g., tourWait.element selectors and tourWait.page.value path expressions) so that tour progression can be personalized similarly to other templated content in the SDKs.
Changes:
- Introduces
processTourWait()in@flows/sharedto templatetourWait.elementandtourWait.page.valueusingUserProperties. - Wires tour-wait processing into both React (
TourController) and JS SDK tour logic, and adds an E2E regression suite for the new behavior. - Adds a React
useUserPropertieshook to stabilize theuserPropertiesreference and avoid unnecessary effect churn.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workspaces/shared/src/tour-wait/tour-wait.ts | Adds processTourWait() to apply templating to tour wait fields. |
| workspaces/shared/src/tour-wait/tour-wait.spec.ts | Unit tests for processTourWait() behavior. |
| workspaces/shared/src/index.ts | Exports processTourWait from @flows/shared. |
| workspaces/react/src/tour-controller.ts | Applies processTourWait before evaluating wait conditions. |
| workspaces/react/src/hooks/use-user-properties.ts | New hook to keep userProperties stable unless values change. |
| workspaces/react/src/hooks/use-blocks.ts | Adjusts userProperties handling/refetch trigger to rely on upstream stabilization. |
| workspaces/react/src/flows-provider.tsx | Uses useUserProperties and passes stabilized userProperties through context/hooks. |
| workspaces/js/src/lib/tour.ts | Applies processTourWait in JS SDK tour wait evaluation paths. |
| workspaces/e2e/tests/personalization.spec.ts | Adds E2E coverage for templating in tourWait.page.value and tourWait.element. |
| workspaces/e2e/pages/react.tsx | Adds a DOM hook (className="age-10") for the new tour-wait click test. |
| workspaces/e2e/pages/js.html | Adds a DOM hook (class="age-10") for the new tour-wait click test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OPesicka
requested changes
May 26, 2026
OPesicka
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request checklist