-
Notifications
You must be signed in to change notification settings - Fork 3
fix(ui): Resolve Phase 2 & 3 UI Issues (Topology, Layout, Focus) & Upgrade UI Kit #581
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
fix(ui): Resolve Phase 2 & 3 UI Issues (Topology, Layout, Focus) & Upgrade UI Kit #581
Conversation
- Move env.template to assets/agents/env.template - Update dotenv loading paths in main.dart and main_demo.dart - Fix type definition in IdleChecker - Fix lints in tests
- Update Notifier mock signatures in test/mocks/ to correctly extend AsyncNotifier/Notifier and mixin Mock - Fix node_detail_view_test.dart by stubbing missing node light status - Update CI workflow env setup
…gnment - AppDialog: unified scroll behavior with scrollable parameter - AppText: add maxLines/minLines to all factories - AppTextField: fix disabled background color - WiFi Card: add intrinsicHeight alignment for equal card heights - WiFi Mode: add minLines:2 for consistent height - Remove redundant SingleChildScrollView from dialogs - Fix crossAxisSpacing in advanced settings grid
- Refactor : remove unused code, extract - Refactor : unify layout logic, extract - Refactor : merge layout methods - Refactor : extract component - Introduce for consistent layout handling
- Replace inner with shared in - Eliminate code duplication for port status rendering
- Extract and to separate files - Reduce complexity (840 -> 246 lines) - Improve separation of concerns in dashboard components
- Use instead of fixed in - Ensure visual consistency between grid items and parent layout
…row layouts - Fix horizontal overflow in WiFiCard header and footer using Expanded/Flexible - Fix horizontal overflow in PortStatusWidget - Optimise vertical spacing in ExternalSpeedTestLinks - Increase fixed container height for InternetConnectionWidget in desktop layout - Protect Networks info tiles from overflow
- Fix 'Cannot hit test a render box with no size' error by replacing Spacer() with AppGap in ExternalSpeedTestLinks - Optimize vertical padding/gaps in ExternalSpeedTestLinks to fit constrained desktop layouts - Enhance stability of DashboardLayoutVariant mobile handling
…ExternalSpeedTestLinks - Remove Flexible wrapper around buttons row to prevent layout exception in unconstrained height context (Mobile) - Ensure compatibility with both fixed-height Desktop and infinite-height Mobile layouts
- Add dedicated Tablet layout (2-column flexible grid) to DashboardHomeView - Fix DashboardLayoutVariant to support 'tablet' mode - Update DashboardHomePortAndSpeed to support flexible height in tablet mode - Fix desktop layout overflow by relaxing fixed height constraint to minHeight
- Replace ConstrainedBox(minHeight) with IntrinsicHeight in _desktopNoLanPortsLayout - Ensures layout stability by resolving content size before constraints - Fixes 'Unexpected null value' and 'LayoutBuilder assertion failed' caused by recursive layout failures
- Force single-column layout for WiFiGrid in Tablet mode (requested by user) - Fix floating point height calculation in WiFiGrid using .ceil() to prevent bottom overflow - Closes user request about squeezed card content in Tablet view
- Update topologyItemHeight constant to 72.0 to match actual UI Kit tile height - Update treeViewBaseHeight to 72.0 - Ensures DashboardNetworks card height is limited to exactly 3 routers on Desktop/Tablet, enabling scroll for overflow - Closes user request for scrollable network list
- Add static factory to centralize complex layout determination logic - Refactor to use new helper, removing verbose ternary operators - Refactor to use , implicitly improving Tablet layout handling for vertical/horizontal decision - Add missing export to to fix library visibility
- Confirmed and extension methods on are unused - Removed to keep codebase clean and avoid ambiguity with
- Create DashboardLayoutStrategy interface and 7 concrete strategies: - MobileLayoutStrategy - DesktopHorizontalLayoutStrategy - DesktopVerticalLayoutStrategy - DesktopNoLanPortsLayoutStrategy - TabletLayoutStrategy - TabletHorizontalLayoutStrategy - TabletVerticalLayoutStrategy - Create DashboardLayoutContext (IoC container) for widget injection - Create DashboardLayoutFactory for O(1) strategy lookup - Refactor DashboardHomeView to delegate layout to strategies - Create DashboardLoadingWrapper for shared loading state handling - Refactor all dashboard components to use DashboardLoadingWrapper: - port_and_speed.dart - home_title.dart - networks.dart (also simplified to StatelessWidget) - wifi_grid.dart - internet_status.dart - quick_panel.dart - Reduce dashboard_home_view.dart from 367 to ~118 lines (-68%) This eliminates scattered if-else layout logic and centralizes layout decisions in Strategy classes following IoC principles.
…ard layouts Phase 1 - Core models: - DisplayMode: compact/normal/expanded enum - HeightStrategy: intrinsic/columnBased/aspectRatio sealed class - WidgetGridConstraints: column-based layout constraints - WidgetSpec: widget specification with mode-based constraints - DashboardWidgetSpecs: predefined specs for all dashboard widgets Phase 2 - Layout resolver: - GridLayoutResolver: calculates widget sizes using UI Kit's colWidth API - Extended DashboardLayoutContext with constraint helpers Phase 4 - User preferences: - DashboardLayoutPreferences: persisted user layout preferences - dashboardPreferencesProvider: Riverpod notifier for preferences This implements the foundation for the dashboard layout customization system. Phase 3 (component DisplayMode support) and Phase 5 (settings UI) remain for future work.
…gs UI Phase 3 - Component DisplayMode support: - InternetConnectionWidget: Added displayMode parameter with loading height variants - DashboardNetworks: Added displayMode parameter with loading height variants - DashboardWiFiGrid: Added displayMode parameter - DashboardQuickPanel: Added displayMode parameter with loading height variants - DashboardHomePortAndSpeed: Added displayMode parameter with loading height variants Phase 5 - Settings UI: - Created DashboardLayoutSettingsPanel for customizing widget display modes - Uses SegmentedButton for compact/normal/expanded selection - Integrates with dashboardPreferencesProvider for persistence - Added to barrel exports All components now support DisplayMode.compact/normal/expanded rendering modes. The settings panel allows users to customize each widget's display mode.
- Watch dashboardPreferencesProvider in DashboardHomeView - Pass displayModes map to DashboardLayoutContext - Pass individual displayMode to each widget component - Widgets now respond to user preference settings The dashboard now respects user layout preferences stored in SharedPreferences.
- Added 'Dashboard Layout' menu option in DashboardMenuView - Shows DashboardLayoutSettingsPanel in a dialog on tap - Uses widgets icon for the menu item - Added components barrel export to menu view imports Users can now access layout customization from the menu.
…vice detail truncation, and missing labels
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:
|
||||||||||||
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
PeterJhongLinksys
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
User description
Summary
Resolves multiple UI issues identified in Phase 2 and Phase 3 testing, including topology clipping, device detail truncation, missing labels, and layout overflows. Also upgrades
ui_kit_libraryto v2.10.3 to incorporate latest component fixes.Changes
🚀 Enhancements & Fixes
📦 Dependencies
ui_kit_libraryandgenerative_uito v2.10.3.Verification
PR Type
Enhancement, Bug fix, Tests
Description
Major refactoring of Internet Settings view with component extraction and simplified state management using
UiKitPageView.withSliverreplacingStyledAppPageViewInstant Verify view refactored with topology integration, improved layout handling for mobile/desktop, and UI kit upgrade to v2.10.3
WiFi settings null-safety improvements in deserialization with sensible defaults for missing enum values
IPv6 WAN form factory created for dynamic form creation based on connection type
Comprehensive test modernization across multiple modules (Internet Settings, WiFi Settings, Apps & Gaming) using new
TestHelperutility class for cleaner setup and golden file testingProvider import paths updated from
core/jnap/providerstocore/data/providersfor improved architectureCleanup of unused mock classes and imports in health check provider mocks
New placeholder file added for future node connected devices view implementation
Diagram Walkthrough
File Walkthrough
3 files
apps_and_gaming_view_test.dart
Refactor Apps & Gaming tests to use TestHelper utilitytest/page/advanced_settings/apps_and_gaming/views/localizations/apps_and_gaming_view_test.dart
TestHelperutility class instead ofmanual mock setup and dependency injection
testHelperinstance managing all mocks
testHelper.pumpView()for widget setupinstead of
testableSingleRoute()switchToTab()for tab navigation and improvedtest organization with Test IDs and golden file naming
overrides
wifi_main_view_test.dart
Restructure WiFi Settings Tests with Helper Utilitiestest/page/wifi_settings/views/localizations/wifi_main_view_test.dart
new
TestHelperutility class for cleaner test setuptestHelperinstance managing all mocks and dependencies
(WIFIS-ADV_VIEW, WIFIS-MLO_WARN, WIFIS-MAC_VIEW, etc.) and descriptive
names
naming convention
getWifiBundleTestState()helper function to create teststates with dirty state simulation
through helper abstractions
internet_settings_view_test.dart
Modernize internet settings tests with TestHelper and golden filestest/page/advanced_settings/internet_settings/views/localizations/internet_settings_view_test.dart
testableSingleRoute()to newTestHelperclass for simplified setup and mockingISET) anddetailed test scenario descriptions for all 25 test cases
ipv4EditButton,ipv6EditButton, etc.) instead of icon-based findersLinksysIconswithAppFontIconsand updated widget typeexpectations to use
ui_kit_librarycomponentstest descriptions with verification details
testHelper.mockInternetSettingsNotifierinstead of manual mock creation
1 files
wifi_item.dart
Add null-safety to WiFiItem deserializationlib/page/wifi_settings/providers/wifi_item.dart
fromRadio()factory constructor that depended onRouterRadiomodel
fromMap()factory to handle missing ornull map values
absent
radio_info.darttowifi_enums.dartand addedre-export
3 files
ipv6_wan_form_factory.dart
Add IPv6 WAN form factory for dynamic form creationlib/page/advanced_settings/internet_settings/widgets/wan_forms/ipv6/ipv6_wan_form_factory.dart
IPv6WanFormFactoryto handle IPv6 WAN formcreation based on connection type
create()method that returns appropriate form widget forWanIPv6Type_UnsupportedIPv6Formfallback widget for unsupported IPv6connection types
internet_settings_view.dart
Refactor Internet Settings View with Component Extractionlib/page/advanced_settings/internet_settings/views/internet_settings_view.dart
UiKitPageView.withSlivercomponentreplacing
StyledAppPageViewfor improved UI consistencydedicated view components (
Ipv4ConnectionView,Ipv6ConnectionView,ReleaseAndRenewView)TextEditingControllerinstances and replacing with form provider-based validation
isEditingboolean and_toggleEditing()method instead of separate IPv4/IPv6 editing statesServiceSideEffectErrorand improvedasync operation safety with
mountedchecksinstant_verify_view.dart
Refactor Instant Verify view with topology integration and UI kitupgradelib/page/instant_verify/views/instant_verify_view.dart
core/data/providersinstead of
core/jnap/providers) and updated UI kit references toui_kit_library_instantTopology()into comprehensive_buildInstantTopology()method with topology adapter, node rendering,and menu handling
_mobileLayout()and_desktopLayout()helper methods usingAppResponsiveLayout_linkStatusWidget(),_wanStatusWidget(),_wifiStatusWidget(), and_pingTracerouteWidget()methods with improved styling
PortStatusWidgetcomponent andsimplified port card rendering
InstantVerifyPdfServiceand updated iconusage to
AppIcon.font()withAppFontIconsSpacing.*toAppSpacing.*throughoutthe file
2 files
node_connected_devices_view.dart
Add Empty Node Connected Devices View Filelib/page/nodes/views/node_connected_devices_view.dart
devices view implementation
health_check_provider_mocks.dart
Clean up unused mock classes and importstest/mocks/health_check_provider_mocks.dart
_FakeJNAPResult_2class and its associated import ofJNAPResultMockHealthCheckProviderclass declaration for betterreadability
1 files
add_nodes_state.dart
Update provider import path structurelib/page/nodes/providers/add_nodes_state.dart
core/jnap/providers/device_manager_state.dartto
core/data/providers/device_manager_state.dart101 files