diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index abdfdbc..d357fb4 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -33,10 +33,23 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Setup Git Bash (for Flutter internal scripts) + shell: pwsh + run: | + # Add Git Bash to PATH for Flutter internal scripts that might need it + $gitPath = "${env:ProgramFiles}\Git\bin" + if (Test-Path $gitPath) { + $env:PATH = "$gitPath;$env:PATH" + echo "PATH=$env:PATH" >> $env:GITHUB_ENV + Write-Host "Added Git Bash to PATH: $gitPath" + } else { + Write-Host "Git Bash not found at expected location" + } + - name: Setup Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.22.3' + flutter-version: '3.27.1' channel: 'stable' cache: true @@ -44,6 +57,10 @@ jobs: shell: pwsh run: flutter config --enable-windows-desktop + - name: Verify Flutter setup + shell: pwsh + run: flutter doctor -v + - name: Create production .env file working-directory: flutter_app shell: pwsh @@ -59,10 +76,6 @@ jobs: shell: pwsh run: flutter pub get - - name: Flutter doctor - shell: pwsh - run: flutter doctor -v - - name: Setup Certificate for Signing working-directory: flutter_app shell: pwsh @@ -101,16 +114,33 @@ jobs: # Run our custom build script .\build_windows.ps1 -Release - # Rename the archive to include version + # The build script creates: build\rmtPocketWatcher-Windows-v{version}-release.zip + # Rename to simpler format for release $version = "${{ needs.get-version.outputs.version }}" - if (Test-Path "build\rmtPocketWatcher-Windows-Standalone.zip") { - Rename-Item "build\rmtPocketWatcher-Windows-Standalone.zip" "rmtPocketWatcher-Windows-v$version.zip" + + # Find the generated zip and rename it + $sourceZip = "build\rmtPocketWatcher-Windows-v$version-release.zip" + if (Test-Path $sourceZip) { + Move-Item $sourceZip "rmtPocketWatcher-Windows-v$version.zip" -Force + Write-Host "Created rmtPocketWatcher-Windows-v$version.zip" + } else { + # Fallback: find any matching zip + $zipFiles = Get-ChildItem -Path "build" -Filter "rmtPocketWatcher-Windows-*.zip" -ErrorAction SilentlyContinue + if ($zipFiles) { + Move-Item $zipFiles[0].FullName "rmtPocketWatcher-Windows-v$version.zip" -Force + Write-Host "Created rmtPocketWatcher-Windows-v$version.zip from $($zipFiles[0].Name)" + } } - # Also create a simple executable-only archive + # Create portable (single exe) archive if (Test-Path "build\windows\standalone\rmtpocketwatcher.exe") { - Compress-Archive -Path "build\windows\standalone\rmtpocketwatcher.exe" -DestinationPath "rmtPocketWatcher-Windows-Portable-v$version.zip" -CompressionLevel Optimal + Compress-Archive -Path "build\windows\standalone\rmtpocketwatcher.exe" -DestinationPath "rmtPocketWatcher-Windows-Portable-v$version.zip" -CompressionLevel Optimal -Force + Write-Host "Created rmtPocketWatcher-Windows-Portable-v$version.zip" } + + # List created artifacts + Write-Host "Artifacts created:" + Get-ChildItem -Filter "*.zip" | ForEach-Object { Write-Host " - $($_.Name)" } - name: Upload Windows artifacts uses: actions/upload-artifact@v4 @@ -138,16 +168,20 @@ jobs: - name: Setup Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.22.3' + flutter-version: '3.27.1' channel: 'stable' cache: true - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Accept Android licenses shell: bash - run: | - # Install Android SDK using Flutter's built-in tools - flutter doctor --android-licenses || echo "Licenses handled" - flutter doctor -v + run: yes | sdkmanager --licenses || true + + - name: Verify Flutter setup + shell: bash + run: flutter doctor -v - name: Create production .env file working-directory: flutter_app diff --git a/flutter_app/lib/widgets/price_chart.dart b/flutter_app/lib/widgets/price_chart.dart index 637d385..8822b57 100644 --- a/flutter_app/lib/widgets/price_chart.dart +++ b/flutter_app/lib/widgets/price_chart.dart @@ -318,8 +318,12 @@ class _PriceChartState extends State { _yAxisMax = _baseYAxisMax; } + // Calculate 65% of viewport height for the chart + final screenHeight = MediaQuery.of(context).size.height; + final chartHeight = screenHeight * 0.65; + return Container( - height: 250, // Reduced from 300 for more compact layout + height: chartHeight, decoration: BoxDecoration( color: const Color(0xFF0A0E27), borderRadius: BorderRadius.circular(4), @@ -333,23 +337,28 @@ class _PriceChartState extends State { _yAxisMax = _baseYAxisMax; }); }, - child: Listener( - onPointerSignal: (pointerSignal) { - if (pointerSignal is PointerScrollEvent) { - setState(() { - // Scroll up = zoom in (decrease Y max), scroll down = zoom out (increase Y max) - final delta = pointerSignal.scrollDelta.dy; - final zoomFactor = delta > 0 ? 1.1 : 0.9; // Zoom sensitivity - - _yAxisMax *= zoomFactor; - - // Clamp Y-axis max to reasonable bounds - final minY = maxPrice * 0.1; // Don't zoom in too much - final maxY = maxPrice * 10; // Don't zoom out too much - _yAxisMax = _yAxisMax.clamp(minY, maxY); - }); - } + child: NotificationListener( + onNotification: (ScrollNotification notification) { + // Consume scroll notifications to prevent them from bubbling up + return true; }, + child: Listener( + onPointerSignal: (pointerSignal) { + if (pointerSignal is PointerScrollEvent) { + setState(() { + // Scroll up = zoom in (decrease Y max), scroll down = zoom out (increase Y max) + final delta = pointerSignal.scrollDelta.dy; + final zoomFactor = delta > 0 ? 1.1 : 0.9; // Zoom sensitivity + + _yAxisMax *= zoomFactor; + + // Clamp Y-axis max to reasonable bounds + final minY = maxPrice * 0.1; // Don't zoom in too much + final maxY = maxPrice * 10; // Don't zoom out too much + _yAxisMax = _yAxisMax.clamp(minY, maxY); + }); + } + }, child: LineChart( LineChartData( backgroundColor: const Color(0xFF0A0E27), @@ -491,6 +500,7 @@ class _PriceChartState extends State { handleBuiltInTouches: true, ), ), + ), ), ), ),