Skip to content

Conversation

@HankYuLinksys
Copy link
Collaborator

@HankYuLinksys HankYuLinksys commented Jan 6, 2026

User description

Summary

  • Move core providers and services to lib/core/data/ for better organization
  • Move platform utilities to lib/core/utils/ to centralize platform-specific code

Changes

  • Reorganized core providers and services under lib/core/data/
  • Relocated platform utilities to lib/core/utils/

PR Type

Enhancement


Description

  • Move core providers and services from lib/core/jnap/ to lib/core/data/

  • Move platform utilities (assign_ip, ip_getter) to lib/core/utils/

  • Move feature-specific providers (node_light_settings, wan_external) to feature directories

  • Update all import paths across 100+ files in lib and test directories


Diagram Walkthrough

flowchart LR
  A["lib/core/jnap/providers<br/>lib/core/jnap/services"] -->|Move core| B["lib/core/data/providers<br/>lib/core/data/services"]
  A -->|Move utilities| C["lib/core/utils/assign_ip<br/>lib/core/utils/ip_getter"]
  A -->|Move feature| D["lib/page/nodes/providers<br/>lib/page/instant_verify/providers"]
  B -->|Update imports| E["100+ files updated"]
  C -->|Update imports| E
  D -->|Update imports| E
Loading

File Walkthrough

