docs: translate documentation and test data to English#612
docs: translate documentation and test data to English#612PeterJhongLinksys merged 29 commits intodev-2.0.0from
Conversation
- Create entry point files for 7 modules:
- ip_getter, url_helper, export_selector, get_log_selector,
client_type, assign_ip (new entry points)
- Add mobile_assign_ip.dart (no-op implementation for native)
- Update 17 consumer files to use clean single imports
- Add platform-conditional-exports-audit.md documentation
This eliminates exposed conditional imports in consumer files.
Consumers now only need to import the entry point file.
Modules encapsulated:
1. ip_getter (5 consumers)
2. url_helper (5 consumers)
3. export_selector (2 consumers)
4. get_log_selector (1 consumer)
5. client_type (1 consumer)
6. assign_ip (3 consumers)
- Add 6 new atomic widgets for Custom Layout: - DashboardInternetStatus (internet status only) - DashboardMasterNodeInfo (router details) - DashboardPorts (LAN/WAN port status) - DashboardSpeedTest (speed test results) - DashboardNetworkStats (nodes/devices count) - DashboardTopology (mesh tree view) - Update DashboardWidgetSpecs: - Add specs for all 6 atomic widgets - Add standardWidgets and customWidgets lists - Update DashboardLayoutContext: - Add atomic widget fields - Add _allAtomicWidgets map - Add orderedVisibleCustomSpecs getter - Update CustomDashboardLayoutStrategy: - Use orderedVisibleCustomSpecs for Custom Layout - Update DashboardLayoutSettingsPanel: - Show only atomic widgets in Custom mode (no VPN, no composites) - Add reorderCustomWidget for proper ordering - Fix WiFi Grid truncation: - Add SingleChildScrollView for overflow handling - Increase HeightStrategy to 5.0 for 2-row default height
…us ui - Implement resize lock for Topology in Expanded mode (8x5 fixed). - Update Internet Status constraints: Compact MinHeight=1, Normal/Expanded MinHeight=2. - Fix Internet Status Compact UI: Remove location info, reduce padding (cleaner look). - Fix SliverDashboardView mapping: Use correct InternetConnectionWidget for internet_status item.
…d improve layout stability
…t functionality - Metadata: Added description and requirements to WidgetSpec - IoC: Implemented WidgetRequirement enum for data-driven feature checks (e.g. VPN) - Layout: Enabled composite widgets (port_and_speed, networks) in custom layout - Edit Mode: Added 'Cancel' button with full state restoration (layout positions + view modes) - Settings: Updated Hidden Widgets panel to respect requirements
- Refactor WiFi Grid Compact View to use AppSurface for unified styling - Replace InkWell with AppInkWell in Topology, Master Node, and WiFi Grid for consistent interaction feedback - Enable navigation for Topology Compact View and Master Node - Implement WiFi band toggling in WiFi Grid Compact View - Update Internet Status refresh icon color - Optimize dashboard layout and item heights
- Add dynamic Ports widget constraints based on hardware state (hasLanPort, isHorizontalLayout) - Add minHeightRows/maxHeightRows to Ports constraints for resize validation - Update LayoutItemFactory to use IoC pattern with WidgetSpecResolver - Auto-optimize layout on first use and reset - Add Optimize button to edit toolbar (uses optimizeLayout()) - Reset button only enabled when custom layout is active - Reset only resets layout positions and display modes, preserves custom layout toggle - Fix edit mode state sync bugs when resetting or toggling custom layout - Update default layout positioning to match target design - Adjust widget constraints: QuickPanel(h=3), MasterNode(h=4), Topology(w=4,h=4)
…d decouple custom widget IDs
- Use DashboardOverlay + SliverDashboard + CustomScrollView for proper scroll behavior - Fix grid background to only appear in dashboard area (not TopBar/Title) - Add SliverPadding for correct horizontal margins - Fix WiFi Grid default height (use spec value instead of hardcoded h:2) - Simplify DashboardHomeView custom layout branch - TopBar, Edit Toolbar, Title fixed at top with dashboard grid scrollable
- Add custom_layout parameter to deploy-demo workflow - Add 13 new localization keys for dashboard custom layout - Replace hardcoded strings with loc(context) calls - Fix localization tests for dashboard and speed test views - Fix unused imports and deprecated debugState usage in tests - Update UI Kit dependency to v2.10.6
- Fix saveLayout() not called after constraint violation correction in resize - Add empty children guard to prevent crash in InternetConnectionWidget - Change .then() to .whenComplete() for error resilience in refresh action
This commit refactors the NodeLightSettings feature to follow Clean Architecture principles, decoupling the UI from JNAP data models. Changes: - Introduce NodeLightState UI model - Update NodeLightSettingsService for Model-State conversion - Update NodeLightSettingsProvider to expose NodeLightState - Update consumers (NodeDetailView, QuickPanel) to use NodeLightState - Update Unit and Widget Tests
…ssions - Move to shared - Refactor to depend on - Fix regressions in and - Fix mocks in
P0 Fixes: - P0-1: prepare_dashboard_view.dart - Use SessionProvider instead of direct RouterRepository access - P0-2: pnp_no_internet_connection_view.dart - Add isLoggedIn getter to PnpNotifier, move defaultAdminPassword to shared constants - P0-3: local_network_settings_view.dart - Use getLocalIp helper with ProviderReader pattern - P0-4: router_assistant_view.dart - Move provider definition to dedicated provider file P1 Fixes: - P1-1: select_network_provider.dart - Create NetworkAvailabilityService to encapsulate router check logic - P1-2: channelfinder_provider.dart - Move service provider definition to service file New files: - lib/constants/defaults.dart - Shared default constants - lib/page/ai_assistant/providers/router_command_provider.dart - lib/page/select_network/services/network_availability_service.dart - test/core/utils/ip_getter_test.dart - Tests for IP getter refactoring - test/page/instant_setup/providers/pnp_auth_test.dart - Tests for PnP auth logic Updated architecture violations report to reflect fixed items.
- Create JnapDeviceInfoRaw for JNAP protocol layer (with services field) - Refactor NodeDeviceInfo as pure UI model (moved to core/models/) - Add fetchDeviceInfoAndInitializeServices() to encapsulate buildBetterActions - Remove services parameter from getAdminPasswordAuthStatus() - Fix login error display by rethrowing JNAPError for countdown data - Update all related imports and tests
- Remove FirmwareUpdateState import from firmware_update_process_view.dart - Remove TimeSettings import from instant_admin_view.dart - Update firmware_update_provider to expose UI-friendly properties - Clean up firmware_update_state for proper encapsulation Resolves P2 architecture violations per architecture-violations-detail.md
…nd settings integration Completed tasks T027-T029. Implemented JSON-based widget loading, fixed async rebuild issues, and integrated A2UI widgets into the Settings Panel with proper badges.
…efactor architecture
…lidation - Added new A2UI widget assets: guest_network, network_traffic, quick_actions, router_control, system_health. - Implemented robust Action handling system (ActionManager, ActionHandler). - Enhanced TemplateBuilder with better rendering capabilities. - Added A2UIConstraintValidator for widget validation. - Extensive test coverage added for actions, assets, integration, and rendering. - Refactored JNAP data resolver and updated Dashboard factory.
- Translated project documentation, specs, and architectural analysis to English - Translated all Chinese content in test/test_data/ - Consolidated AI Assistant documentation into single architecture file - Cleaned up redundant documentation and temporary scripts - Updated pubspec.yaml dependencies and formatted code
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
- Refactored to hide raw error details from UI (Generic: Robust Error Handling) - Updated to escape HTML in dynamic fields (Generic: XSS Prevention) - Addressed const lint error
…y, specs, and docs
User description
Summary
test/test_data/.doc/ai_assistant/router_ai_assistant_architecture.md).pubspec.yamldependencies and formatted code.Changes
doc/,specs/,README.md,constitution.md, etc.test/test_data/lib/demo/wcag_report_with_analysis_demo.dart(Translated and fixed syntax error)PR Type
Enhancement, Tests, Documentation
Description
Dashboard UI Kit Major Update: Implemented comprehensive dashboard refactoring with atomic widget components, custom layout support, and A2UI system integration
New Atomic Widgets: Added
CustomSpeedTest,CustomMasterNodeInfo,CustomWiFiGrid,CustomQuickPanel, andInternetStatusOnlywidgets with compact/normal/expanded display modesFixed Layout Components: Created
FixedDashboardWiFiGrid,FixedInternetConnectionWidget,FixedDashboardQuickPanel, and related widgets for fixed dashboard layoutsA2UI System Enhancement: Implemented constraint validator, JSON widget loader, data resolver, action handler, and template builder with comprehensive integration tests
Dashboard Widget Specifications Refactored: Translated documentation to English, reorganized widget specs with
standardWidgetsandcustomWidgetslists, added atomic component specifications with dynamic constraint variationsSliver-based Dashboard View: Implemented drag-and-drop dashboard with edit mode, constraint validation, display mode switching (compact/normal/expanded), and layout persistence
Theme Configuration Provider: Added
DemoThemeConfigNotifierwith Riverpod state management for dynamic theme customization, JSON serialization, and granular color/component overridesWCAG Accessibility Enhancements: Added batch report generator with AI analysis, HTML report generation with health scores and fix suggestions, regression detection, and systemic issue identification
Comprehensive Test Coverage: Added 50+ constraint validator tests, 20+ JSON widget loader tests, A2UI system integration tests, WCAG validation examples, and JNAP data resolver edge case tests
Code Cleanup: Removed unused imports, consolidated documentation, cleaned up redundant files, and simplified firmware update provider API
Diagram Walkthrough
File Walkthrough
12 files
wcag_batch_with_analysis.dart
Batch WCAG Report Generator with AI Analysis Integrationtest/accessibility/examples/wcag_batch_with_analysis.dart
analysis capabilities
health scores, and critical insights
and priority-sorted fix suggestions
complete styling for professional reporting
sliver_dashboard_view.dart
Sliver-based Dashboard View with Edit Mode and Constraintslib/page/dashboard/views/sliver_dashboard_view.dart
sliver_dashboardpackage
widgets
layout persistence
for constraint violations
instant_admin_view.dart
Firmware Update Provider API Simplificationlib/page/instant_admin/views/instant_admin_view.dart
FirmwareUpdateSettingsfrom JNAP modelsisAutoUpdateEnabledpropertysetAutoUpdateEnabledmethod
update policy constants
dashboard_widget_specs.dart
Dashboard widget specifications refactored for atomic componentslib/page/dashboard/models/dashboard_widget_specs.dart
internationalization
alllist tostandardWidgetsand added new
customWidgetslist for atomic/Bento layout componentsinternetStatusOnly,masterNodeInfo,ports,speedTest,networkStats,topology) with detailed descriptionsand constraints
intrinsic()tostrict()with explicitminHeightRowsvalues for better layout controlgetPortsSpec()factory method to dynamically adjust port widgetconstraints based on layout state (LAN presence, horizontal/vertical
orientation)
_portsNoLanConstraints,_portsHorizontalConstraints,_portsVerticalConstraints) for flexibleport widget sizing
wifiGridCustom,quickPanelCustom,vpnCustom) with isolated constraint configurationsdemo_theme_config_provider.dart
Demo theme configuration provider with Riverpod state managementlib/demo/providers/demo_theme_config_provider.dart
demo mode using Riverpod
DemoThemeConfigclass with support for style, globaloverlay, visual effects, seed color, and granular Material colors
AppThemeOverridessupport for semantic, palette, surface, andcomponent-level theme customization
DemoThemeConfigNotifierwith methods forimporting/exporting theme configs as JSON, resetting to defaults, and
updating individual theme properties
outline, surface, and error colors
updateLoaderColors,updateSkeletonColors,updateToggleColors,updateToastColors,updateTopologyColors)theme persistence
speed_test.dart
Atomic speed test widget for custom dashboard layoutslib/page/dashboard/views/components/widgets/atomic/speed_test.dart
CustomSpeedTestfor displaying speed test results incustom/Bento layouts
controls), normal (vertical meter layout), and expanded (comprehensive
view with history chart)
button for running tests
SpeedTestWidgetwith configurable metersize and result display
(date, server, ping), and history chart visualization
_HistoryChartcustom painter for rendering speed test history asline chart with download/upload trends
_BigStatsPaneland_DetailsPanelhelper widgets for organizedresult display
and historical data
wifi_grid.dart
Fixed layout WiFi grid widget with responsive display modeslib/page/dashboard/views/components/fixed_layout/wifi_grid.dart
FixedDashboardWiFiGridfor displaying WiFi networks infixed dashboard layouts
normal (2-column grid), expanded (single column with larger cards)
Wrapwith fixed-width cards for flexible horizontalarrangement
GridViewwith responsive column count based on devicelayout (1 or 2 columns)
ListViewwith separated items for single-columnlayout
time
detection
internet_status.dart
Add internet connection status widget with multiple display modeslib/page/dashboard/views/components/widgets/composite/internet_status.dart
InternetConnectionWidgetdisplaying internet connectionstatus
functionality
internetStatusProviderand polling mechanismsmaster_node_info.dart
Add master node info widget with system stats displaylib/page/dashboard/views/components/widgets/atomic/master_node_info.dart
CustomMasterNodeInfofor displaying master routerinformation
layouts
internet_status.dart
Add fixed layout internet connection status widgetlib/page/dashboard/views/components/fixed_layout/internet_status.dart
FixedInternetConnectionWidgetfor fixed layout dashboardInternetConnectionWidgetfunctionality with fixed layoutapproach
quick_panel.dart
Add fixed layout quick actions panel widgetlib/page/dashboard/views/components/fixed_layout/quick_panel.dart
FixedDashboardQuickPanelfor quick actions in fixed layoutdialogs
dashboard_layout_settings_panel.dart
Refactor dashboard layout settings panel with simplified controlslib/page/dashboard/views/components/settings/dashboard_layout_settings_panel.dart
sliverDashboardControllerProviderfor layoutmanagement
5 files
json_widget_loader_test.dart
JSON Widget Loader Test Suite with Error Handlingtest/page/dashboard/a2ui/loader/json_widget_loader_test.dart
JsonWidgetLoaderwith 20+ testcases
failures, and malformed JSON handling
various error conditions
network-like errors
a2ui_constraint_validator_test.dart
Comprehensive test suite for A2UI constraint validationtest/page/dashboard/a2ui/validator/a2ui_constraint_validator_test.dart
A2UIConstraintValidatorwith 50+ testcases
validateResize()covering minimum/maximum width/heightviolations, multiple violations, edge cases, and large dimensions
validatePlacement()covering negative positions, gridboundary violations, overlap detection, adjacent widgets, and multiple
existing widgets
suggestValidResize()covering dimension clamping to min/maxconstraints and handling of unknown widgets
ValidationResultfactory methods (success, violation, error)and result properties
WidgetPlacementandResizeSuggestiondata classes withstring representations
_registerTestWidgets()that registers test widgetswith various constraint patterns (normal, strict, large)
a2ui_system_integration_test.dart
A2UI system integration tests for end-to-end validationtest/page/dashboard/a2ui/integration/a2ui_system_integration_test.dart
loading, rendering, and validation
error handling
and placement validation
failures, duplicate registrations, provider exceptions)
notifications, widget renderer resource disposal)
_createTestThemeData()for proper theme setup in testsjnap_data_resolver_edge_cases_test.dart
Add comprehensive edge case tests for JNAP data resolvertest/page/dashboard/a2ui/resolver/jnap_data_resolver_edge_cases_test.dart
JnapDataResolveredge cases with 444lines
and path handling
a2ui_widget_grid_test.dart
Add A2UI widget grid integration teststest/page/dashboard/a2ui/integration/a2ui_widget_grid_test.dart
rendering
4 files
wcag_html_with_analysis_example.dart
Enhanced HTML Report Generation Example with AI Analysistest/accessibility/examples/wcag_html_with_analysis_example.dart
integration
fix suggestions
output
device_info.dart
Device Info Model Documentation Enhancementlib/core/models/device_info.dart
NodeDeviceInfoclassJnapDeviceInfoRawfor raw JNAP response handlingexample_validation.dart
WCAG accessibility validation example and demonstration scripttest/accessibility/example_validation.dart
usage in PrivacyGUI
(buttons, icons, FAB)
semantics reporters
improvements and regressions
with
ReportMemoryCachereports/accessibility/directory
_getGitHash()for retrieving current Gitcommit hash
wcag_analysis_demo.dart
Add WCAG analysis engine demo with multiple scenarioslib/demo/wcag_analysis_demo.dart
capabilities
suggestions
multi-report analysis
1 files
device_list_state.dart
Device List State Refactoring and Import Cleanuplib/page/instant_device/providers/device_list_state.dart
public_member_api_docs,sort_constructors_first,collection)DeviceListItemmodel from core modelsDeviceListItemto simplify downstreamimports
1 files
build_config.dart
Add custom layout build configuration flaglib/constants/build_config.dart
customLayoutwith default valuefalse101 files