feat: Add server selection dialog for speed test - #623
Conversation
- Add server selection dialog before running speed test when servers are available - Update SpeedTestWidget with showServerSelectionDialog parameter - Add IVER-SERV_DLG and DHOME-SERV_DLG tests for dialog functionality - Add STV-SERVER tests for server selection on Speed Test view - Add healthCheckServersData test data for server list Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Review Summary by QodoAdd server selection dialog for speed test functionality
WalkthroughsDescription• Add server selection dialog for speed test across multiple views - Shows dialog when tapping Go button with available servers - Allows users to select server before running speed test • Refactor server selection into reusable dialog component - Extract common dialog logic from SpeedTestView - Implement in SpeedTestWidget and CustomSpeedTest • Replace server selection modal with dropdown in SpeedTestView - Simplifies UI with persistent dropdown instead of icon button - Improves accessibility and discoverability • Add comprehensive tests for server selection functionality - Test server dialog in dashboard, instant verify, and speed test views - Verify dialog appearance and server selection flow Diagramflowchart LR
User["User taps Go button"]
Check{"Servers available?"}
Dialog["Show server selection dialog"]
Select["User selects server"]
Test["Run speed test with selected server"]
User --> Check
Check -->|Yes| Dialog
Check -->|No| Test
Dialog --> Select
Select --> Test
File Changes1. lib/page/dashboard/views/components/widgets/atomic/speed_test.dart
|
Code Review by Qodo
1. Hardcoded dropdown hint -----
|
| child: AppDropdown<HealthCheckServer>( | ||
| items: servers, | ||
| value: selectedServer, | ||
| itemAsString: (s) => s.toString(), | ||
| hint: '-----', | ||
| onChanged: (server) { | ||
| if (server != null) { |
There was a problem hiding this comment.
1. Hardcoded dropdown hint ----- 📘 Rule violation ✓ Correctness
• The server dropdown uses a hardcoded hint string ('-----') instead of the app localization
mechanism.
• This introduces a user-facing string that won’t be translated and breaks localization consistency
across locales.
• It also forces tests to assert a literal placeholder rather than a localized value, increasing
brittleness.
Agent Prompt
## Issue description
`SpeedTestView` uses a hardcoded dropdown hint (`'-----'`) which is user-facing and not localized.
## Issue Context
The project uses ARB-based localization (`lib/l10n/*.arb`) and `loc(context)` lookups. Any new user-facing strings should be added via the localization workflow.
## Fix Focus Areas
- lib/page/health_check/views/speed_test_view.dart[47-66]
- lib/l10n/app_en.arb[785-805]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| Future<HealthCheckServer?> _showServerSelectionDialog( | ||
| BuildContext context, | ||
| WidgetRef ref, | ||
| List<HealthCheckServer> servers, | ||
| ) async { |
There was a problem hiding this comment.
2. Unused ref parameter 📘 Rule violation ✓ Correctness
• _showServerSelectionDialog declares a WidgetRef ref parameter that is never used. • This typically triggers an analyzer hint (unused_parameter) and can fail CI if analyzer warnings are treated as violations. • Keeping unused parameters also reduces code clarity and invites confusion about intended behavior.
Agent Prompt
## Issue description
`_showServerSelectionDialog` has an unused `WidgetRef ref` parameter, which can trigger analyzer warnings.
## Issue Context
The repository’s compliance requires no new analyzer/lint violations in modified Dart code.
## Fix Focus Areas
- lib/page/health_check/shared_widgets/speed_test_widget.dart[68-99]
- lib/page/health_check/shared_widgets/speed_test_widget.dart[670-699]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
- Use localization for dropdown hint instead of hardcoded '-----' - Remove unused ref parameter from _showServerSelectionDialog - Add scroll constraint to server list dialog to prevent overflow - Update test to use localized hint text Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
754d7ec to
afaf727
Compare
Summary
showServerSelectionDialogparameterTest plan
flutter test test/page/instant_verify/views/localizations/instant_verify_view_test.dart --name "server selection"flutter test test/page/health_check/views/localizations/speed_test_view_test.dart --name "server selection"🤖 Generated with Claude Code