# funlightstudios/code-editor-with-ai architecture

> Architecture diagram of the GitHub repository funlightstudios/code-editor-with-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/funlightstudios/code-editor-with-ai
- Repository: https://github.com/funlightstudios/code-editor-with-ai

## Overview

Funlight Editor is a PySide6 code editor with file and tab management, editor assistance, customizable presentation, and an AI chat workflow. Users launch the desktop app, open or create files, edit code, and optionally request analysis, suggestions, or edits through the AI assistant. The README documents the product capabilities; sampled source confirms several UI connections and editor dependencies, but does not expose all runtime wiring. DEMOFILE.py is retained as a core module, though its role is unclear from the available evidence.

Main entry points: [`gui/editor_window.py`](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/editor_window.py) (Editor window), [`gui/code_editor.py`](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/code_editor.py) (Code editor), [`main.py`](https://github.com/funlightstudios/code-editor-with-ai/blob/main/main.py) (Application entry), [`gui/ai_assistant.py`](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/ai_assistant.py) (AI assistant UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_entry["Application entry<br/>[main.py]"]
  node_window["Editor window<br/>[editor_window.py]"]
  node_sidebar["Sidebar and search<br/>[sidebar.py]"]
  node_search_dialog["Find and replace<br/>[search_dialog.py]"]
  node_settings_dialog["Editor settings<br/>[settings_dialog.py]"]
  node_demo["Demo module<br/>[DEMOFILE.py]"]
end

subgraph group_editing["Code Editing"]
  node_editor["Code editor<br/>[code_editor.py]"]
  node_minimap["Code minimap<br/>[minimap.py]"]
  node_highlighter["Python highlighter"]
  node_autocomplete["Autocomplete<br/>[autocomplete.py]"]
  node_line_numbers["Line numbers<br/>[line_numbers.py]"]
  node_line_area["Line number area"]
end

subgraph group_ai["AI Assistance"]
  node_ai_ui["AI assistant UI<br/>[ai_assistant.py]"]
  node_ai_api["AI API integration<br/>[chatgpt_api.py]"]
end

subgraph group_presentation["Presentation"]
  node_theme["Theme definitions<br/>[themes.py]"]
  node_windsurf_theme["Windsurf theme<br/>[windsurf_theme.py]"]
  node_translations["Translations<br/>[translations.py]"]
end

node_user(("Editor user"))

node_user -->|"launches"| node_entry
node_entry -->|"opens editor"| node_window
node_user -->|"edits files"| node_window
node_window -->|"routes settings"| node_sidebar
node_window -->|"opens search"| node_search_dialog
node_window -->|"opens settings"| node_settings_dialog
node_window -->|"manages tabs"| node_editor
node_editor -->|"provides editor view"| node_minimap
node_editor -->|"highlights syntax"| node_highlighter
node_editor -->|"requests completions"| node_autocomplete
node_editor -->|"displays line numbers"| node_line_numbers
node_editor -.->|"paints line area"| node_line_area
node_user -->|"requests assistance"| node_ai_ui
node_ai_ui -.->|"requests AI response"| node_ai_api
node_user -->|"customizes editor"| node_settings_dialog
node_window -.->|"applies themes"| node_theme
node_theme -.->|"supplies colors"| node_highlighter
node_entry -->|"loads translations"| node_translations
node_window -->|"uses translations"| node_translations

click node_entry "https://github.com/funlightstudios/code-editor-with-ai/blob/main/main.py"
click node_window "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/editor_window.py"
click node_sidebar "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/sidebar.py"
click node_search_dialog "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/dialogs/search_dialog.py"
click node_settings_dialog "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/dialogs/settings_dialog.py"
click node_editor "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/code_editor.py"
click node_minimap "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/minimap.py"
click node_highlighter "https://github.com/funlightstudios/code-editor-with-ai/blob/main/syntax/python_highlighter.py"
click node_autocomplete "https://github.com/funlightstudios/code-editor-with-ai/blob/main/utils/autocomplete.py"
click node_line_numbers "https://github.com/funlightstudios/code-editor-with-ai/blob/main/utils/line_numbers.py"
click node_line_area "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/line_number_area.py"
click node_ai_ui "https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/ai_assistant.py"
click node_ai_api "https://github.com/funlightstudios/code-editor-with-ai/blob/main/chatgpt_api.py"
click node_theme "https://github.com/funlightstudios/code-editor-with-ai/blob/main/themes.py"
click node_windsurf_theme "https://github.com/funlightstudios/code-editor-with-ai/blob/main/themes/windsurf_theme.py"
click node_translations "https://github.com/funlightstudios/code-editor-with-ai/blob/main/translations.py"
click node_demo "https://github.com/funlightstudios/code-editor-with-ai/blob/main/DEMOFILE.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_window,node_sidebar,node_search_dialog,node_settings_dialog,node_demo,node_user toneBlue
class node_editor,node_minimap,node_highlighter,node_autocomplete,node_line_numbers,node_line_area toneAmber
class node_ai_ui,node_ai_api toneMint
class node_theme,node_windsurf_theme,node_translations toneRose
```

## Components

### Application UI

- [Application entry](https://github.com/funlightstudios/code-editor-with-ai/blob/main/main.py): `main.py`
- [Editor window](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/editor_window.py): `gui/editor_window.py`
- [Sidebar and search](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/sidebar.py): `gui/sidebar.py`
- [Find and replace](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/dialogs/search_dialog.py): `gui/dialogs/search_dialog.py`
- [Editor settings](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/dialogs/settings_dialog.py): `gui/dialogs/settings_dialog.py`
- [Demo module](https://github.com/funlightstudios/code-editor-with-ai/blob/main/DEMOFILE.py): `DEMOFILE.py`

### Code Editing

- [Code editor](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/code_editor.py): `gui/code_editor.py`
- [Code minimap](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/minimap.py): `gui/minimap.py`
- [Python highlighter](https://github.com/funlightstudios/code-editor-with-ai/blob/main/syntax/python_highlighter.py): `syntax/python_highlighter.py`
- [Autocomplete](https://github.com/funlightstudios/code-editor-with-ai/blob/main/utils/autocomplete.py): `utils/autocomplete.py`
- [Line numbers](https://github.com/funlightstudios/code-editor-with-ai/blob/main/utils/line_numbers.py): `utils/line_numbers.py`
- [Line number area](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/line_number_area.py): `gui/line_number_area.py`

### AI Assistance

- [AI assistant UI](https://github.com/funlightstudios/code-editor-with-ai/blob/main/gui/ai_assistant.py): `gui/ai_assistant.py`
- [AI API integration](https://github.com/funlightstudios/code-editor-with-ai/blob/main/chatgpt_api.py): `chatgpt_api.py`

### Presentation

- [Theme definitions](https://github.com/funlightstudios/code-editor-with-ai/blob/main/themes.py): `themes.py`
- [Windsurf theme](https://github.com/funlightstudios/code-editor-with-ai/blob/main/themes/windsurf_theme.py): `themes/windsurf_theme.py`
- [Translations](https://github.com/funlightstudios/code-editor-with-ai/blob/main/translations.py): `translations.py`

### Other components

- **Editor user**

## Connections

- Editor user → Application entry: launches (evidence: `README.md`)
- Application entry → Editor window: opens editor (evidence: `README.md`)
- Editor user → Editor window: edits files (evidence: `README.md`)
- Editor window → Sidebar and search: routes settings (evidence: `main.py`)
- Editor window → Find and replace: opens search (evidence: `gui/editor_window.py`)
- Editor window → Editor settings: opens settings (evidence: `gui/editor_window.py`)
- Editor window → Code editor: manages tabs (evidence: `gui/editor_window.py`)
- Code editor → Code minimap: provides editor view (evidence: `gui/code_editor.py`)
- Code editor → Python highlighter: highlights syntax (evidence: `gui/code_editor.py`)
- Code editor → Autocomplete: requests completions (evidence: `gui/code_editor.py`)
- Code editor → Line numbers: displays line numbers (evidence: `gui/code_editor.py`)
- Code editor → Line number area: paints line area
- Editor user → AI assistant UI: requests assistance (evidence: `README.md`)
- AI assistant UI → AI API integration: requests AI response (evidence: `README.md`)
- Editor user → Editor settings: customizes editor (evidence: `README.md`)
- Editor window → Theme definitions: applies themes
- Theme definitions → Python highlighter: supplies colors
- Application entry → Translations: loads translations (evidence: `main.py`)
- Editor window → Translations: uses translations (evidence: `gui/editor_window.py`)
