-
Notifications
You must be signed in to change notification settings - Fork 3
feat: PrivacyGUI 1.2.8 Migration to UI Kit #616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Phase 1 Migration (Clean additions): 1. PWA Install Banner (DU models only) - Add PWA install service and platform-specific logic - Add device features system for model-based feature detection - Add install prompt banner with iOS/Mac Safari instruction sheets - Add PWA localization strings - Update web resources (manifest.json, service_worker.js, index.html) 2. Brand Asset Provider - Add GlobalModelNumberProvider for persistent model state - Add BrandAssetProvider with asset path resolution - Add brand assets for TB variant (logo, support image) - Add BrandUtils class with manifest-based asset resolution 3. SI Unit Formatting - Update formatBits/formatBitsWithUnit to use base 1000 (SI units) - Update corresponding unit tests 4. SDK Version Update - Bump Dart SDK requirement to >=3.3.0 for extension types support Also includes migration plan documentation in doc/migration/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add HealthCheckServer model for server data - Add getCloseHealthCheckServers JNAP action - Update HealthCheckState with servers and selectedServer fields - Update HealthCheckProvider with loadServers() and setSelectedServer() methods - Update SpeedTestService with getHealthCheckServers() and targetServerId support - Add server selection dialog component (SpeedTestServerSelectionList) - Add server selection button to SpeedTestView - Add selectServer localization string - Update mocks and tests for new service method signatures Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add healthCheckManager2 to JNAPService enum and switch cases - Add isSupportHealthCheckManager2() method to ServiceHelper - Update HealthCheckProvider.loadData() to check support before loading servers - Update tests with mockDependencyRegister() and regenerated mocks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change mock class from `extends Mock implements Provider` to
`extends HealthCheckProvider with Mock` to inherit Riverpod's
internal methods (_setElement) while preserving Mock functionality
- Add isSupportHealthCheckManager2 mock to test_helper.dart
- Update speed_test_view_test.dart to use anyNamed('serverId')
- Update migration tasks document with Phase 1 & 2 completion status
This fixes the localization tests that were failing with:
"Class 'MockHealthCheckProvider' has no instance method '_setElement'"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 3 Changes: - Add getCloseHealthCheckServers to polling_service.dart for server caching - Add 5 new error state golden tests (STV-ERROR-02 ~ STV-ERROR-06) - license, execution, aborted, dbError, timeout errors - Group existing error test (STV-ERROR-01) with new tests - Update migration tasks document with Phase 3 completion status All 3107 functional tests pass. All 80 SpeedTest localization tests pass (55 original + 25 new error tests). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace deprecated RadioListTile with AppRadioList component - Maintain ValueNotifier pattern for temporary dialog state - No functional changes, only UI component update Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update UI Kit dependency to v2.12.3 for showAppBottomSheet support - Refactor iOS and Mac install instruction sheets to use static show() method - Update InstallPromptBanner to use AppSurface with SurfaceVariant.highlight - Change dismiss button to AppIconButton.icon for transparent background - Consolidate modelNumber into SessionState (remove global_model_number_provider) - Add PwaInstallService dependency on SessionProvider.modelNumber - Rewrite install_prompt_banner_test.dart following screenshot test guidelines - Add standalone tests for iOS and Mac instruction sheets - Add manual trigger (workflow_dispatch) to CI for main_snapshot_baseline job - Update test mocks for SessionNotifier with SessionState return type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Review Summary by QodoPrivacyGUI 1.2.8 Migration: PWA Installation, Server Selection, and Device Features
WalkthroughsDescription• **PWA Installation Feature**: Implemented comprehensive PWA install prompt system with platform-specific flows for iOS, Mac Safari, and native Android/Chrome, including dismissal cooldown and reactive state management • **Speed Test Server Selection**: Added server selection UI and backend support with new HealthCheckManager2 service, including server list fetching and selection persistence • **Device Feature Detection System**: Created DeviceFeature enum and isFeatureSupported() function with model number parsing for region and provider-based feature rules • **Reactive Session State Management**: Converted SessionProvider from void-based to reactive SessionState management for better device info tracking and model number access • **Network Speed Formatting**: Updated speed formatting from binary (base 1024) to SI units (base 1000) with corresponding test updates • **Brand Utilities**: Added BrandUtils class with manifest-based asset discovery supporting webp and png formats with priority ordering • **Comprehensive Test Coverage**: Added 30+ new test cases covering PWA banner, speed test errors, device features, and server selection with golden screenshot tests • **Web PWA Logic**: Implemented web-specific PWA logic using JS interop for browser APIs with early event capture in index.html • **PWA Manifest Updates**: Updated manifest with new branding, icon assets, and accessibility improvements • **Migration Documentation**: Added detailed migration task tracking document for dev-1.2.8 to dev-2.0.0 transition • **CI/CD Enhancement**: Enabled manual workflow dispatch for CI pipeline with configurable job selection Diagramflowchart LR
A["Session Provider<br/>Reactive State"] -->|"Device Info"| B["Device Features<br/>Detection System"]
B -->|"Feature Support"| C["PWA Install Service<br/>Platform Detection"]
C -->|"Install Prompt"| D["Install Prompt Banner<br/>iOS/Mac/Native"]
E["Health Check Service<br/>Server Support"] -->|"Server List"| F["Server Selection UI<br/>Radio List"]
F -->|"Selected Server"| G["Health Check Provider<br/>Server Tracking"]
H["Brand Utils<br/>Asset Discovery"] -->|"Brand Assets"| I["Brand Asset Provider<br/>Dynamic Resolution"]
J["Polling Service<br/>HealthCheckManager2"] -->|"Server Updates"| G
D -->|"Integrated"| K["Dashboard Shell<br/>PWA Banner"]
File Changes1. test/page/health_check/views/localizations/speed_test_view_test.dart
|
Code Review by Qodo
✅
📘 Rule violation ⛨ Security |
- Add session state clear on logout to prevent stale device identity - Add empty server ID validation to avoid sending empty strings to router - Use safe type conversions in HealthCheckServer.fromJson for external API data - Mask sensitive data (serial number) in session logs - Translate migration documentation to English Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
This PR migrates PrivacyGUI 1.2.8 features to use the UI Kit library and addresses code review feedback.
Changes
PWA Installation Feature
showAppBottomSheetfrom UI Kit v2.12.3 for instruction sheetsAppSurfacewithSurfaceVariant.highlightfor banner stylingAppIconButton.iconfor transparent dismiss buttonSpeed Test Server Selection
HealthCheckServermodel with safe JSON parsingAppRadioListfrom UI KitHealthCheckManager2JNAP service support checkSession State Management
SessionProviderfromNotifier<void>toNotifier<SessionState>modelNumberintoSessionState(removedglobal_model_number_provider.dart)clear()method called on logout to prevent stale device identityCode Quality Improvements (Qodo Review Fixes)
?.toString(),(as num?)?.toInt()) for external API dataCI/CD Enhancement
workflow_dispatchmanual trigger formain_snapshot_baselinejobTest Coverage
SessionStatereturn typeTesting
flutter analyzereports no issuesFiles Changed
lib/core/pwa/,lib/page/components/pwa/lib/page/health_check/(models, providers, views)lib/core/data/providers/session_provider.dartlib/providers/auth/auth_provider.dart.github/workflows/ci.ymldoc/migration/(English translation)