MCPcopy Create free account
hub / github.com/danja/dogalog / showStep

Method showStep

src/tutorial/tutorialOverlay.js:128–155  ·  view source on GitHub ↗

* Show specific tutorial step * @param {number} stepIndex

(stepIndex)

Source from the content-addressed store, hash-verified

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

Callers 2

setupEventListenersMethod · 0.95
showMethod · 0.95

Calls 2

showMethod · 0.95
completeMethod · 0.80

Tested by

no test coverage detected