feat(05-01): extend Progress type with currentForestPage, add paginated renderForestScene
- Add currentForestPage: number field to Progress interface in types.ts - Export SLOTS_PER_PAGE = 12 constant from scene.ts - Change renderForestScene signature to accept page: number parameter - Slice elements by page (start/end = page * SLOTS_PER_PAGE) - Update navigation UI (forest-nav) after rendering - Add migrateProgress entry for currentForestPage in app.ts - Fix Progress object literals in db.test.ts and screens.ts to include new field
This commit is contained in:
+4
-1
@@ -38,6 +38,7 @@ function migrateProgress(
|
||||
if (!progress.lastPlayedLevels) progress.lastPlayedLevels = [];
|
||||
if (progress.totalCorrect === undefined) progress.totalCorrect = 0;
|
||||
if (progress.totalErrors === undefined) progress.totalErrors = 0;
|
||||
if (progress.currentForestPage === undefined) progress.currentForestPage = 0;
|
||||
}
|
||||
|
||||
async function handleLessonComplete(
|
||||
@@ -120,7 +121,9 @@ async function handleLessonComplete(
|
||||
async () => {
|
||||
// "Zurück zum Wald" -- show forest with new element animated
|
||||
await initForestScreen(db, startLessonFromForest);
|
||||
await renderForestScene(db, elementId);
|
||||
const prog = await getProgress(db);
|
||||
const page = prog?.currentForestPage ?? 0;
|
||||
await renderForestScene(db, page, elementId);
|
||||
showScreen("forest");
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user