From b8772b301e3e752d9afaf8f92ab07cf7b8399f1f Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 16:45:03 -0500 Subject: [PATCH 01/15] feat: Update Flutter version handling in CI and adjust pubspec files for compatibility --- .github/workflows/mobile-ci.yml | 2 +- apps/mobile/pubspec.lock | 2 +- apps/mobile/pubspec.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 5f18d948..4afa04a4 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -74,7 +74,7 @@ jobs: - name: 🦋 Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.19.x' + flutter-version-file: pubspec.yaml channel: 'stable' cache: true diff --git a/apps/mobile/pubspec.lock b/apps/mobile/pubspec.lock index d9afe13f..9aa8910e 100644 --- a/apps/mobile/pubspec.lock +++ b/apps/mobile/pubspec.lock @@ -1530,4 +1530,4 @@ packages: version: "2.2.3" sdks: dart: ">=3.10.3 <4.0.0" - flutter: ">=3.38.4" + flutter: ">=3.38.4 <4.0.0" diff --git a/apps/mobile/pubspec.yaml b/apps/mobile/pubspec.yaml index 6ffcd99f..bca32555 100644 --- a/apps/mobile/pubspec.yaml +++ b/apps/mobile/pubspec.yaml @@ -3,6 +3,7 @@ publish_to: 'none' description: "A sample project using melos and modular scaffold." environment: sdk: '>=3.10.0 <4.0.0' + flutter: '>=3.38.0 <4.0.0' workspace: - packages/design_system - packages/core From 410e5b5cd16f4014548e59a4893fe2ce89152369 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 16:47:25 -0500 Subject: [PATCH 02/15] feat: Update Flutter version file path in mobile CI workflow --- .github/workflows/mobile-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 4afa04a4..cacf7844 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -74,7 +74,7 @@ jobs: - name: 🦋 Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version-file: pubspec.yaml + flutter-version-file: 'apps/mobile/pubspec.yaml' channel: 'stable' cache: true @@ -120,7 +120,7 @@ jobs: - name: 🦋 Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.19.x' + flutter-version-file: 'apps/mobile/pubspec.yaml' channel: 'stable' cache: true From b6c3fb8487082b05c2193b5754ec41273d15f2c9 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 16:49:23 -0500 Subject: [PATCH 03/15] feat: Update Flutter version to 3.38.x in mobile CI workflow --- .github/workflows/mobile-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index cacf7844..54f3f3ee 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -74,7 +74,7 @@ jobs: - name: 🦋 Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version-file: 'apps/mobile/pubspec.yaml' + flutter-version: '3.38.x' channel: 'stable' cache: true @@ -120,7 +120,7 @@ jobs: - name: 🦋 Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version-file: 'apps/mobile/pubspec.yaml' + flutter-version: '3.38.x' channel: 'stable' cache: true From 1dd36993738c5bc8c3816f75bb6e06a60123ab8d Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 17:05:56 -0500 Subject: [PATCH 04/15] feat: Update mobile CI workflow to use melos for build and analysis --- .github/workflows/mobile-ci.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 54f3f3ee..70219ce4 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -87,17 +87,31 @@ jobs: run: | cd apps/mobile echo "⚙️ Running build_runner..." - flutter pub run build_runner build --delete-conflicting-outputs 2>&1 || true + melos run gen:build 2>&1 || true echo "" - echo "🔬 Running flutter analyze on all files..." - flutter analyze lib/ --no-fatal-infos 2>&1 | tee analyze_output.txt || true + echo "🔬 Running flutter analyze on all packages..." + # Analyze all packages in the workspace + for dir in packages/*/; do + if [ -d "$dir/lib" ]; then + echo "Analyzing: $dir" + flutter analyze "$dir/lib" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true + fi + done + + # Also analyze apps + for app_dir in apps/*/lib; do + if [ -d "$app_dir" ]; then + echo "Analyzing: $app_dir" + flutter analyze "$app_dir" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true + fi + done echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" # Check for actual errors (not just warnings) - if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null; then + if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null 2>&1; then echo "❌ COMPILATION ERRORS FOUND:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" grep -B 2 -A 1 -E "^\s*(error|SEVERE):" analyze_output.txt | sed 's/^/ /' @@ -145,6 +159,9 @@ jobs: echo "$CHANGED_FILES" echo "" + # Ensure flutter pub get in workspace + melos bootstrap --no-git-tag-version + # Run dart analyze on each changed file HAS_ERRORS=false FAILED_FILES=() @@ -153,7 +170,7 @@ jobs: if [[ -n "$file" && "$file" == *.dart ]]; then echo "📝 Analyzing: $file" - if ! flutter analyze "$file" --no-fatal-infos 2>&1 | tee -a lint_output.txt; then + if ! dart analyze "$file" --no-fatal-infos 2>&1 | tee -a lint_output.txt; then HAS_ERRORS=true FAILED_FILES+=("$file") fi From 1510b69d59b42544e033615f878e1954199acd98 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 17:13:03 -0500 Subject: [PATCH 05/15] feat: Enhance mobile CI workflow to compare all changes in PRs and streamline analysis commands --- .github/workflows/mobile-ci.yml | 40 ++++++--------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 70219ce4..02aafadc 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -29,10 +29,10 @@ jobs: id: detect run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - # For PR, compare with base branch + # For PR, compare all changes against base branch (not just latest commit) + # Using three-dot syntax (...) shows all files changed in the PR branch BASE_REF="${{ github.event.pull_request.base.ref }}" - HEAD_REF="${{ github.event.pull_request.head.ref }}" - CHANGED_FILES=$(git diff --name-only origin/$BASE_REF..origin/$HEAD_REF 2>/dev/null || echo "") + CHANGED_FILES=$(git diff --name-only origin/$BASE_REF...HEAD 2>/dev/null || echo "") else # For push, compare with previous commit if [[ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]]; then @@ -80,32 +80,12 @@ jobs: - name: 📦 Get Flutter dependencies run: | - cd apps/mobile - flutter pub get + make mobile-install - name: 🔨 Run compilation check run: | - cd apps/mobile - echo "⚙️ Running build_runner..." - melos run gen:build 2>&1 || true - - echo "" - echo "🔬 Running flutter analyze on all packages..." - # Analyze all packages in the workspace - for dir in packages/*/; do - if [ -d "$dir/lib" ]; then - echo "Analyzing: $dir" - flutter analyze "$dir/lib" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true - fi - done - - # Also analyze apps - for app_dir in apps/*/lib; do - if [ -d "$app_dir" ]; then - echo "Analyzing: $app_dir" - flutter analyze "$app_dir" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true - fi - done + echo "⚙️ Running mobile analyze..." + make mobile-analyze 2>&1 | tee analyze_output.txt || true echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" @@ -140,13 +120,10 @@ jobs: - name: 📦 Get Flutter dependencies run: | - cd apps/mobile - flutter pub get + make mobile-install - name: 🔍 Lint changed Dart files run: | - cd apps/mobile - # Get the list of changed files CHANGED_FILES="${{ needs.detect-changes.outputs.changed-files }}" @@ -159,9 +136,6 @@ jobs: echo "$CHANGED_FILES" echo "" - # Ensure flutter pub get in workspace - melos bootstrap --no-git-tag-version - # Run dart analyze on each changed file HAS_ERRORS=false FAILED_FILES=() From 49f32b24f410fb60bb03200ff7855e043ac1189d Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:02:37 -0500 Subject: [PATCH 06/15] feat: Update mobile CI workflow to use mobile-install-ci for CI-specific setup --- .github/workflows/mobile-ci.yml | 4 ++-- makefiles/dataconnect.mk | 19 ++++++++++++++++++- makefiles/mobile.mk | 9 ++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 02aafadc..70e41929 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -80,7 +80,7 @@ jobs: - name: 📦 Get Flutter dependencies run: | - make mobile-install + make mobile-install-ci - name: 🔨 Run compilation check run: | @@ -120,7 +120,7 @@ jobs: - name: 📦 Get Flutter dependencies run: | - make mobile-install + make mobile-install-ci - name: 🔍 Lint changed Dart files run: | diff --git a/makefiles/dataconnect.mk b/makefiles/dataconnect.mk index 7285b997..84b04dff 100644 --- a/makefiles/dataconnect.mk +++ b/makefiles/dataconnect.mk @@ -19,7 +19,7 @@ else $(error Invalid DC_ENV '$(DC_ENV)'. Use DC_ENV=dev or DC_ENV=validation) endif -.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test +.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-generate-sdk-ci dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test #creation dataconnect file dataconnect-file: @@ -79,6 +79,23 @@ dataconnect-generate-sdk: dataconnect-file @firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS) @echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]." +# CI-safe SDK generation: tries Firebase CLI if available, otherwise uses pre-generated SDK +dataconnect-generate-sdk-ci: dataconnect-file + @echo "--> Generating Firebase Data Connect SDK for CI [$(DC_SERVICE)]..." + @if command -v firebase >/dev/null 2>&1; then \ + echo " Firebase CLI found, generating SDK..."; \ + firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS); \ + echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]."; \ + else \ + echo " Firebase CLI not found in CI environment"; \ + if [ -d "apps/mobile/packages/data_connect/lib/src/dataconnect_generated" ]; then \ + echo " ✅ Using pre-generated SDK from apps/mobile/packages/data_connect/lib/src/dataconnect_generated"; \ + else \ + echo "❌ ERROR: Firebase CLI not available and pre-generated SDK not found!"; \ + exit 1; \ + fi; \ + fi + # Unified backend schema update workflow (schema -> deploy -> SDK) dataconnect-sync: dataconnect-file @echo "--> [1/3] Deploying Data Connect [$(DC_SERVICE)]..." diff --git a/makefiles/mobile.mk b/makefiles/mobile.mk index 43c3d618..dd75f3d7 100644 --- a/makefiles/mobile.mk +++ b/makefiles/mobile.mk @@ -1,6 +1,6 @@ # --- Mobile App Development --- -.PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart +.PHONY: mobile-install mobile-install-ci mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart MOBILE_DIR := apps/mobile @@ -15,6 +15,13 @@ mobile-install: install-melos dataconnect-generate-sdk @echo "--> Generating localization files..." @cd $(MOBILE_DIR) && melos run gen:l10n +mobile-install-ci: install-melos dataconnect-generate-sdk-ci + @echo "--> Bootstrapping mobile workspace for CI (Melos)..." + @cd $(MOBILE_DIR) && melos bootstrap + @echo "--> Generating localization files..." + @cd $(MOBILE_DIR) && melos run gen:l10n + @echo "✅ CI mobile setup complete" + mobile-info: @echo "--> Fetching mobile command info..." @cd $(MOBILE_DIR) && melos run info From 0fad902991990874772e8958a12171c2b7dd667c Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:10:38 -0500 Subject: [PATCH 07/15] feat: Install Firebase CLI in CI workflow and simplify SDK generation process --- .github/workflows/mobile-ci.yml | 8 ++++++++ makefiles/dataconnect.mk | 18 ++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 70e41929..a4532cb0 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -78,6 +78,10 @@ jobs: channel: 'stable' cache: true + - name: 🔧 Install Firebase CLI + run: | + npm install -g firebase-tools + - name: 📦 Get Flutter dependencies run: | make mobile-install-ci @@ -118,6 +122,10 @@ jobs: channel: 'stable' cache: true + - name: 🔧 Install Firebase CLI + run: | + npm install -g firebase-tools + - name: 📦 Get Flutter dependencies run: | make mobile-install-ci diff --git a/makefiles/dataconnect.mk b/makefiles/dataconnect.mk index 84b04dff..acd5b428 100644 --- a/makefiles/dataconnect.mk +++ b/makefiles/dataconnect.mk @@ -79,22 +79,8 @@ dataconnect-generate-sdk: dataconnect-file @firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS) @echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]." -# CI-safe SDK generation: tries Firebase CLI if available, otherwise uses pre-generated SDK -dataconnect-generate-sdk-ci: dataconnect-file - @echo "--> Generating Firebase Data Connect SDK for CI [$(DC_SERVICE)]..." - @if command -v firebase >/dev/null 2>&1; then \ - echo " Firebase CLI found, generating SDK..."; \ - firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS); \ - echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]."; \ - else \ - echo " Firebase CLI not found in CI environment"; \ - if [ -d "apps/mobile/packages/data_connect/lib/src/dataconnect_generated" ]; then \ - echo " ✅ Using pre-generated SDK from apps/mobile/packages/data_connect/lib/src/dataconnect_generated"; \ - else \ - echo "❌ ERROR: Firebase CLI not available and pre-generated SDK not found!"; \ - exit 1; \ - fi; \ - fi +# CI version: same as regular since Firebase CLI is now installed in CI +dataconnect-generate-sdk-ci: dataconnect-generate-sdk # Unified backend schema update workflow (schema -> deploy -> SDK) dataconnect-sync: dataconnect-file From 767b10e3377f7a01266e84e86df52b729913049e Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:14:18 -0500 Subject: [PATCH 08/15] fix: Remove trailing commas in reports_page.dart for consistency --- .../reports/lib/src/presentation/pages/reports_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart b/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart index fbc60def..ac0fc734 100644 --- a/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart +++ b/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart @@ -133,9 +133,9 @@ class _ReportsPageState extends State // Tabs Container( height: 44, - padding: const EdgeInsets.all(4), + padding: const EdgeInsets.all(4) decoration: BoxDecoration( - color: UiColors.white.withOpacity(0.2), + color: UiColors.white.withOpacity(0.2) borderRadius: BorderRadius.circular(12), ), child: TabBar( From 614851274b624b304e43a562b5a9dd0ba20802d9 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:26:13 -0500 Subject: [PATCH 09/15] feat: Update mobile CI workflow to streamline build process and remove CI-specific setup --- .github/workflows/mobile-ci.yml | 32 +++++++++++++++++++++++--------- makefiles/dataconnect.mk | 5 +---- makefiles/mobile.mk | 9 +-------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index a4532cb0..4d53bdd5 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -84,25 +84,39 @@ jobs: - name: 📦 Get Flutter dependencies run: | - make mobile-install-ci + make mobile-install - name: 🔨 Run compilation check run: | - echo "⚙️ Running mobile analyze..." - make mobile-analyze 2>&1 | tee analyze_output.txt || true + echo "🏗️ Building client app for Android (dev mode)..." + make mobile-client-build PLATFORM=apk MODE=dev 2>&1 | tee client_build.txt || true echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - # Check for actual errors (not just warnings) - if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null 2>&1; then - echo "❌ COMPILATION ERRORS FOUND:" + echo "🏗️ Building staff app for Android (dev mode)..." + make mobile-staff-build PLATFORM=apk MODE=dev 2>&1 | tee staff_build.txt || true + + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + + # Check for actual errors in both builds + if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1 || \ + grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then + echo "❌ BUILD ERRORS FOUND:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - grep -B 2 -A 1 -E "^\s*(error|SEVERE):" analyze_output.txt | sed 's/^/ /' + if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1; then + echo " CLIENT BUILD:" + grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" client_build.txt | sed 's/^/ /' + fi + if grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then + echo " STAFF BUILD:" + grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt | sed 's/^/ /' + fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" exit 1 else - echo "✅ Compilation check PASSED - No errors found" + echo "✅ Build check PASSED - Both apps built successfully" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" fi @@ -128,7 +142,7 @@ jobs: - name: 📦 Get Flutter dependencies run: | - make mobile-install-ci + make mobile-install - name: 🔍 Lint changed Dart files run: | diff --git a/makefiles/dataconnect.mk b/makefiles/dataconnect.mk index acd5b428..7285b997 100644 --- a/makefiles/dataconnect.mk +++ b/makefiles/dataconnect.mk @@ -19,7 +19,7 @@ else $(error Invalid DC_ENV '$(DC_ENV)'. Use DC_ENV=dev or DC_ENV=validation) endif -.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-generate-sdk-ci dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test +.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test #creation dataconnect file dataconnect-file: @@ -79,9 +79,6 @@ dataconnect-generate-sdk: dataconnect-file @firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS) @echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]." -# CI version: same as regular since Firebase CLI is now installed in CI -dataconnect-generate-sdk-ci: dataconnect-generate-sdk - # Unified backend schema update workflow (schema -> deploy -> SDK) dataconnect-sync: dataconnect-file @echo "--> [1/3] Deploying Data Connect [$(DC_SERVICE)]..." diff --git a/makefiles/mobile.mk b/makefiles/mobile.mk index dd75f3d7..43c3d618 100644 --- a/makefiles/mobile.mk +++ b/makefiles/mobile.mk @@ -1,6 +1,6 @@ # --- Mobile App Development --- -.PHONY: mobile-install mobile-install-ci mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart +.PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart MOBILE_DIR := apps/mobile @@ -15,13 +15,6 @@ mobile-install: install-melos dataconnect-generate-sdk @echo "--> Generating localization files..." @cd $(MOBILE_DIR) && melos run gen:l10n -mobile-install-ci: install-melos dataconnect-generate-sdk-ci - @echo "--> Bootstrapping mobile workspace for CI (Melos)..." - @cd $(MOBILE_DIR) && melos bootstrap - @echo "--> Generating localization files..." - @cd $(MOBILE_DIR) && melos run gen:l10n - @echo "✅ CI mobile setup complete" - mobile-info: @echo "--> Fetching mobile command info..." @cd $(MOBILE_DIR) && melos run info From 2162b5493ed8b5a658d326623a97a53b93269899 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:33:15 -0500 Subject: [PATCH 10/15] fix: Change build mode from 'dev' to 'debug' for mobile client and staff apps --- .github/workflows/mobile-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 4d53bdd5..3230c8c6 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -89,13 +89,13 @@ jobs: - name: 🔨 Run compilation check run: | echo "🏗️ Building client app for Android (dev mode)..." - make mobile-client-build PLATFORM=apk MODE=dev 2>&1 | tee client_build.txt || true + make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt || true echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🏗️ Building staff app for Android (dev mode)..." - make mobile-staff-build PLATFORM=apk MODE=dev 2>&1 | tee staff_build.txt || true + make mobile-staff-build PLATFORM=apk MODE=debug 2>&1 | tee staff_build.txt || true echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" From 518991f8959c0d97216770864f8e607882bd9bda Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:43:03 -0500 Subject: [PATCH 11/15] fix: Improve error handling in mobile app build process --- .github/workflows/mobile-ci.yml | 38 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 3230c8c6..c0d99701 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -89,36 +89,30 @@ jobs: - name: 🔨 Run compilation check run: | echo "🏗️ Building client app for Android (dev mode)..." - make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt || true + if ! make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt; then + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "❌ CLIENT APP BUILD FAILED" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + exit 1 + fi echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "🏗️ Building staff app for Android (dev mode)..." - make mobile-staff-build PLATFORM=apk MODE=debug 2>&1 | tee staff_build.txt || true + if ! make mobile-staff-build PLATFORM=apk MODE=debug 2>&1 | tee staff_build.txt; then + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "❌ STAFF APP BUILD FAILED" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + exit 1 + fi echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - - # Check for actual errors in both builds - if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1 || \ - grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then - echo "❌ BUILD ERRORS FOUND:" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1; then - echo " CLIENT BUILD:" - grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" client_build.txt | sed 's/^/ /' - fi - if grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then - echo " STAFF BUILD:" - grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt | sed 's/^/ /' - fi - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - exit 1 - else - echo "✅ Build check PASSED - Both apps built successfully" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - fi + echo "✅ Build check PASSED - Both apps built successfully" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" lint: name: 🧹 Lint Changed Files From 50309bfb39e1b8fe15f3465b995a85cba2a34413 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:47:47 -0500 Subject: [PATCH 12/15] fix: Add pipefail option to compilation check for better error handling --- .github/workflows/mobile-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index c0d99701..46944d74 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -88,6 +88,8 @@ jobs: - name: 🔨 Run compilation check run: | + set -o pipefail + echo "🏗️ Building client app for Android (dev mode)..." if ! make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt; then echo "" From c3f8a4768a6af75f3337b88fac64eb4210c89740 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 01:55:16 -0500 Subject: [PATCH 13/15] fix: Update mobile CI workflow for improved error handling and efficiency --- .github/workflows/mobile-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 46944d74..381c76a1 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -89,7 +89,7 @@ jobs: - name: 🔨 Run compilation check run: | set -o pipefail - + echo "🏗️ Building client app for Android (dev mode)..." if ! make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt; then echo "" @@ -162,7 +162,7 @@ jobs: if [[ -n "$file" && "$file" == *.dart ]]; then echo "📝 Analyzing: $file" - if ! dart analyze "$file" --no-fatal-infos 2>&1 | tee -a lint_output.txt; then + if ! dart analyze "$file" 2>&1 | tee -a lint_output.txt; then HAS_ERRORS=true FAILED_FILES+=("$file") fi From af78b38ea2aff26adbb6b075092972bc97569556 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 02:01:29 -0500 Subject: [PATCH 14/15] fix: Add pipefail option to lint step for improved error handling --- .github/workflows/mobile-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 381c76a1..4a6e43ee 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -142,6 +142,8 @@ jobs: - name: 🔍 Lint changed Dart files run: | + set -o pipefail + # Get the list of changed files CHANGED_FILES="${{ needs.detect-changes.outputs.changed-files }}" From c261b340a17656383c4bafa611c4a2e48da0342b Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 20 Feb 2026 02:09:54 -0500 Subject: [PATCH 15/15] refactor: Replace header implementation with ReportsHeader widget for cleaner code --- .../src/presentation/pages/reports_page.dart | 86 +------------------ 1 file changed, 4 insertions(+), 82 deletions(-) diff --git a/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart b/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart index 6c1e73be..823d163b 100644 --- a/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart +++ b/apps/mobile/packages/features/client/reports/lib/src/presentation/pages/reports_page.dart @@ -86,88 +86,10 @@ class _ReportsPageState extends State body: SingleChildScrollView( child: Column( children: [ - // Header - Container( - padding: const EdgeInsets.only( - top: 60, - left: 20, - right: 20, - bottom: 32, - ), - decoration: const BoxDecoration( - gradient: LinearGradient( - colors: [ - UiColors.primary, - UiColors.buttonPrimaryHover, - ], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - ), - child: Column( - children: [ - Row( - children: [ - GestureDetector( - onTap: () => Modular.to.toClientHome(), - child: Container( - width: 40, - height: 40, - decoration: BoxDecoration( - color: UiColors.white.withOpacity(0.2), - shape: BoxShape.circle, - ), - child: const Icon( - UiIcons.arrowLeft, - color: UiColors.white, - size: 20, - ), - ), - ), - const SizedBox(width: 12), - Text( - context.t.client_reports.title, - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: UiColors.white, - ), - ), - ], - ), - const SizedBox(height: 24), - // Tabs - Container( - height: 44, - padding: const EdgeInsets.all(4) - decoration: BoxDecoration( - color: UiColors.white.withOpacity(0.2) - borderRadius: BorderRadius.circular(12), - ), - child: TabBar( - controller: _tabController, - indicator: BoxDecoration( - color: UiColors.white, - borderRadius: BorderRadius.circular(8), - ), - labelColor: UiColors.primary, - unselectedLabelColor: UiColors.white, - labelStyle: const TextStyle( - fontWeight: FontWeight.w600, - fontSize: 14, - ), - indicatorSize: TabBarIndicatorSize.tab, - dividerColor: Colors.transparent, - tabs: [ - Tab(text: context.t.client_reports.tabs.today), - Tab(text: context.t.client_reports.tabs.week), - Tab(text: context.t.client_reports.tabs.month), - Tab(text: context.t.client_reports.tabs.quarter), - ], - ), - ), - ], - ), + // Header with title and tabs + ReportsHeader( + tabController: _tabController, + onTabChanged: _loadSummary, ), // Content