From 901f994adf9d0b760a798b43973000328e123be7 Mon Sep 17 00:00:00 2001 From: Jeff H Date: Sun, 21 Dec 2025 16:28:17 -0500 Subject: [PATCH 1/3] Squashed commit of the following: commit 5b532fcf1729e6f20a74b45abd750669a7b7e514 Merge: 31f958a ed0e36c Author: Jeff H Date: Sun Dec 21 16:21:49 2025 -0500 Merge branch 'develop-merge-resolve' into develop commit ed0e36c71ea43c71c1bd08e3905e94685ab2ff56 Author: Jeff H Date: Sun Dec 21 15:33:13 2025 -0500 attempts to move more logic to CSC.Maui assembly commit 9faad49e135df75c7acf7a56234b4ab73ba16a0d Author: Jeff H Date: Sat Dec 20 20:57:42 2025 -0500 Merge remote-tracking branch 'origin/develop' commit 31f958ae908b00f6a915fc9641b390b741af0468 Author: Jeff Holcombe Date: Sat Dec 20 20:49:46 2025 -0500 Carousel v3 (#39) * init refactor for underlying infrastructure of carousel from SBC to Maui. Views WIP. no build * reference clean-up * attempts at continued integration and clean-up * loading but no data * working gallery. performance? * refactor out to assembly * clean-up attempt * working gallery * style clean-up * warning clean-up * Some attempt at a test project. documentation. nuget reference * test fix * nuget setup * limit fix * remove local nuget commit 3db488c7093f0fa9056a20efae55a741a660d3fd Author: Jeff Holcombe Date: Mon Dec 15 13:28:20 2025 -0500 Update README.md commit fcd1983d40076ebea1d2792ca698ab4b80fb2a99 Author: Jeff H Date: Mon Dec 15 13:20:55 2025 -0500 toolbar merge fix commit cb3c7e342bb87ebc0875f20ccea33edc2324baa3 Merge: 43504af f3b35b3 Author: Jeff Holcombe Date: Mon Dec 15 11:10:33 2025 -0500 Merge branch 'main' into develop commit 43504af0d57f308b18d0cd5b4ed2bf2a4240d9ca Author: Jeff Holcombe Date: Mon Dec 15 11:08:59 2025 -0500 documentation update. angle jitter bug fix. +brushes (#35) commit 63d467cffb1eb652cc04a75415c0d49ce0f8435a Author: Jeff Holcombe Date: Mon Dec 15 00:52:38 2025 -0500 Cleanup. Localization. Advanced Settings (#32) * trace mode clean-up. * advanced settings modal * syntax. license * light dark mode cleanup setting * test fixes * prefernces refactor from AI slop. theme bg fix. zoom clamps * active tool style fix * remove AI slop * test fixes. clean-up. revert transparency vm logic commit 39ae4a5c9950ff0595cdd1ab591fc64df2bd528b Author: Jeff Holcombe Date: Sat Dec 13 20:25:43 2025 -0500 Zoom. Trace. +Brushes. Duplicate (#29) * syntax cleanup namespace usings * duplicate element. copy paste * +brushes. needs refinement * give it the figner. finally * zoom controls * transparent net10 attempt * cleanup * working transparency * +comments * trace mode vm update. clean-up * Dynamic transparent slider max disabled * test corrections * storage for flag. disable by default * pref save. +tests --- .claude/settings.local.json | 18 + .github/workflows/dotnet-desktop.yml | 37 +- App.xaml | 22 +- CLAUDE.md | 233 ++++++++ ClearCache.bat | 3 + Components/AdvancedSettingsPopup.xaml | 2 +- Components/BrushesFlyoutPanel.xaml | 8 +- Components/DrawingGalleryPopup.xaml | 159 ++++++ Components/DrawingGalleryPopup.xaml.cs | 70 +++ Components/SettingsFlyoutPanel.xaml | 16 +- Components/ShapesFlyoutPanel.xaml | 12 +- Components/ToolbarView.xaml | 11 - Converters/Base64ToImageConverter.cs | 52 ++ Converters/BooleanConverters.cs | 71 +++ Documentation/Carousel.md | 61 ++ Logic/Constants/AppConstants.cs | 93 ++++ Logic/Extensions/PreferencesExtensions.cs | 23 + Logic/Extensions/SkiaSharpExtensions.cs | 49 +- Logic/Messages/DrawingListChangedMessage.cs | 34 ++ Logic/Messages/OpenDrawingMessage.cs | 35 ++ Logic/Messages/ShowGalleryMessage.cs | 28 + Logic/Models/DrawableEllipse.cs | 2 +- Logic/Models/DrawableGroup.cs | 2 +- Logic/Models/DrawableImage.cs | 2 +- Logic/Models/DrawableLine.cs | 2 +- Logic/Models/DrawablePath.cs | 2 +- Logic/Models/DrawableRectangle.cs | 2 +- Logic/Models/DrawableStamps.cs | 2 +- Logic/Models/ExternalModels.cs | 135 +++++ Logic/Models/IDrawableElement.cs | 2 +- Logic/Models/Layer.cs | 2 +- Logic/Models/NavigationModel.cs | 52 +- Logic/Services/DrawingThumbnailService.cs | 354 ++++++++++++ Logic/Services/IDrawingThumbnailService.cs | 33 ++ Logic/Services/IThumbnailCacheFacade.cs | 33 ++ Logic/Services/ThumbnailCacheFacade.cs | 95 ++++ Logic/Utils/DrawingStorageMomento.cs | 519 ++++++++++++++++++ Logic/Utils/PreferencesFacade.cs | 10 +- .../DrawingGalleryPopupViewModel.cs | 353 ++++++++++++ Logic/ViewModels/GalleryViewModel.cs | 140 +++++ Logic/ViewModels/MainViewModel.cs | 198 ++++++- Logic/ViewModels/ToolbarViewModel.cs | 88 +-- LunaDraw.csproj | 17 +- LunaDraw.sln | 19 + MauiProgram.cs | 5 + Pages/MainPage.xaml | 5 + Pages/MainPage.xaml.cs | 274 ++++++--- README.md | 15 +- Resources/Images/icon_more_vert.svg | 1 + Resources/Strings/AppResources.resx | 2 +- Resources/Styles/Colors.xaml | 51 +- Resources/Styles/Styles.xaml | 4 +- nuget.config | 19 + tests/CarouselPerformance/App.xaml | 14 + tests/CarouselPerformance/App.xaml.cs | 16 + tests/CarouselPerformance/AppShell.xaml | 14 + tests/CarouselPerformance/AppShell.xaml.cs | 9 + .../CarouselPerformance.csproj | 64 +++ .../CarouselPerformance.csproj.user | 6 + tests/CarouselPerformance/MainPage.xaml | 63 +++ tests/CarouselPerformance/MainPage.xaml.cs | 9 + tests/CarouselPerformance/MainViewModel.cs | 135 +++++ tests/CarouselPerformance/MauiProgram.cs | 24 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.cs | 10 + .../Platforms/Android/MainApplication.cs | 15 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 9 + .../Platforms/MacCatalyst/Entitlements.plist | 14 + .../Platforms/MacCatalyst/Info.plist | 40 ++ .../Platforms/MacCatalyst/Program.cs | 15 + .../Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.cs | 24 + .../Platforms/Windows/Package.appxmanifest | 46 ++ .../Platforms/Windows/app.manifest | 17 + .../Platforms/iOS/AppDelegate.cs | 9 + .../Platforms/iOS/Info.plist | 32 ++ .../Platforms/iOS/Program.cs | 15 + .../iOS/Resources/PrivacyInfo.xcprivacy | 51 ++ .../Properties/launchSettings.json | 8 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107320 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111208 bytes .../Resources/Images/dotnet_bot.png | Bin 0 -> 92532 bytes .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 44 ++ .../Resources/Styles/Styles.xaml | 434 +++++++++++++++ .../DrawingStorageMomentoTests.cs | 162 ++++++ tests/LunaDraw.Tests/EraserToolTests.cs | 2 +- .../ExternalDrawingISortableTests.cs | 195 +++++++ tests/LunaDraw.Tests/HistoryManagerTests.cs | 2 +- .../IsToolActiveConverterTests.cs | 123 +++-- tests/LunaDraw.Tests/LunaDraw.Tests.csproj | 1 + tests/LunaDraw.Tests/MainViewModelTests.cs | 16 +- .../SelectToolInteractionTests.cs | 2 +- tests/LunaDraw.Tests/SelectToolTests.cs | 2 +- .../ThumbnailCacheFacadeTests.cs | 212 +++++++ tests/LunaDraw.Tests/ToolbarViewModelTests.cs | 110 ++-- 100 files changed, 5079 insertions(+), 417 deletions(-) create mode 100644 .claude/settings.local.json create mode 100644 CLAUDE.md create mode 100644 ClearCache.bat create mode 100644 Components/DrawingGalleryPopup.xaml create mode 100644 Components/DrawingGalleryPopup.xaml.cs create mode 100644 Converters/Base64ToImageConverter.cs create mode 100644 Converters/BooleanConverters.cs create mode 100644 Documentation/Carousel.md create mode 100644 Logic/Constants/AppConstants.cs create mode 100644 Logic/Messages/DrawingListChangedMessage.cs create mode 100644 Logic/Messages/OpenDrawingMessage.cs create mode 100644 Logic/Messages/ShowGalleryMessage.cs create mode 100644 Logic/Models/ExternalModels.cs create mode 100644 Logic/Services/DrawingThumbnailService.cs create mode 100644 Logic/Services/IDrawingThumbnailService.cs create mode 100644 Logic/Services/IThumbnailCacheFacade.cs create mode 100644 Logic/Services/ThumbnailCacheFacade.cs create mode 100644 Logic/Utils/DrawingStorageMomento.cs create mode 100644 Logic/ViewModels/DrawingGalleryPopupViewModel.cs create mode 100644 Logic/ViewModels/GalleryViewModel.cs create mode 100644 Resources/Images/icon_more_vert.svg create mode 100644 nuget.config create mode 100644 tests/CarouselPerformance/App.xaml create mode 100644 tests/CarouselPerformance/App.xaml.cs create mode 100644 tests/CarouselPerformance/AppShell.xaml create mode 100644 tests/CarouselPerformance/AppShell.xaml.cs create mode 100644 tests/CarouselPerformance/CarouselPerformance.csproj create mode 100644 tests/CarouselPerformance/CarouselPerformance.csproj.user create mode 100644 tests/CarouselPerformance/MainPage.xaml create mode 100644 tests/CarouselPerformance/MainPage.xaml.cs create mode 100644 tests/CarouselPerformance/MainViewModel.cs create mode 100644 tests/CarouselPerformance/MauiProgram.cs create mode 100644 tests/CarouselPerformance/Platforms/Android/AndroidManifest.xml create mode 100644 tests/CarouselPerformance/Platforms/Android/MainActivity.cs create mode 100644 tests/CarouselPerformance/Platforms/Android/MainApplication.cs create mode 100644 tests/CarouselPerformance/Platforms/Android/Resources/values/colors.xml create mode 100644 tests/CarouselPerformance/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 tests/CarouselPerformance/Platforms/MacCatalyst/Entitlements.plist create mode 100644 tests/CarouselPerformance/Platforms/MacCatalyst/Info.plist create mode 100644 tests/CarouselPerformance/Platforms/MacCatalyst/Program.cs create mode 100644 tests/CarouselPerformance/Platforms/Windows/App.xaml create mode 100644 tests/CarouselPerformance/Platforms/Windows/App.xaml.cs create mode 100644 tests/CarouselPerformance/Platforms/Windows/Package.appxmanifest create mode 100644 tests/CarouselPerformance/Platforms/Windows/app.manifest create mode 100644 tests/CarouselPerformance/Platforms/iOS/AppDelegate.cs create mode 100644 tests/CarouselPerformance/Platforms/iOS/Info.plist create mode 100644 tests/CarouselPerformance/Platforms/iOS/Program.cs create mode 100644 tests/CarouselPerformance/Platforms/iOS/Resources/PrivacyInfo.xcprivacy create mode 100644 tests/CarouselPerformance/Properties/launchSettings.json create mode 100644 tests/CarouselPerformance/Resources/AppIcon/appicon.svg create mode 100644 tests/CarouselPerformance/Resources/AppIcon/appiconfg.svg create mode 100644 tests/CarouselPerformance/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 tests/CarouselPerformance/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 tests/CarouselPerformance/Resources/Images/dotnet_bot.png create mode 100644 tests/CarouselPerformance/Resources/Raw/AboutAssets.txt create mode 100644 tests/CarouselPerformance/Resources/Splash/splash.svg create mode 100644 tests/CarouselPerformance/Resources/Styles/Colors.xaml create mode 100644 tests/CarouselPerformance/Resources/Styles/Styles.xaml create mode 100644 tests/LunaDraw.Tests/DrawingStorageMomentoTests.cs create mode 100644 tests/LunaDraw.Tests/ExternalDrawingISortableTests.cs create mode 100644 tests/LunaDraw.Tests/ThumbnailCacheFacadeTests.cs diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..b775de0 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,18 @@ +{ + "permissions": { + "allow": [ + "Bash(dotnet build:*)", + "Bash(dotnet test:*)", + "Bash(dotnet clean:*)", + "Bash(Remove-Item -Recurse -Force CodeSoupCafe.Mauiobj,CodeSoupCafe.Mauibin -ErrorAction SilentlyContinue)", + "Bash(Remove-Item -Recurse -Force obj,bin -ErrorAction SilentlyContinue)", + "Bash(dir:*)", + "Bash(dotnet pack:*)", + "Bash(dotnet restore:*)", + "Bash(dotnet sln:*)", + "Bash(findstr:*)", + "Bash(Get-ChildItem -Recurse -Filter \"*carousel*\")", + "Bash(Select-Object FullName)" + ] + } +} diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index fac0a1a..363be4a 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -15,21 +15,32 @@ jobs: runs-on: windows-latest # Or macos-latest for iOS/Mac Catalyst builds steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" - - name: Install MAUI Workloads - run: dotnet workload install maui + - name: Install MAUI Workloads + run: dotnet workload install maui - - name: Restore NuGet packages - run: dotnet restore LunaDraw.csproj + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- - - name: Build MAUI App (Windows) - run: dotnet build LunaDraw.csproj -c Release -f net10.0-windows10.0.19041.0 + - name: Remove Local Source for CI + run: dotnet nuget remove source LocalNuGetPackages --configfile nuget.config - - name: Run Unit Tests - run: dotnet test tests/LunaDraw.Tests/LunaDraw.Tests.csproj + - name: Restore NuGet packages + run: dotnet restore LunaDraw.csproj --configfile nuget.config + + - name: Build MAUI App (Windows) + run: dotnet build LunaDraw.csproj -c Release -f net10.0-windows10.0.19041.0 + + - name: Run Unit Tests + run: dotnet test tests/LunaDraw.Tests/LunaDraw.Tests.csproj diff --git a/App.xaml b/App.xaml index fc81ac9..ae58304 100644 --- a/App.xaml +++ b/App.xaml @@ -4,14 +4,18 @@ xmlns:local="clr-namespace:LunaDraw" xmlns:converters="clr-namespace:LunaDraw.Converters" x:Class="LunaDraw.App"> - - - - - - + + + + + + - - - + + + + + + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..39231a1 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,233 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +LunaDraw is a child-centric drawing application (ages 3-8) built with .NET MAUI targeting Windows, Android, iOS, and MacCatalyst. The app features 24+ magical brush effects, shape tools, stamps, undo/redo, layer management, and "Movie Mode" time-lapse replay. + +**Important Context:** + +- The codebase is heavily AI-generated ("vibe-coded") and can be fragile in places +- Some canvas functionality was migrated from a working app in `\Legacy\SurfaceBurnCalc` +- The app is in active development with missing features tracked in `Documentation/MissingFeatures.md` + +## Build & Development Commands + +### Building + +```bash +# Build the project (Windows target) +dotnet build LunaDraw.csproj -f net10.0-windows10.0.19041.0 + +# Build for specific platform +dotnet build LunaDraw.csproj -f net10.0-android36.0 +dotnet build LunaDraw.csproj -f net10.0-ios26.0 +dotnet build LunaDraw.csproj -f net10.0-maccatalyst26.0 +``` + +### Testing + +```bash +# Run all tests +dotnet test tests/LunaDraw.Tests/LunaDraw.Tests.csproj + +# Run specific test +dotnet test tests/LunaDraw.Tests/LunaDraw.Tests.csproj --filter "FullyQualifiedName~TestMethodName" +``` + +### Running + +- Use Visual Studio 2022 or VS Code with C# Dev Kit and .NET MAUI extensions +- Select target framework (e.g., `net10.0-windows10.0.19041.0`) +- Build and Run through IDE + +## Architecture + +### Core Technologies + +- **.NET MAUI** - Cross-platform UI framework +- **SkiaSharp** - All vector graphics and rendering (primary graphics engine) +- **ReactiveUI** - MVVM framework and state management using observables +- **CommunityToolkit.Maui** - Extended MAUI controls and utilities + +### Architectural Patterns + +#### MVVM with ReactiveUI + +- ViewModels inherit from `ReactiveObject` for property change notifications +- Use `this.RaiseAndSetIfChanged(ref field, value)` for reactive properties +- Leverage reactive subscriptions for messaging and state changes + +#### Messaging & Communication + +- **MessageBus** (ReactiveUI's `IMessageBus`): Use sparingly for loosely-coupled broadcast messages between disconnected components +- **Reactive Observables**: Preferred approach for component communication where possible +- **Command/Event Pattern**: Fallback when reactive approaches don't fit +- MessageBus is instance-based (injected via DI), NOT static for testability + +#### Dependency Injection + +Services registered in `MauiProgram.cs`: + +- **Core State**: `IMessageBus`, `NavigationModel`, `SelectionObserver`, `ILayerFacade` +- **Logic Services**: `ICanvasInputHandler`, `ClipboardMemento`, `IBitmapCache`, `IPreferencesFacade`, `IDrawingStorageMomento` +- **ViewModels**: Singleton or Transient as appropriate +- **Pages**: Typically Transient + +### Key Architectural Components + +#### Drawing Model + +- **IDrawableElement**: Base interface for all drawable objects (paths, shapes, stamps, images) + + - Supports selection, transforms, visibility, layering (ZIndex), opacity, fill/stroke + - Each element has `Bounds`, `TransformMatrix`, and methods: `Draw()`, `HitTest()`, `Clone()`, `Translate()`, `Transform()` + - Concrete implementations: `DrawablePath`, `DrawableEllipse`, `DrawableRectangle`, `DrawableLine`, `DrawableImage`, `DrawableStamps`, `DrawableGroup` + +- **Layer**: Container for drawable elements with ReactiveUI observable collections + + - Uses **QuadTree spatial indexing** (`QuadTreeMemento`) for efficient spatial queries and rendering + - No bitmap tiling - renders directly from vector elements + - Auto-assigns ZIndex to new elements to maintain draw order + - Supports masking modes, visibility, locking + +- **ILayerFacade**: Abstraction for layer management operations + - Manages `ObservableCollection` and current layer state + - Integrates with `HistoryMemento` for undo/redo + - Methods: `AddLayer()`, `RemoveLayer()`, `MoveLayer()`, `MoveElementsToLayer()`, `SaveState()` + +#### Tool System + +- **IDrawingTool**: Interface for all drawing/editing tools +- Tool implementations: `FreehandTool`, `EraserTool`, `EraserBrushTool`, `FillTool`, `SelectTool`, `LineTool`, `RectangleTool`, `EllipseTool`, `ShapeTool` +- Tools receive `ToolContext` with canvas state, navigation, layers, and brush settings +- Input handling delegated to `CanvasInputHandler` which dispatches to active tool + +#### View & Viewport Management + +- **NavigationModel**: Manages pan/zoom transformations via `ViewMatrix` (SKMatrix) +- **CanvasInputHandler**: Central touch/mouse input processor + - Handles multi-touch gestures (pan, zoom, rotate) on canvas and selection + - Delegates single-touch drawing to active tool + - Right-click switches to Select tool + - Applies smoothing to gestures for fluid interaction +- **MainPage**: Primary page hosting `SKCanvasView` for rendering + - Subscribes to `CanvasInvalidateMessage` to trigger redraws + - Manages context menus and flyout panels (brushes, shapes, settings) + +#### State Management & History + +- **HistoryMemento**: Undo/redo stack for layer states +- **ClipboardMemento**: Copy/paste buffer for drawable elements +- **DrawingStorageMomento**: Serialization/deserialization of drawings to file +- **QuadTreeMemento**: Generic spatial partitioning for efficient hit-testing and culling + +## Code Quality & Testing Standards + +### Testing with xUnit, Moq + +- **Test Format**: Arrange-Act-Assert (AAA) + - If no `// Arrange` needed, start with `// Act` +- **Naming**: `Should_When_Returns` format + - Example: `Should_Set_Sliding_Issued_At_Time_When_Valid_Credentials_Expired_Or_Invalid_Returns_Logout` +- **Test Instances**: Use class name for instance, NOT 'sut' or arbitrary names + - Mocks: `mockClassName` (e.g., `mockLayerFacade`) +- **Assertions**: One assertion per line +- **Test Types**: Prefer `[Theory]`, `[InlineData]`, `[MemberData]` over multiple `[Fact]` methods. Include negative test cases + +### Bug Fixing Workflow + +1. **Write test first** to validate the bug exists +2. Implement the fix +3. Run test to confirm bug elimination + +### Code Style Rules (from .clinerules) + +- **NO underscores** in names +- **NO regions** +- **NO abbreviations** in variable names or otherwise (use full descriptive names) +- **NO legacy or duplicate code** - refactor to clean state, remove obsolete code +- **Static extensions**: Use ONLY for reusable logic (see `Logic/Extensions/`) + +### SOLID & Design Principles + +Ensure adherence to: + +- Single Responsibility Principle (SRP) +- Open/Closed Principle (OCP) +- Liskov Substitution Principle (LSP) +- Interface Segregation Principle (ISP) +- Dependency Inversion Principle (DIP) +- DRY (Don't Repeat Yourself) +- Low Coupling / High Cohesion +- Separation of Concerns & Modularity + +## Project Structure + +``` +LunaDraw/ +├── Components/ # Reusable UI components and controls +│ ├── Carousel/ # Gallery carousel implementation +│ ├── *FlyoutPanel.xaml # Brush, shape, settings panels +│ └── *.cs # Custom controls (BrushPreview, ShapePreview, etc.) +├── Converters/ # XAML value converters +├── Documentation/ # Architecture, features, missing features +├── Logic/ # Core business logic (non-UI) +│ ├── Constants/ # App-wide constants +│ ├── Extensions/ # Static extension methods (SkiaSharp, Preferences) +│ ├── Handlers/ # Input handling (CanvasInputHandler) +│ ├── Messages/ # MessageBus message types +│ ├── Models/ # Domain models (IDrawableElement, Layer, ToolContext, etc.) +│ ├── Tools/ # IDrawingTool implementations +│ ├── Utils/ # Utilities (LayerFacade, Mementos, BitmapCache, etc.) +│ └── ViewModels/ # ReactiveUI ViewModels +├── Pages/ # MAUI pages (MainPage) +├── Platforms/ # Platform-specific code +├── Resources/ # Images, fonts, splash, raw assets +├── tests/ # Unit tests +│ └── LunaDraw.Tests/ +└── MauiProgram.cs # DI registration and app configuration +``` + +## Important Technical Notes + +### SkiaSharp Rendering + +- All graphics rendered via SkiaSharp (`SKCanvas`, `SKPaint`, `SKPath`) +- `MainPage.OnCanvasViewPaintSurface`: Main rendering loop + - Applies `NavigationModel.ViewMatrix` for pan/zoom + - Iterates layers, uses QuadTree to cull off-screen elements + - Elements sorted by ZIndex before drawing + +### Brush Effects + +- 24+ brush effects with custom shaders and blending modes +- Examples: Glow/Neon (additive blending, bloom), Star Sparkles, Rainbow, Fireworks, Crayon, Spray, Ribbon +- Brush settings stored in `ToolbarViewModel` and passed via `ToolContext` + +### Movie Mode (Time-Lapse) + +- Records drawing process in background +- Playback animates creation of drawing + +### Child-Friendly UX Requirements + +- Large touch targets (min 2cm x 2cm) +- Multi-sensory feedback (sounds, animations) +- Icon-driven, minimal text +- Visual/audio guidance over explicit instructions + +## Legacy & Migration Notes + +- Canvas functionality migrated from `\Legacy\SurfaceBurnCalc` (previous working app) +- Current branch `reactive-carousel-v2` is refactoring carousel infrastructure from SBC to MAUI +- Code is fragile in places due to AI generation - test thoroughly + +## Additional Resources + +- **README.md**: Project overview, features, screenshots, setup +- **Documentation/ArchitectureDesign.md**: Detailed architecture and design requirements +- **Documentation/Features.md**: Feature specifications +- **Documentation/MissingFeatures.md**: Pending features and known issues +- **.clinerules/**: Coding standards and SPARC methodology guidelines diff --git a/ClearCache.bat b/ClearCache.bat new file mode 100644 index 0000000..254420c --- /dev/null +++ b/ClearCache.bat @@ -0,0 +1,3 @@ +dotnet nuget locals all --clear +dotnet clean +for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d" \ No newline at end of file diff --git a/Components/AdvancedSettingsPopup.xaml b/Components/AdvancedSettingsPopup.xaml index 6765595..9dda415 100644 --- a/Components/AdvancedSettingsPopup.xaml +++ b/Components/AdvancedSettingsPopup.xaml @@ -7,7 +7,7 @@ x:Class="LunaDraw.Components.AdvancedSettingsPopup" x:DataType="viewModels:MainViewModel" CanBeDismissedByTappingOutsideOfPopup="True" - BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray900}}"> + BackgroundColor="{AppThemeBinding Light={StaticResource PopupBackgroundLight}, Dark={StaticResource PopupBackgroundDark}}"> - @@ -20,7 +20,7 @@ HorizontalTextAlignment="Center"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +