fix: resolve initialization bugs breaking level indicator and expected preview
- Fix renderLesson to handle null inputEl (CodeMirror replaces textarea) - Fix renderExpectedPreview to use 'solution' property instead of 'solutionCode' - These fixes restore level indicator, expected preview, and auto-run functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,10 +133,10 @@ export function renderLesson(titleEl, descriptionEl, taskEl, previewEl, prefixEl
|
||||
// Set task instructions
|
||||
taskEl.innerHTML = lesson.task || "";
|
||||
|
||||
// Set code editor contents
|
||||
// prefixEl.textContent = lesson.codePrefix || "";
|
||||
inputEl.value = lesson.initialCode || "";
|
||||
// suffixEl.textContent = lesson.codeSuffix || "";
|
||||
// Set code editor contents (if inputEl is provided)
|
||||
if (inputEl) {
|
||||
inputEl.value = lesson.initialCode || "";
|
||||
}
|
||||
|
||||
// Clear any existing feedback
|
||||
clearFeedback();
|
||||
|
||||
Reference in New Issue
Block a user