AI lesson ideas
When you're starting from a blank document, AI lesson ideas (AiLessonIdeaDialog.jsx) suggests a batch of lesson topics to pick from — each a short title plus a one-line description — rather than writing the lesson body. Pick one and it seeds a new lesson you then flesh out with the editor and the other AI helpers.
The suggestions are tailored to the age range the lesson is pitched at (see src/lib/ageRanges.js), which is stored on the lesson document.
How it works
Like the AI text and AI question helpers, it goes through the same Turnstile-verified Worker (apps/api):
- A Cloudflare Turnstile widget verifies the request.
- The verified token and the chosen
ageRangeare POSTed to the Worker withmode: "lessonIdea". - The Worker re-checks the token server-side, asks the model for a batch of ideas, and returns them as
{ "ideas": [{ "title", "description" }] }.
The frontend wrapper is suggestLessonIdeas() in @spelling-creator/core/aiSuggest. This feature needs the same VITE_API_URL / VITE_TURNSTILE_SITE_KEY as the other AI helpers (see Getting started).
A dismissable first-lesson wizard (FirstLessonWizard.jsx) — a floating, non-modal walkthrough that auto-shows once for newcomers and can be reopened from the editor's help button — points people at this and the other authoring tools.