- gui/panel_editor.odin: Full drawing editor overlay - Editor_Tool enum: Pen, Eraser, Line, Rect, Circle, Fill - Brush_Stroke struct with points array for freehand/shape strokes - Panel_Editor_State with active panel, strokes, undo snapshots, zoom/pan - open/close/commit lifecycle: loads panel texture, composites on commit - Screen-to-canvas coordinate mapping with zoom and pan offsets - Stroke rendering: freehand via line segments, shapes via endpoints - Undo via snapshot replay (cap 30 snapshots) - Toolbar: tool buttons, brush size slider, color picker, commit/cancel - Color picker panel: 18 preset color swatches, current color display - to_cstr helper for Odin string->cstring conversion - gui/runtime.odin: Editor integration - GUI_App_State.editor field (Panel_Editor_State) - Editor update/render calls in main loop when active - Escape key closes editor, Ctrl+Z for undo - editor_close in defer chain for cleanup on exit - btn_panel_draw click handler opens editor on selected panel - gui/workspaces.odin: Draw button on panel cards - 'Draw' button triggers btn_panel_draw action - gui/chrome.odin: Editor hint text when editor active - Shows 'Press Escape to close editor' overlay Build passes. 153/156 tests pass (3 pre-existing CLI/TUI failures, 2 new env-related failures due to FAL_API_KEY in .env). |
||
|---|---|---|
| .github/workflows | ||
| odin | ||
| public | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| app | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tests | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])