Skip to content
Merged

Updates #1207

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Extracted hook providing all tour control methods. Created once via `useMemo`, r
| `next()` | RUNNING only. Sets `action:NEXT, index+1 (clamped to size), lifecycle:COMPLETE` |
| `open()` | RUNNING only. Sets `lifecycle:TOOLTIP_BEFORE` to force-open tooltip |
| `prev()` | RUNNING only. Sets `action:PREV, index-1 (clamped to 0), lifecycle:COMPLETE` |
| `replay(origin?)` | RUNNING + lifecycle:TOOLTIP only. Sets `action:REPLAY, lifecycle:COMPLETE`. Index unchanged. Triggers full step re-entry through `step:after` → `step:before` → BEACON/TOOLTIP |
| `reset(restart?)` | Uncontrolled only. Sets `index:0, lifecycle:INIT, status:READY (or RUNNING if restart)` |
| `skip(origin?)` | RUNNING only. Sets `action:SKIP, lifecycle:COMPLETE, status:SKIPPED` |
| `start(nextIndex?)` | Sets `action:START, lifecycle:INIT, status:RUNNING (or WAITING if no steps)`. Uses `forceIndex=true` |
Expand Down Expand Up @@ -275,6 +276,7 @@ When lifecycle reaches READY:
- COMPLETE lifecycle (from TOOLTIP) → fires `step:after` event, runs `after` hook (fire-and-forget), fires `step:after_hook` event

**Effect 5: Tour flow** (`deps: [action, index, lifecycle, size, status, store]`)
- Action REPLAY + COMPLETE → writes `lifecycle:INIT` (works in both controlled and uncontrolled modes; bypasses the controlled-mode pause and the FINISHED branch on the last step to allow same-index re-entry)
- No step + lifecycle INIT → sets FINISHED
- Uncontrolled + COMPLETE + index < size → auto-advances to INIT (controlled mode pauses here, waiting for parent to update `stepIndex`)
- COMPLETE + index >= size → sets FINISHED
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/chat/step2-tooltip-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/chat/step2-tooltip-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/chat/step2-tooltip-webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step7-users-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step7-users-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step7-users-webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step8-connections-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step8-connections-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/__snapshots__/controlled/step8-connections-webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions e2e/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ test('chat', async ({ page, request }) => {
await expect(page).toHaveScreenshot('step2-tooltip.png');
});

await test.step('Step 2 - Search (replay via overlay)', async () => {
await overlay.click({ position: { x: 10, y: 10 } });

const beacon = page.getByTestId('button-beacon');

await expect(beacon).toBeVisible();
await expect(page).toHaveScreenshot('step2-replay-beacon.png');

await beacon.click();

await expect(page).toHaveScreenshot('step2-replay-tooltip.png');
});

await test.step('Step 3 - Channels', async () => {
await primaryButton.click();

Expand Down
14 changes: 14 additions & 0 deletions e2e/controlled.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ test('controlled', async ({ page, request }) => {
await expect(page).toHaveScreenshot('step7-users.png');
});

await test.step('Step 7 - Users (replay via ESC)', async () => {
await page.keyboard.press('Escape');

const beacon = page.getByTestId('button-beacon');

await expect(beacon).toBeVisible();
await expect(page).toHaveScreenshot('step7-replay-beacon.png');

await beacon.click();

await expect(tooltip).toContainText('Our Users');
await expect(page).toHaveScreenshot('step7-replay-tooltip.png');
});

await test.step('Step 8 - Connections', async () => {
await page.getByTestId('button-primary').click();

Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@gilbarbara/eslint-config": "^1.1.0",
"@gilbarbara/eslint-config": "^1.2.1",
"@gilbarbara/prettier-config": "^1.0.0",
"@gilbarbara/tsconfig": "^1.0.0",
"@playwright/test": "^1.58.2",
"@size-limit/preset-big-lib": "^12.0.1",
"@swc/core": "^1.15.21",
"@playwright/test": "^1.59.1",
"@size-limit/preset-big-lib": "^12.1.0",
"@swc/core": "^1.15.32",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
Expand All @@ -69,22 +69,22 @@
"@types/scrollparent": "^2.0.3",
"@types/use-sync-external-store": "^1.5.0",
"@vitejs/plugin-react-swc": "^4.3.0",
"@vitest/coverage-v8": "^4.1.2",
"@vitest/coverage-v8": "^4.1.5",
"cross-env": "^10.1.0",
"del-cli": "^7.0.0",
"eslint": "^9.39.2",
"husky": "^9.1.7",
"jest-extended": "^7.0.0",
"jsdom": "^29.0.1",
"prettier": "^3.8.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"jsdom": "^29.1.0",
"prettier": "^3.8.3",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"repo-tools": "^0.3.1",
"size-limit": "^12.0.1",
"tsdown": "^0.21.7",
"size-limit": "^12.1.0",
"tsdown": "^0.21.10",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.2"
"vitest": "^4.1.5"
},
"scripts": {
"build": "tsdown",
Expand Down
Loading
Loading