Relevant files
Refactoring
77 files
dashboard_manager_provider.dart
Update imports to new data provider location                         
+3/-3     
device_manager_provider.dart
Update imports to new data provider location                         
+3/-3     
firmware_update_provider.dart
Update imports to new data provider location                         
+3/-3     
node_internet_status_provider.dart
Rename and update imports for internet status                       
+1/-1     
polling_provider.dart
Update imports to new data provider location                         
+2/-2     
side_effect_provider.dart
Update location comment and polling provider import           
+2/-2     
dashboard_manager_service.dart
Update imports to new data service location                           
+2/-2     
device_manager_service.dart
Update imports to new data service location                           
+2/-2     
firmware_update_service.dart
Update imports to new data service location                           
+2/-2     
router_repository.dart
Update imports for data providers and utilities                   
+5/-5     
devices.dart
Update device manager state import path                                   
+1/-1     
linksys_cloud_repository.dart
Update ip_getter import to utils location                               
+3/-3     
linksys_device_cloud_service.dart
Update provider and utility imports                                           
+4/-4     
geolocation_provider.dart
Update device manager provider imports                                     
+2/-2     
remote_client_provider.dart
Update device manager provider import                                       
+1/-1     
internet_settings_service.dart
Update provider imports to new locations                                 
+2/-2     
internet_settings_view.dart
Update assign_ip import to utils location                               
+2/-2     
release_and_renew_view.dart
Update provider imports to new locations                                 
+2/-2     
local_network_settings_service.dart
Update side effect provider import                                             
+1/-1     
dhcp_reservations_view.dart
Update device manager state import                                             
+1/-1     
local_network_settings_view.dart
Update assign_ip import to utils location                               
+2/-2     
dialogs.dart
Update dashboard and polling provider imports                       
+2/-2     
remote_assistance_dialog.dart
Update polling provider import                                                     
+1/-1     
top_bar.dart
Update device manager provider import                                       
+1/-1     
dashboard_home_provider.dart
Update dashboard and device manager imports                           
+2/-2     
dashboard_home_service.dart
Update provider state imports                                                       
+2/-2     
home_title.dart
Update provider imports and rename node_wan_status             
+3/-3     
internet_status.dart
Update provider imports and rename node_wan_status             
+2/-2     
networks.dart
Update provider imports and rename node_wan_status             
+4/-4     
port_and_speed.dart
Update provider imports and rename node_wan_status             
+2/-2     
quick_panel.dart
Move node_light_settings to feature and update polling     
+2/-2     
wifi_grid.dart
Update polling provider import                                                     
+1/-1     
dashboard_home_view.dart
Update provider and utility imports                                           
+4/-4     
dashboard_menu_view.dart
Update polling provider import                                                     
+1/-1     
prepare_dashboard_view.dart
Update provider imports                                                                   
+2/-2     
firmware_update_ui_model.dart
Update device manager state import                                             
+1/-1     
firmware_update_detail_view.dart
Update firmware update provider import                                     
+1/-1     
firmware_update_process_view.dart
Update device manager state import                                             
+1/-1     
firmware_update_table.dart
Update device manager state import                                             
+1/-1     
health_check_provider.dart
Update polling provider import                                                     
+1/-1     
manual_firmware_update_provider.dart
Update provider imports and ip_getter location                     
+5/-5     
power_table_provider.dart
Update polling provider import                                                     
+1/-1     
timezone_provider.dart
Update polling provider import                                                     
+1/-1     
instant_admin_view.dart
Update provider imports to new locations                                 
+3/-3     
device_filtered_list_provider.dart
Update provider imports                                                                   
+2/-2     
device_list_provider.dart
Update provider imports                                                                   
+2/-2     
device_list_state.dart
Update device manager state import                                             
+1/-1     
device_detail_view.dart
Update provider imports                                                                   
+2/-2     
devices_filter_widget.dart
Update provider imports                                                                   
+2/-2     
instant_device_view.dart
Update provider imports                                                                   
+2/-2     
instant_privacy_device_list_provider.dart
Update device manager provider import                                       
+1/-1     
instant_privacy_provider.dart
Update provider imports                                                                   
+2/-2     
instant_privacy_service.dart
Update device manager state import                                             
+1/-1     
instant_safety_service.dart
Update polling provider import                                                     
+1/-1     
pnp_setup_view.dart
Update firmware update provider import                                     
+1/-1     
pnp_service.dart
Update provider imports to new locations                                 
+4/-4     
instant_topology_provider.dart
Update provider imports                                                                   
+3/-3     
instant_topology_service.dart
Update device manager state import                                             
+1/-1     
instant_topology_view.dart
Update provider imports                                                                   
+2/-2     
instant_verify_provider.dart
Move wan_external provider to feature directory                   
+2/-2     
wan_external_provider.dart
Move wan_external provider to feature directory                   
+2/-2     
instant_verify_pdf_service.dart
Update provider imports                                                                   
+2/-2     
instant_verify_view.dart
Update provider imports and move wan_external                       
+5/-5     
auto_parent_first_login_provider.dart
Update provider imports                                                                   
+2/-2     
auto_parent_first_login_view.dart
Update firmware update provider import                                     
+1/-1     
login_local_view.dart
Update dashboard manager provider import                                 
+1/-1     
add_nodes_provider.dart
Update provider imports                                                                   
+2/-2     
add_nodes_state.dart
Update device manager state import                                             
+1/-1     
add_wired_nodes_provider.dart
Update provider imports                                                                   
+3/-3     
add_wired_nodes_state.dart
Update device manager state import                                             
+1/-1     
node_detail_provider.dart
Update provider imports                                                                   
+2/-2     
node_light_settings_provider.dart
Move to feature directory and update service import           
+1/-1     
node_detail_service.dart
Update device manager state import                                             
+1/-1     
add_nodes_view.dart
Update device manager state import                                             
+1/-1     
node_detail_view.dart
Update provider imports and move node_light_settings         
+5/-5     
select_network_view.dart
Update dashboard manager provider import                                 
+1/-1     
vpn_status_tile.dart
Update device manager provider import                                       
+1/-1     
Miscellaneous
1 files
mock_firmware_update_provider.dart
Remove unused mock firmware update provider file                 
+0/-166 
Additional files
75 files
dashboard_manager_state.dart [link]   
device_manager_state.dart [link]   
firmware_update_state.dart [link]   
polling_service.dart [link]   
base_assign_ip.dart [link]   
web_assign_ip.dart [link]   
get_local_ip.dart [link]   
mobile_get_local_ip.dart [link]   
web_get_local_ip.dart [link]   
wan_external_state.dart [link]   
wan_external_service.dart [link]   
node_light_settings_service.dart [link]   
channelfinder_provider.dart +1/-1     
wifi_bundle_provider.dart +2/-2     
channel_finder_service.dart +1/-1     
wifi_settings_service.dart +1/-1     
auth_provider.dart +3/-3     
router_provider.dart +5/-5     
test_helper.dart +9/-9     
dashboard_manager_provider_test.dart +4/-4     
dashboard_manager_state_test.dart +1/-1     
device_manager_provider_test.dart +4/-4     
device_manager_state_test.dart +1/-1     
firmware_update_provider_test.dart +5/-5     
node_light_settings_provider_test.dart +2/-2     
polling_provider_test.dart +2/-2     
wan_external_provider_test.dart +3/-3     
wan_external_state_test.dart +1/-1     
dashboard_manager_service_test.dart +3/-3     
device_manager_service_test.dart +2/-2     
firmware_update_service_test.dart +3/-3     
node_light_settings_service_test.dart +1/-1     
polling_service_test.dart +1/-1     
wan_external_service_test.dart +1/-1     
add_nodes_notifier_mocks.dart +1/-1     
dashboard_home_notifier_mocks.dart +2/-2     
dashboard_manager_notifier_mocks.dart +3/-3     
device_list_notifier_mock.dart +1/-1     
device_manager_notifier_mocks.dart +3/-3     
firmware_update_notifier_mocks.dart +2/-2     
firmware_update_service_mocks.dart +1/-1     
geolocation_notifier_mocks.dart +1/-1     
dashboard_manager_notifier_spec.dart +1/-1     
device_manager_notifier_spec.dart +1/-1     
firmware_update_notifier_spec.dart +1/-1     
firmware_update_service_spec.dart +1/-1     
node_light_settings_notifier_spec.dart +1/-1     
polling_notifier_spec.dart +1/-1     
side_effect_notifier_spec.dart +1/-1     
node_detail_notifier_mocks.dart +1/-1     
node_light_settings_notifier_mocks.dart +1/-1     
polling_notifier_mocks.dart +1/-1     
router_repository_mocks.dart +1/-1     
side_effect_notifier_mocks.dart +1/-1     
dashboard_home_test_data.dart +2/-2     
dashboard_manager_test_data.dart +1/-1     
device_manager_test_data.dart +1/-1     
instant_privacy_test_data.dart +1/-1     
internet_settings_service_test.dart +1/-1     
dashboard_home_view_test.dart +3/-3     
dashboard_home_provider_test.dart +4/-4     
firmware_update_detail_view_test.dart +1/-1     
health_check_provider_test.dart +1/-1     
manual_firmware_update_provider_test.dart +2/-2     
instant_privacy_provider_test.dart +2/-2     
instant_topology_provider_test.dart +1/-1     
instant_verify_provider_test.dart +3/-3     
instant_verify_view_test.dart +1/-1     
node_detail_view_test.dart +1/-1     
node_detail_provider_test.dart +2/-2     
add_nodes_view_test.dart +1/-1     
wifi_bundle_provider_test.dart +4/-4     
wifi_settings_service_test.dart +1/-1     
auth_provider_test.dart +3/-3     
firmware_update_test_state.dart +1/-1     

- Move assign_ip/ folder from lib/core/jnap/providers/ to lib/core/utils/
- Move ip_getter/ folder from lib/core/jnap/providers/ to lib/core/utils/
- Update import paths in all affected files (8 files)
- Remove unused mock_firmware_update_provider.dart from lib/
- Create new lib/core/data/ directory structure with providers/ and services/ subdirectories
- Move dashboard_manager_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move device_manager_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move firmware_update_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move polling_provider from lib/core/jnap/providers/ to lib/core/data/providers/
- Move side_effect_provider from lib/core/jnap/providers/ to lib/core/data/providers/
- Move node_wan_status_provider to lib/core/data/providers/node_internet_status_provider.dart
- Move dashboard_manager_service from lib/core/jnap/services/ to lib/core/data/services/
- Move device_manager_service from lib/core/jnap/services/ to lib/core/data/services/
- Move firmware_update_service from lib/core/jnap/services/ to lib/core/data/services/
- Move polling_service from lib/core/jnap/services/ to lib/core/data/services/
- Update all import paths in lib/ and test/ directories
- Remove empty lib/core/jnap/providers/ and lib/core/jnap/services/ directories
@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Update architectural documentation for new structure

The PR's new directory structure, specifically lib/core/data/providers,
contradicts the architectural guidelines. The documentation should be updated to
reflect these changes and clarify provider locations.

