Skip to content

feat(js,react): add support for personalization to trigger, wait and targeting#691

Merged
VojtechVidra merged 6 commits into
mainfrom
feat/tour-wait-personalization
May 27, 2026
Merged

feat(js,react): add support for personalization to trigger, wait and targeting#691
VojtechVidra merged 6 commits into
mainfrom
feat/tour-wait-personalization

Conversation

@VojtechVidra
Copy link
Copy Markdown
Member

@VojtechVidra VojtechVidra commented May 26, 2026

Pull request checklist

  • Create and update TSDoc and export relevant TypeScript types
  • Write test for the new/updated features if possible
  • Test manually each SDK for larger UI changes
  • Link issue to this PR
  • Review docs and add or update as needed

@VojtechVidra VojtechVidra linked an issue May 26, 2026 that may be closed by this pull request
5 tasks
@VojtechVidra VojtechVidra requested a review from Copilot May 26, 2026 09:42
@VojtechVidra VojtechVidra requested a review from OPesicka May 26, 2026 09:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/shared to template tourWait.element and tourWait.page.value using UserProperties.
  • 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 useUserProperties hook to stabilize the userProperties reference 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.

Comment thread workspaces/shared/src/tour-wait/tour-wait.ts Outdated
Copy link
Copy Markdown
Member

@OPesicka OPesicka left a comment

Choose a reason for hiding this comment

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

I forgot to put it in the issue but this should also work for:

  • Tour trigger
  • Survey trigger
  • Component page targeting

@VojtechVidra VojtechVidra requested a review from OPesicka May 26, 2026 16:18
@OPesicka OPesicka changed the title feat(js,react): tour wait personalization feat(js,react): add support for personalization to trigger and wait May 27, 2026
@VojtechVidra VojtechVidra enabled auto-merge (squash) May 27, 2026 08:39
@VojtechVidra VojtechVidra changed the title feat(js,react): add support for personalization to trigger and wait feat(js,react): add support for personalization to trigger, wait and targeting May 27, 2026
@VojtechVidra VojtechVidra disabled auto-merge May 27, 2026 08:43
@VojtechVidra VojtechVidra enabled auto-merge (squash) May 27, 2026 08:44
@VojtechVidra VojtechVidra merged commit f144bef into main May 27, 2026
7 checks passed
@VojtechVidra VojtechVidra deleted the feat/tour-wait-personalization branch May 27, 2026 08:59
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.

Add support for personalization to wait

3 participants