Update copilot-instructions.md

This commit is contained in:
Claudio Schaad 2025-11-14 10:12:06 +01:00 committed by GitHub
parent 7664ba62f8
commit 122cad0041
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,75 +1,10 @@
# ShiftScheduler # MemoryGame
ShiftScheduler is a Blazor WebAssembly application for managing work shift schedules with calendar export capabilities. The application allows users to select shifts for each day of the month and export schedules as ICS (calendar) or PDF files. MemoryGame is a Blazor WebAssembly application for people with dementia
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
## Working Effectively Use dotnet version 10
- **CRITICAL**: Install .NET 9.0 SDK first: Always build and run test
- `wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb`
- `sudo dpkg -i packages-microsoft-prod.deb`
- `sudo apt-get update`
- `sudo apt-get remove -y dotnet-host-8.0 dotnet-runtime-8.0 aspnetcore-runtime-8.0 dotnet-sdk-8.0` (removes conflicts)
- `sudo apt-get install -y dotnet-sdk-9.0`
- Verify with `dotnet --version` (should show 9.0.x)
- Bootstrap and build the application:
- `dotnet restore` -- takes 30 seconds. NEVER CANCEL. Set timeout to 60+ minutes.
- `dotnet build` -- takes 15-20 seconds. NEVER CANCEL. Set timeout to 60+ minutes.
- `dotnet clean` -- takes 3 seconds when needed
- Run the application:
- Server: `cd Server && dotnet run` -- takes 15 seconds to start. NEVER CANCEL.
- Access at: `http://localhost:5000`
- Application will be available after Blazor WebAssembly loads (~10 seconds additional)
- No unit tests exist in this project:
- `dotnet test` runs successfully but reports "Build succeeded" with 0 tests
## Validation
- **MANUAL VALIDATION REQUIREMENT**: Always test the full user workflow after making changes:
1. Navigate to `http://localhost:5000`
2. Wait for Blazor WebAssembly to load (look for calendar grid)
3. Click shift buttons (⚫ for "Frei", 🌴 for "Urlaub") to select shifts
4. Verify tooltips appear showing shift names
5. Test export functionality by clicking "Export to ICS" or "Export to PDF"
6. Verify files download correctly
- **API VALIDATION**: Test core endpoints:
- `curl http://localhost:5000/api/shift/shifts` (should return shift configurations)
- PDF export: `curl -X POST http://localhost:5000/api/shift/export_pdf -H "Content-Type: application/json" -d '{"2025-09-01": "Frei"}' --output test.pdf`
- The application has 2 known build warnings that are non-breaking:
- Obsolete QuestPDF Image method warning
- Possible null reference in IcsExportService
- No linting tools are configured. No specific formatting or linting commands to run.
## Validation Scenarios
After making changes, always run through these scenarios:
1. **Calendar Interaction**: Select different shifts for various days and verify visual feedback
2. **Export Functions**: Test both ICS and PDF export with selected shifts
3. **API Responses**: Verify shift data loads correctly via API calls
4. **Application Startup**: Confirm the app starts without errors and loads the UI
## Common Tasks
### Key Configuration Files
- `Server/appsettings.json`: Contains shift definitions with Name, Icon, MorningTime, AfternoonTime
- `Server/Properties/launchSettings.json`: Development server configuration (port 5000)
- All `.csproj` files target .NET 9.0
### Timing Expectations
- **NEVER CANCEL**: All build operations may take time but must complete
- `dotnet restore`: 30 seconds (first time), 1-2 seconds (subsequent)
- `dotnet build`: 15-20 seconds clean build, 5-10 seconds incremental
- `dotnet run` startup: 15 seconds until server ready + 10 seconds for WebAssembly load
- Application response: Immediate once loaded
### Troubleshooting
- If build fails with "does not support targeting .NET 9.0": Install .NET 9.0 SDK as described above
- If application won't start: Check that no other service is using port 5000
- If WebAssembly doesn't load: Wait longer, check browser console for JavaScript errors
- Export issues: Verify shift configurations in appsettings.json have proper time formats for ICS export
## C# Coding Standards ## C# Coding Standards
- Should use params collections (e.g., ```csharp - Should use params collections (e.g., ```csharp