`
- Create an `
![]()
` with `src` = `URL.createObjectURL(element.imageBlob)`
- Set `alt` = `element.description`
- Apply random offset per D-07: `style="transform: translate(${randomOffset}px, ${randomOffset}px)"` where offset is +-10-20px random
- If `element.id === newElementId`, add class `forest__element--new` for animation
- Append to grid
5. Store created Object URLs in a module-level array so they can be revoked on next call (prevent memory leak):
```typescript
let activeObjectUrls: string[] = [];
```
At start of function, revoke all old URLs via `URL.revokeObjectURL()`, then clear array.
Update `initForestScreen` to call `renderForestScene(db)` alongside existing `renderLevelMap`.
The `newElementId` parameter will be used by Plan 04 (reward flow) to trigger animation on the just-added element.
npx tsc --noEmit && npx vitest run
- grep "renderForestScene" src/forest/scene.ts returns export
- grep "getForestElements" src/forest/scene.ts returns match (loads from IDB)
- grep "createObjectURL" src/forest/scene.ts returns match (blob->URL conversion)
- grep "revokeObjectURL" src/forest/scene.ts returns match (memory cleanup)
- grep "forest__element--new" src/forest/scene.ts returns match (animation class)
- grep "renderForestScene" src/forest/scene.ts shows it's called from initForestScreen
- npx tsc --noEmit exits 0
Forest scene renders all stored elements from IndexedDB as images in the 4x3 grid. New elements get animation class. Object URLs cleaned up on re-render. Level map preserved alongside scene.
- `npx tsc --noEmit` — no type errors
- `npx vitest run` — all tests pass
- Forest screen has SVG background visible with grid overlay
- Elements from IndexedDB render as images with random offset
1. Forest screen shows SVG woodland background (sky, hills, trees, clouds)
2. 4x3 CSS grid overlays the SVG for element placement
3. All stored ForestElements load from IndexedDB and display as images
4. New elements animate with fade-in + scale-up (1.2s ease-out)
5. Object URLs properly managed (revoked on re-render)
6. Level map still visible below/alongside the scene