MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / showTutorialStep

Function showTutorialStep

tutorials.js:273–306  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271
272// Show current tutorial step
273export 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
309function highlightElement(element, step) {

Callers 3

index.jsFile · 0.85
nextTutorialStepFunction · 0.85
previousTutorialStepFunction · 0.85

Calls 5

closeTutorialFunction · 0.85
uiMethod · 0.80
errorMethod · 0.80
highlightElementFunction · 0.70
showTutorialOverlayFunction · 0.70

Tested by

no test coverage detected