Refine a Module
Use inline refine mode to iteratively improve your generated module with natural language feedback.
After generating a module, you can refine it in the Playground. Click the Refine Module button in the Playground header to toggle inline refine mode. A composer bar appears at the bottom of the content area with a text input, preset chips, and a submit button.
Navigation sidebar
When refine mode is active, a fixed-width navigation sidebar appears on the left side of the Playground. It displays the full section and lesson tree with collapsible section headers (all expanded by default). Each lesson shows its title, type badge, and estimated duration.
The sidebar serves two purposes depending on the current status:
- During idle, accepted, or refining states: clicking a section or lesson in the sidebar changes the refine scope to that item. The currently selected scope is highlighted while other items are dimmed. During the refining state, the targeted item shows a shimmer animation.
- During reviewing state: clicking a lesson in the sidebar selects it for viewing in the diff panel. The currently viewed lesson is highlighted.
Status indicator dots
During reviewing, each lesson in the sidebar shows a status indicator:
- Gray dot: no AI changes for this lesson
- Yellow dot: AI proposed changes, not yet reviewed
- Green checkmark: change accepted
- Red X: change rejected
These indicators update in real time as you accept or reject individual changes.
Submitting a prompt calls the refine API. A progress spinner shows in the composer bar while the AI processes your request. After results arrive, change cards appear with accept/reject controls. Toggling refine mode off returns the playground to its normal state.
You can also enter refine mode from contextual entry points, each pre-scoped to the relevant part of your module:
- Refine quick action on a lesson (in the detail panel) opens refine mode scoped to that lesson.
- Shorten quick action on a lesson opens refine mode with "Shorten this lesson" pre-filled.
- Make interactive quick action opens refine mode with an interactivity prompt pre-filled.
- Refine with AI button on a lesson opens refine mode scoped to that lesson.
- Refine icon (sparkle) on a section card header opens refine mode scoped to that section.
- Add lesson button inside a section opens refine mode scoped to the section with a structural prompt.
- Add section button at the bottom of the module opens refine mode at module scope with a structural prompt.
Choosing a scope
You can refine at three levels:
- Module: applies refinement across the entire module
- Section: targets a single section and its lessons
- Lesson: targets a specific lesson
The scope is set automatically based on how you entered refine mode. You can also click any item in the tree navigator or use the scope breadcrumb to change scope.
Using preset chips
Below the text area, preset chips let you apply common refinements with a single click. Presets are grouped into two categories:
- Content: Shorten, Simplify, More detail, More interactive
- Structure (module and section scope only): Add quiz, Add lesson, Split section, Reorder
At module scope, only Add quiz and Reorder structure presets are shown. At section scope all four structure presets are visible. No structure presets appear at lesson scope.
Clicking a content preset submits the refinement immediately. The Add quiz structure preset opens a submenu where you choose the assessment type (MCQ, True/False, Fill-in-the-blank, and others) before submitting. All other structure presets submit directly.
Preset chips are disabled while a refinement is in progress.
Submitting feedback
You can also type a custom refinement in the text area at the bottom. Press Ctrl+Enter (or Cmd+Enter on macOS) or click Refine to submit. A progress indicator shows while the AI processes your request.
Reviewing changes
After processing, change cards appear showing each proposed edit. Each card displays:
- The change type (content updated, lesson added, lesson removed, section added, section removed, or reordered)
- A summary of what changed
- An expand/collapse toggle to view details
Change cards are read-only previews. You accept or reject the entire round as a batch.
Accepting or rejecting changes
Two buttons appear below the change cards:
- Accept All accepts all changes in the current round, updates the working module, and collapses the round into a summary.
- Reject discards the current round without modifying the module.
Multiple refinement rounds
After accepting a round, the round collapses into a compact summary line showing the prompt excerpt, accepted count, and rejected count (for example, "Shortened section 2 (3 accepted, 1 rejected)"). You can then type a new prompt and submit it to start another round.
Each new round builds on the module state from previous rounds. Previous round summaries stack vertically above the active round so you can see the full refinement history at a glance.
Discarding changes
Click Discard All to revert all accepted rounds, not just the current one. The module returns to the version from before you entered refine mode.
Finalizing
When you have accepted at least one round, a finalize bar appears at the top of the composer showing the totals across all rounds (for example, "5 accepted, 1 rejected"). Round history badges appear above the text area listing each completed round individually ("Round 1: 3 accepted, 1 rejected").
Click Apply Changes to open a confirmation dialog with a summary of accepted and rejected counts. Click Confirm to persist the final module state, or Cancel to return to the review and continue refining. The Playground updates immediately with no page reload.
Manual edit overrides
If you have manually edited a lesson, any AI-suggested change targeting that lesson is automatically skipped. Skipped changes appear grayed out in the change summary sidebar with an "Overridden by manual edit" label. This prevents AI refinements from overwriting your manual work.
Exiting with unsaved changes
If you toggle off refine mode while rounds have been accepted but not finalized, a confirmation prompt appears with two options:
- Apply & Exit: finalizes your changes and exits refine mode
- Discard & Exit: reverts all changes and exits refine mode