Examples:

lib/core/data/providers/dashboard_manager_provider.dart [1-10]
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:privacy_gui/constants/_constants.dart';
import 'package:privacy_gui/core/jnap/models/device_info.dart';
import 'package:privacy_gui/core/data/providers/dashboard_manager_state.dart';
import 'package:privacy_gui/core/data/providers/polling_provider.dart';
import 'package:privacy_gui/core/data/services/dashboard_manager_service.dart';
import 'package:privacy_gui/core/utils/bench_mark.dart';
import 'package:privacy_gui/core/utils/logger.dart';
import 'package:shared_preferences/shared_preferences.dart';
lib/core/data/providers/side_effect_provider.dart [20-23]
//    Located in `lib/core/data/providers/`, this component is explicitly part
//    of the JNAP infrastructure, not a feature provider in `lib/page/`.
//    Its responsibility is to handle JNAP operation side effects, which
//    inherently belongs to the Data Layer.

Solution Walkthrough:

Before:

// In some architectural document (e.g., CLAUDE.md)
- All data providers should be located in `lib/providers/` or `lib/page/...`.
- Core infrastructure providers are in `lib/core/jnap/providers/`.

// Code structure before PR
lib/
├── core/
│   └── jnap/
│       └── providers/
│           ├── dashboard_manager_provider.dart
│           └── device_manager_provider.dart
└── page/
    └── ...

After:

// In the updated architectural document (e.g., CLAUDE.md)
- Feature-specific providers are in `lib/page/...`.
- Core data-layer providers are in `lib/core/data/providers/`.
- Platform utilities are in `lib/core/utils/`.

// Code structure after PR
lib/
├── core/
│   ├── data/
│   │   └── providers/
│   │       ├── dashboard_manager_provider.dart
│   │       └── device_manager_provider.dart
│   └── utils/
│       └── ip_getter/
└── page/
    └── ...
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a critical architectural inconsistency introduced by the PR's large-scale refactoring, where the new provider location lib/core/data/providers likely conflicts with existing documentation, impacting future maintainability.

Medium
General
Restore deleted mock provider file

Restore the deleted mock_firmware_update_provider.dart file to an appropriate
new location and update its imports to align with the refactoring.

lib/core/jnap/providers/mocks/mock_firmware_update_provider.dart [1]

-File was deleted
+// It is recommended to restore the deleted file to a new location, for example:
+// 'lib/core/data/providers/mocks/mock_firmware_update_provider.dart'
+// with updated imports.
 
+import 'dart:async';
+
+import 'package:privacy_gui/core/data/providers/firmware_update_provider.dart';
+import 'package:privacy_gui/core/data/providers/firmware_update_state.dart';
+import 'package:privacy_gui/core/jnap/models/firmware_update_settings.dart';
+import 'package:privacy_gui/page/firmware_update/models/firmware_update_ui_model.dart';
+
+/// To use this mock for manual testing, you can override the `firmwareUpdateProvider`
+/// in the `ProviderScope` at the root of your app.
+///
+/// Example in your main.dart:
+///
+/// ```dart
+/// ProviderScope(
+///   overrides: [
+///     firmwareUpdateProvider.overrideWith(() => MockFirmwareUpdateNotifier()),
+///   ],
+///   child: MyApp(),
+/// )
+/// ```
+
+class MockFirmwareUpdateNotifier extends FirmwareUpdateNotifier {
+  @override
+  FirmwareUpdateState build() {
+    // ... (implementation from the deleted file)
+  }
+
+  // ... (other methods from the deleted file)
+}
+

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies the deletion of a mock provider file, which is likely an oversight in a large refactoring and could impact testing and development workflows.

Medium
  • More

@HankYuLinksys HankYuLinksys deleted the refactor/move-core-providers-and-utils branch January 6, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants