Lesson Plan Children
LessonPlan is the only current parent modality. It implements the HasChildren trait, managing child whiteboard sessions via the Slot container.
HasChildren
Section titled “HasChildren”impl HasChildren for LessonPlan { type ChildModality = Whiteboard; type ChildSessionIntent = SessionIntent<WhiteboardIntent>;
fn children(&self) -> &HashMap<String, Slot< Session<Whiteboard, SessionIntent<WhiteboardIntent>>, Vec<WhiteboardElement>, >> { &self.children }
fn children_mut(&mut self) -> &mut HashMap<...> { &mut self.children }
fn selected_child_id(&self) -> Option<&str> { // returns the currently focused slide ID }
fn reconcile_children(&mut self) { // create Cold slots for new placements, remove stale ones }}reconcile_children() is called inside the ReduceIntent impl after modality reduce, before the lifecycle runs.
Hot/Cold Lifecycle
Section titled “Hot/Cold Lifecycle”All children start Cold when the session opens. The Slot enum manages the transition:
pub enum Slot<C, O> { Cold(O), // cached compiled output, no recompilation Hot(C), // full component (Session), can recompile}Lifecycle Steps
Section titled “Lifecycle Steps”- Open — all children start Cold (cached output from parent’s synced state or empty).
- Navigate — Dart dispatches
ParentSessionIntent::WarmChild { id }. - Load —
WarmChildspawnsfx.spawn(backend.load)which returnsParentSessionFeedback::ChildWarmed { id, bytes }. - Hot — a full
Session<Whiteboard, SessionIntent<WhiteboardIntent>>is created from the loaded bytes and inserted into the slot. - Dispatch — child intents arrive via
ParentSessionIntent::Child { id, intent }, which callschild_session.dispatch(). - Close — session persists children internally (Hot sessions export their docs).
Dispatching to a Cold slot is an error — the child must be warmed first.
Child AI Subagents
Section titled “Child AI Subagents”Each Hot child session has its own SessionEphemeral (its own AI state). During AI generation:
- Parent warms child:
WarmChild { id }—> backend load —>ChildWarmed - Parent dispatches to child:
Child { id, intent: SessionIntent::Ai(SendMessage) } - Child runs its own reduce cycle independently
- Parent recompiles after child completes
Related
Section titled “Related”- Overview — struct, types, compilation, parent dispatch
Whiteboard— the child modality embedded in each slideSlot— the hot/cold containerChildren— session-level children reference