()
| 271 | |
| 272 | // Show current tutorial step |
| 273 | export function showTutorialStep() { |
| 274 | CarrotDebug.ui(`🎓 showTutorialStep called, currentStep: ${currentStep}`); |
| 275 | if (!tutorialSteps || tutorialSteps.length === 0) { |
| 276 | CarrotDebug.error('⚠️ No tutorial steps, closing'); |
| 277 | closeTutorial(); |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | const step = tutorialSteps[currentStep]; |
| 282 | const tutorial = tutorials[currentTutorial]; |
| 283 | |
| 284 | CarrotDebug.ui(`🎓 Looking for target element: ${step.target}`); |
| 285 | // Find target element |
| 286 | const targetElement = document.querySelector(step.target); |
| 287 | if (!targetElement) { |
| 288 | CarrotDebug.error(`⚠️ Tutorial target not found: ${step.target}, skipping step`); |
| 289 | CarrotDebug.ui(`⚠️ Tutorial target not found: ${step.target}, skipping step`); |
| 290 | // Try next step |
| 291 | if (currentStep < tutorialSteps.length - 1) { |
| 292 | currentStep++; |
| 293 | showTutorialStep(); |
| 294 | } else { |
| 295 | closeTutorial(); |
| 296 | } |
| 297 | return; |
| 298 | } |
| 299 | |
| 300 | CarrotDebug.ui(`✅ Found target element, showing tutorial overlay`); |
| 301 | // Highlight the target element |
| 302 | highlightElement(targetElement, step); |
| 303 | |
| 304 | // Show tutorial overlay with step content |
| 305 | showTutorialOverlay(tutorial, step, targetElement); |
| 306 | } |
| 307 | |
| 308 | // Highlight target element |
| 309 | function highlightElement(element, step) { |
no test coverage detected