Skip to content

Commit c3db187

Browse files
Refactor utilities and implement new home screen UI
- Removed the FontManager class and its methods for font creation. - Introduced ColorValidator, ImageValidator, PointValidator, and StateValidator classes for improved validation and utility functions. - Added a new PowerShell script (clean.ps1) for efficient Python codebase cleanup, including pip upgrades and tool installations. - Created a new home screen (home.py) with a responsive layout and recent projects feature. - Implemented a light mode theme system (themes.py) for consistent styling across the application. - Added a validation script (validate.py) to ensure all modules and fixes are functioning correctly.
1 parent 85050f6 commit c3db187

11 files changed

Lines changed: 4448 additions & 1662 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
__pycache__/
2+
.mypy_cache/
3+
.ruff_cache/
24
local/
35
*.pyc
46
*.zip

CHANGES.md

Lines changed: 118 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,118 @@
1-
# EfficientManim — Fix & Feature Summary
2-
3-
## 🔴 Critical Bug Fixes
4-
5-
### 1. `AttributeError: 'builtin_function_or_method' object has no attribute 'preview_path'`
6-
**Root Cause**: `NodeItem` stored data as `self.node_data` but all code accessed `node.data`, which
7-
called `QGraphicsItem.data()` (a Qt C++ method), not the NodeData object.
8-
9-
**Fix**: Added a `@property data` to `NodeItem` that returns `self.node_data`. This transparently
10-
makes all existing `node.data.X` calls work correctly throughout the entire codebase (~50+ call sites).
11-
12-
### 2. Generate Code Button — Now Fully Functional
13-
- AI worker is properly connected via `clicked.connect(self.generate)`
14-
- Full generation pipeline runs and produces output
15-
- Graph state is fully consistent after merge
16-
17-
### 3. AI Node Generation — Complete Graph Linking
18-
**Before**: Only mobjects were added; animations and connection wires were missing.
19-
20-
**Fixed `parse_ai_code`**:
21-
- Parses `var = ClassName(...)` assignments
22-
- Parses ALL `self.play(AnimClass(target, ...))` inline animation calls in order
23-
- Parses `self.play(target.animate.method(...))` chains
24-
- Uses `_balanced_paren_end()` to handle nested parentheses correctly
25-
26-
**Fixed `merge_ai_code_to_scene`**:
27-
- Creates mobject nodes (column 0) with auto-layout positions
28-
- Creates animation nodes (column 1+) per play_sequence entry in correct order
29-
- Creates WireItem connections: mobject → animation
30-
- Chains animation nodes sequentially with connection wires
31-
- Shows clear QMessageBox error on failure (no silent failures)
32-
33-
### 4. Application Icon — Fixed
34-
- `QApplication.setWindowIcon()` is now called at startup, BEFORE any window is created
35-
- Guaranteed to show correctly at launch
36-
37-
### 5. Runtime Font Warnings Eliminated
38-
- Replaced `QFont("Geist", ...)` in `NodeItem.paint()` with `QFont("Segoe UI", ...)` (always available on Windows)
39-
- FontManager.create_font() already clamps sizes to `max(8, min(size, 24))`
40-
41-
### 6. Keybindings Panel — Human-Readable Display
42-
**Before**: `StandardKey.Delete`, `QKeySequence(<PySide6.QtCore.QKeyCombination...>)`
43-
**After**: `Del`, `Ctrl+Z`, `Ctrl+Y`, `Ctrl+S`, etc. using `QKeySequence.toString(PortableText)`
44-
45-
### 7. Preview Feature — Production Ready
46-
- Removed "experimental" and "may crash" warning labels
47-
- `ENABLE_PREVIEW` now defaults to **`True`** (was `False`)
48-
- All `SETTINGS.get("ENABLE_PREVIEW", False)` replaced with `True` default
49-
50-
## 🚀 New Power Features
51-
52-
### 🎨 Manim Class Browser (new "Classes" tab)
53-
- Searchable palette of 60+ Manim classes organized by category
54-
- Double-click any class to instantly add it as a node
55-
- Categories: Geometry, Text, Graphs & Plots, 3D, Animations (In/Out), Transforms, Emphasis
56-
57-
### 📚 Code Snippet Library (new "Snippets" tab)
58-
7 ready-to-use templates:
59-
- FadeIn + FadeOut, Transform Shape, Animated Text, Geometry Showcase
60-
- Number Line, Emphasis & Highlight, Axes & Plot
61-
- Double-click any snippet → loads directly into AI panel for immediate merge
62-
63-
### 🔍 Node Search / Filter Bar
64-
- Type to filter nodes on canvas by name or class
65-
- Non-matching nodes dim to 25% opacity
66-
- Clear button to reset
67-
68-
### ⚡ Quick Export Bar
69-
- **📄 .py** — Export current code as Python file
70-
- **📋 Copy** — Copy code to clipboard (Ctrl+Shift+C)
71-
- **🎬 Render MP4** — Jump to render tab and trigger render
72-
73-
### 🗂 Auto-Layout Nodes (Ctrl+L)
74-
- One-click clean arrangement of all nodes in left-to-right flow
75-
- Mobjects in column 0, animations in column 1
76-
- Automatic wire update after layout
77-
78-
### 🌐 Tools Menu
79-
- Open Manim Documentation (manim.community)
80-
- Open Manim Gallery / Examples
81-
- Export Code (.py) shortcut (Ctrl+E)
82-
- Copy to Clipboard (Ctrl+Shift+C)
83-
84-
### ℹ️ Enhanced About Dialog
85-
- Full feature list displayed
86-
87-
## Architecture Notes
88-
- `NodeItem.data` property is the single authoritative fix for all attribute errors
89-
- All new features follow the existing patterns (Signal/Slot, Qt widgets)
90-
- Zero breaking changes to existing project file format
1+
# EfficientManim — Changelog
2+
3+
---
4+
5+
## v2.0.1 — Structural Cleanup & Rendering Integrity Update
6+
7+
**Date:** February 28, 2026
8+
9+
This release removes architectural hacks and replaces them with honest, transparent behavior.
10+
11+
---
12+
13+
### Removed: Geist Font System
14+
15+
The Geist custom font has been completely removed.
16+
17+
- All `QFontDatabase` font-loading logic removed
18+
- All Geist font references removed from codebase
19+
- All fallback checks and font utility helpers removed
20+
- `utils.py` cleaned; no font-loading logs remain
21+
- Application uses the system default font cleanly via `QFont()` with point size 10
22+
- No font warnings; no residual references
23+
24+
---
25+
26+
### Removed: Scenes Tab
27+
28+
The **Scenes** tab has been fully removed from the UI.
29+
30+
- `MultiSceneManagerPanel` no longer mounted as a tab
31+
- All signal connections (`scene_switched`, `scene_added`, `scene_deleted`) disconnected from the main window
32+
- Tab entry `"🎬 Scenes"` removed from `QTabWidget`
33+
- No dead imports; no dangling signal handlers in the active UI path
34+
- Application runs cleanly without the Scenes tab
35+
36+
---
37+
38+
### Fixed: Scene Class Renaming — Removed
39+
40+
**Previously**, the graph compiler hardcoded all generated code to use:
41+
42+
```python
43+
class EfficientScene(Scene):
44+
```
45+
46+
This silently renamed every AI-generated or user-defined class to `EfficientScene`, which was a trust violation.
47+
48+
**Now**, the compiler generates a neutral class name:
49+
50+
```python
51+
class GeneratedScene(Scene):
52+
```
53+
54+
And the video renderer uses `detect_scene_class()` to dynamically identify the actual scene class in any code — whether AI-generated or user-written.
55+
56+
**Behavior now:**
57+
58+
- Any class inheriting from `Scene` renders correctly
59+
- AI-generated class names (e.g., `PythagoreanTheorem`, `MyScene`) are **never renamed**
60+
- No injected wrapper classes
61+
- No hidden code mutation before rendering
62+
- Rendering is transparent and deterministic
63+
64+
---
65+
66+
### Fixed: Rendering System
67+
68+
The `VideoRenderWorker` now:
69+
70+
- Accepts `scene_class` as an explicit parameter
71+
- Passes the detected class name directly to the Manim CLI
72+
- Never assumes `EfficientScene` or any fixed name
73+
74+
The `detect_scene_class(code)` function scans for `class X(Scene):` patterns and returns the actual class name, falling back to `"Scene"` only if none is found.
75+
76+
---
77+
78+
### Fixed: SettingsDialog
79+
80+
- Removed broken `self.theme.currentText()` reference (widget was never created)
81+
- Settings dialog now saves cleanly without attempting theme switching
82+
- Light-mode-only mode confirmed stable
83+
84+
---
85+
86+
### Fixed: Theme System
87+
88+
- Removed undefined `ThemeMode` type annotation from `_on_theme_changed()`
89+
- Theme change handler signature cleaned up to be safe and forward-compatible
90+
91+
---
92+
93+
### Code Snippet Templates
94+
95+
All built-in snippet templates updated:
96+
97+
- `class EfficientScene(Scene)``class MyScene(Scene)` in all SnippetLibrary entries
98+
- Templates are now neutral and don't impose a naming convention on users
99+
100+
---
101+
102+
## v2.0.1 — Major Feature Release
103+
104+
Initial production release including:
105+
106+
- Node graph canvas with visual wiring
107+
- AI code generation via Google Gemini
108+
- Live Mobject preview rendering
109+
- Video export to MP4/WebM
110+
- Manim class browser
111+
- Code snippet library
112+
- GitHub snippet loader
113+
- LaTeX live preview
114+
- AI voiceover (TTS) with node sync
115+
- VGroup creation and code generation
116+
- Usage tracking and Recents pane
117+
- Custom keybindings
118+
- Light mode design system

0 commit comments

Comments
 (0)