Overview
Wire the "Add subtopics" action chip in CollapsibleSection to the suggest and create subtopics APIs. When tapped, show AI-suggested subtopics, let the user select/customize, then generate and display new child nodes inline.
User Story
User Story: /docs/user-stories/active/create-subtopics.md
As a user, I want to add child sections to any node, so I can branch out and explore adjacent areas within a topic.
Suggested Priority: high 🟠
Reasoning: Turns the last "Coming soon" chip into a real feature, completing the Explorer's action chip set.
Requirements
Technical Approach
UI Flow
Tap "Add subtopics" chip
→ SubtopicPanel opens inline
→ Loading: fetching suggestions...
→ 3 suggestion chips appear (toggleable)
→ User selects suggestions + optionally types custom labels
→ Tap "Create" button
→ Loading: generating content...
→ New child nodes appear in tree
→ Panel closes
Components
- SubtopicPanel: inline below chips (like ExpandPanel pattern)
- SuggestionChip: toggleable chip showing emoji + label
- Custom label input with "+" button
State Management
- On successful creation: add new child nodes to parent in tree state
- Update the parent's children array + recalculate childCount
- New nodes should inherit branchColor from parent's branch
Definition of Done
Related
Overview
Wire the "Add subtopics" action chip in CollapsibleSection to the suggest and create subtopics APIs. When tapped, show AI-suggested subtopics, let the user select/customize, then generate and display new child nodes inline.
User Story
User Story:
/docs/user-stories/active/create-subtopics.mdAs a user, I want to add child sections to any node, so I can branch out and explore adjacent areas within a topic.
Suggested Priority: high 🟠
Reasoning: Turns the last "Coming soon" chip into a real feature, completing the Explorer's action chip set.
Requirements
Technical Approach
UI Flow
Components
State Management
Definition of Done
Related
/docs/user-stories/active/create-subtopics.mdcomponents/CollapsibleSection/CollapsibleSection.tsxapp/topic/[id].tsx