Skip to content

Updates#1207

Merged
gilbarbara merged 6 commits into
mainfrom
updates
Apr 29, 2026
Merged

Updates#1207
gilbarbara merged 6 commits into
mainfrom
updates

Conversation

@gilbarbara

Copy link
Copy Markdown
Owner

This pull request introduces a new "replay step" feature to the guided tour component, allowing users to replay the current step via the close button, ESC key, or overlay click. It also includes supporting changes in the codebase, updates to documentation, and dependency upgrades. The most significant changes are grouped below:

New "Replay Step" Feature

  • Added a new replay control method to the tour controls, enabling re-running of the current step, including its lifecycle events and hooks. This is exposed in the Controls type and implemented in useControls. (src/hooks/useControls.ts [1] [2] src/types/state.ts [3] src/literals/index.ts [4]
  • Updated the Options interface to support 'replay' as a valid value for closeButtonAction, dismissKeyAction, and overlayClickAction, allowing users to trigger the replay via close button, ESC key, or overlay click. (src/types/common.ts [1] [2] [3]
  • Integrated the new replay action into UI components (Tooltip, TourRenderer) so the replay can be triggered from user interactions. (src/components/Tooltip/index.tsx [1] src/components/TourRenderer.tsx [2] [3]
  • Implemented replay action handling in the tour lifecycle, ensuring correct re-entry into the step and proper event emission. (src/hooks/useLifecycleEffect.ts [1] [2]
  • Added and updated tests to cover the new replay functionality, including unit and end-to-end tests. (test/hooks/useControls.spec.ts [1] e2e/chat.spec.ts [2] e2e/controlled.spec.ts [3] test/__setup__/test-helpers.ts [4]

Documentation and Architecture

  • Updated the architecture documentation to describe the new replay control method, its behavior, and its effect on the tour flow. (docs/architecture.md [1] [2]

Bug Fixes and Minor Improvements

  • Fixed the omit and pick helper functions to combine checks into a single condition, improving efficiency and correctness. (src/modules/helpers.tsx [1] [2]
  • Adjusted the default z-index calculation for the floater component to avoid excessive stacking context. (src/components/Floater.tsx [1] test/tours/__snapshots__/component.spec.tsx.snap [2] [3]

Dependency Updates

  • Upgraded several development dependencies, including Playwright, ESLint config, SWC, jsdom, React, and others, to their latest versions for improved stability and compatibility. (package.json [1] [2]

Code Quality

  • Added eslint-disable-next-line comments to suppress cognitive complexity warnings in lifecycle effect hooks. (src/hooks/useLifecycleEffect.ts [1] [2] [3]

These changes collectively enhance the user experience by allowing steps to be replayed on demand and improving the maintainability and reliability of the codebase.

Copilot AI review requested due to automatic review settings April 29, 2026 01:32
@codesandbox

codesandbox Bot commented Apr 29, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a new “replay current step” capability to the Joyride tour, letting users re-run the active step (including hooks/lifecycle events) via controls or configured UI interactions (close button, ESC, overlay click), plus accompanying docs, demos, and test updates.

Changes:

  • Added controls.replay() and the ACTIONS.REPLAY action, with lifecycle handling to re-enter the same step and re-emit step events/hooks.
  • Extended Options/action wiring so close button, ESC key, and overlay click can trigger replay.
  • Updated docs, website demos, and test coverage (unit + E2E + snapshots); adjusted floater z-index behavior and bumped dependencies.

Reviewed changes

Copilot reviewed 43 out of 66 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
website/src/providers/ConfigProvider.tsx Suppresses cognitive complexity lint warning for settings updater.
website/src/modules/helpers.ts Simplifies tour color config (overlay color).
website/src/hooks/useIsE2E.ts Adds client hook to detect ?e2e mode.
website/src/css/react-color.css Removes trailing whitespace/blank lines.
website/src/components/SourceCodeLink.tsx Adds “view source” floating link for demos.
website/src/components/Playground.tsx Simplifies onEvent finish/skip run-state logic.
website/src/components/ConfigPanel/FAB.tsx Updates FAB styling/positioning and sizing.
website/src/app/docs/recipes/recipes.mdx Adds guidance for conditional/dynamic steps using before hooks.
website/src/app/docs/props/options/OptionsTable.tsx Documents new 'replay' action values for interactions.
website/src/app/docs/props/PropsTable.tsx Links controlled-mode guidance to conditional/dynamic steps recipe.
website/src/app/docs/how-it-works/how-it-works.mdx Expands explanation of uncontrolled vs controlled + before hooks.
website/src/app/docs/hook/hook.mdx Adds tip reinforcing uncontrolled default + conditional UI approach.
website/src/app/docs/hook/ControlsTable.tsx Documents replay control and clarifies running-only controls.
website/src/app/docs/exports/exports.mdx Adds ACTIONS.REPLAY to exports documentation.
website/src/app/docs/events/events.mdx Adds tip about controlled example vs uncontrolled + before hooks.
website/src/app/demos/scroll/Scroll.tsx Adjusts demo heading styling for responsiveness.
website/src/app/demos/overview/Overview.tsx Switches E2E detection to useIsE2E.
website/src/app/demos/multi-route/layout.tsx Switches E2E detection to useIsE2E and adjusts mount logic.
website/src/app/demos/modal/Modal.tsx Adjusts demo headings styling for responsiveness.
website/src/app/demos/layout.tsx Removes useSearchParams/Suspense gating; uses useIsE2E; adds SourceCodeLink.
website/src/app/demos/custom-components/CustomComponents.tsx Switches E2E detection to useIsE2E; tweaks heading styles.
website/src/app/demos/controlled/Controlled.tsx Demonstrates replay via configured actions; updates text and event handling.
website/src/app/demos/chat/Chat.tsx Demonstrates replay via configured actions; updates text and E2E detection.
website/package.json Updates website dependencies and adds validate script.
test/tours/replay.spec.tsx Adds new test suite covering replay behavior and UI wiring.
test/tours/snapshots/hook.spec.tsx.snap Updates snapshots due to z-index changes.
test/tours/snapshots/custom-options.spec.tsx.snap Updates snapshots due to z-index changes.
test/tours/snapshots/component.spec.tsx.snap Updates snapshots due to z-index changes.
test/hooks/useControls.spec.ts Adds unit tests for controls.replay().
test/setup/test-helpers.ts Updates controls shape expectation to include replay.
src/types/state.ts Extends Controls type with replay.
src/types/common.ts Extends Options action unions to include 'replay'.
src/modules/helpers.tsx Refactors omit/pick loops (combined conditions).
src/literals/index.ts Adds ACTIONS.REPLAY.
src/hooks/useLifecycleEffect.ts Adds REPLAY handling and lifecycle reset path for replay re-entry.
src/hooks/useControls.ts Implements controls.replay() state transition.
src/components/TourRenderer.tsx Wires 'replay' behavior for ESC and overlay click.
src/components/Tooltip/index.tsx Wires close button 'replay' behavior.
src/components/Floater.tsx Adjusts floater z-index calculation.
package.json Updates dev dependencies (Playwright, SWC, jsdom, React, Vitest, etc.).
e2e/controlled.spec.ts Adds E2E coverage for replay via ESC.
e2e/chat.spec.ts Adds E2E coverage for replay via overlay click.
e2e/snapshots/controlled/step7-replay-beacon-chromium.png Adds replay beacon screenshot snapshot.
docs/architecture.md Documents replay control method and lifecycle flow impact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/src/hooks/useIsE2E.ts
Comment thread website/src/components/SourceCodeLink.tsx
Comment thread website/src/components/SourceCodeLink.tsx
Comment thread website/src/app/demos/chat/Chat.tsx
Comment thread website/src/app/demos/controlled/Controlled.tsx
- new ACTIONS.REPLAY literal and Controls.replay(origin?) method
- re-emits step:after/step:before, re-runs before/after hooks, index unchanged
- wired into closeButtonAction/dismissKeyAction/overlayClickAction as 'replay'
- docs: architecture, exports, ControlsTable, OptionsTable
- update ConfigPanel/FAB styles
@sonarqubecloud

Copy link
Copy Markdown

@gilbarbara gilbarbara merged commit b15b3bd into main Apr 29, 2026
6 checks passed
@gilbarbara gilbarbara deleted the updates branch April 29, 2026 03:05
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