docs/ai_builder/features/editor_modes.md
The AI Builder includes a powerful dual-mode editor that lets you view and edit your application code while tracking changes made by the AI. You can seamlessly switch between Editor Mode for manual code editing and Diff Mode for reviewing AI-generated changes.
import reflex as rx
def render_image():
return rx.el.div(
rx.image(
src="https://web.reflex-assets.dev/ai_builder/features/diff_light.avif",
class_name="rounded-md h-auto",
border=f"0.81px solid {rx.color('slate', 5)}",
),
class_name="w-full flex flex-col rounded-md",
)
rx.el.div(render_image())
The standard code editor where you can:
A specialized view that highlights changes from the last AI prompt:
Located in the editor toolbar, you'll find:
Use Editor Mode when:
Use Diff Mode when:
Additions (Green):
Deletions (Red):
The file tree shows change statistics for each modified file:
Change Indicators:
+5 - 5 lines added to this file-3 - 3 lines removed from this file+12 -8 - 12 lines added, 8 lines removedVisual Cues:
+ symbol indicates files with additions- symbol indicates files with deletions