* Show specific tutorial step * @param {number} stepIndex
(stepIndex)
| 126 | * @param {number} stepIndex |
| 127 | */ |
| 128 | showStep(stepIndex) { |
| 129 | const step = tutorialSteps[stepIndex]; |
| 130 | if (!step) { |
| 131 | this.manager.complete(); |
| 132 | return; |
| 133 | } |
| 134 | |
| 135 | // Update title and progress |
| 136 | this.titleElement.textContent = step.title; |
| 137 | this.progressElement.textContent = `${stepIndex + 1} / ${tutorialSteps.length}`; |
| 138 | |
| 139 | // Update content (allow HTML for code tags) |
| 140 | this.contentElement.innerHTML = step.content; |
| 141 | |
| 142 | // Update action |
| 143 | this.actionElement.innerHTML = `<strong>→</strong> ${step.action}`; |
| 144 | |
| 145 | // Update navigation buttons |
| 146 | this.prevBtn.disabled = stepIndex === 0; |
| 147 | |
| 148 | const isLastStep = stepIndex === tutorialSteps.length - 1; |
| 149 | this.nextBtn.textContent = isLastStep ? 'Finish' : 'Next'; |
| 150 | |
| 151 | // Show overlay if hidden |
| 152 | if (!this.visible) { |
| 153 | this.show(); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Load current step's code into editor |
no test coverage detected