-
Notifications
You must be signed in to change notification settings - Fork 3
Demo: Custom Dashboard Layout #589
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
base: dev-2.0.0
Are you sure you want to change the base?
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
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:
|
|||||||||||||||||||||||||||||
- 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
User description
Summary
This PR introduces a custom dashboard layout feature with the following capabilities:
Key Components
Testing
PR Type
Enhancement
Description
Introduces a comprehensive custom dashboard layout system with drag-and-drop and resizable widgets
Implements atomic widget components (
CustomSpeedTest,CustomMasterNodeInfo,CustomWifiGrid,CustomQuickPanel,Ports,NetworkStats,InternetStatusOnly,Topology) for flexible dashboard compositionAdds
SliverDashboardViewwith edit mode featuring toolbar controls, constraint enforcement, display mode switching, and layout persistenceExpands widget specifications with strict sizing strategy, atomic widget specs, and layout variations (horizontal, vertical, no-LAN)
Creates comprehensive theme studio with tabbed interface (Design, Palette, Status, Components, Topology) supporting import/export functionality
Implements
DemoThemeConfigprovider for dynamic theme configuration with JSON serializationRefactors dashboard home view to support both custom (Sliver-based) and standard layouts with dynamic constraint updates
Adds fixed-layout widget components (
FixedInternetConnectionWidget,FixedQuickPanel,FixedWifiGrid,FixedNetworks,FixedPortAndSpeed) for standard layoutIntroduces
SliverDashboardControllerfor layout persistence using SharedPreferences with add/remove/update operationsImplements
LayoutItemFactoryusing IoC pattern for converting widget specs to layout itemsAdds
GridLayoutResolverwith height calculation enhancements for responsive grid systemsIncludes comprehensive unit and integration tests for widget constraints, layout management, and theme configuration
Enhances speed test widget with compact display mode and result summary controls
Adds WiFi card display modes (compact/expanded) with device preview and QR code sharing
Diagram Walkthrough
File Walkthrough
30 files
dashboard_widget_specs.dart
Expand widget specs with atomic components and strict sizinglib/page/dashboard/models/dashboard_widget_specs.dart
HeightStrategy.intrinsic()withHeightStrategy.strict()fordeterministic widget sizing
descriptionandcanHidefields to widget specificationsinternetStatusOnly,masterNodeInfo,ports,speedTest,networkStats,topology) for custom/bento layoutsgetPortsSpec()method with layout variations(horizontal, vertical, no-LAN)
customWidgetslist and custom layout variants(
wifiGridCustom,quickPanelCustom,vpnCustom)alllist tostandardWidgetsand created comprehensivealllistcombining both standard and atomic widgets
demo_theme_config_provider.dart
Add demo theme configuration provider with import/exportlib/demo/providers/demo_theme_config_provider.dart
DemoThemeConfigclass with support for style, overlay,visual effects, seed colors, and granular Material colors
copyWith()method for immutable state updates with clear flagsfunctionality
DemoThemeConfigNotifierwith methods for updating semanticoverrides and component-specific colors (loader, skeleton, toggle,
toast, topology)
state
speed_test.dart
Implement atomic speed test widget with display modeslib/page/dashboard/views/components/widgets/atomic/speed_test.dart
CustomSpeedTestwidget for custom layout displayingspeed test results
(meter view), expanded (detailed with history chart)
visualization
(remote/legacy)
display
sliver_dashboard_view.dart
Add sliver-based drag-drop dashboard with edit modelib/page/dashboard/views/sliver_dashboard_view.dart
SliverDashboardViewfor drag-and-drop dashboard usingsliver_dashboardpackagecancel, and save buttons
_handleResizeEnd()to respect min/maxwidth and height ranges
indicators
canHideproperty checkcancel operations
master_node_info.dart
Implement atomic master node info widget with statslib/page/dashboard/views/components/widgets/atomic/master_node_info.dart
CustomMasterNodeInfowidget displaying masterrouter information
(standard details), expanded (large image with unified info sections)
internet_status.dart
Add fixed internet connection status widgetlib/page/dashboard/views/components/fixed_layout/internet_status.dart
FixedInternetConnectionWidgetfor displaying internetconnection status
display with router info), expanded (normal + uptime)
useAppCardparameter to optionally wrap content inAppCardstatus
quick_panel.dart
Add optional card wrapping to quick panel widgetlib/page/dashboard/views/components/widgets/composite/quick_panel.dart
useAppCardparameter to control whether content wraps inAppCard(default true)
card wrapping
SingleChildScrollViewwith conditionalcard wrapping
night mode
layouts
internet_status.dart
Internet Connection Status Widget with Multi-Mode Displaylib/page/dashboard/views/components/widgets/composite/internet_status.dart
display modes (compact, normal, expanded)
information
expanded mode
real-time data
quick_panel.dart
Fixed Dashboard Quick Panel with Display Mode Supportlib/page/dashboard/views/components/fixed_layout/quick_panel.dart
normal, expanded)
with BETA badge
expanded mode shows full descriptions
network_stats.dart
Network Statistics Widget with Chart Visualizationlib/page/dashboard/views/components/widgets/atomic/network_stats.dart
count) for custom layout
expanded mode
type
networks.dart
Fixed Dashboard Networks Widget with Topology Displaylib/page/dashboard/views/components/fixed_layout/networks.dart
with three display modes
tree, expanded mode shows full details
dashboard_layout_settings_panel.dart
Simplified Dashboard Layout Settings Panellib/page/dashboard/views/components/settings/dashboard_layout_settings_panel.dart
functionality
mode, width)
mode control
topology_tab.dart
Topology Theme Studio Tab with Live Previewlib/demo/theme_studio/tabs/topology_tab.dart
visualization
colors
custom_quick_panel.dart
Custom Quick Panel Widget for Bento Grid Layoutlib/page/dashboard/views/components/widgets/atomic/custom_quick_panel.dart
three display modes
toggles with descriptions
methods
handling
wifi_card.dart
WiFi Card Widget with Compact and Expanded Modeslib/page/dashboard/views/components/widgets/parts/wifi_card.dart
preview with avatars
functionality
icons
port_and_speed.dart
Port and Speed Test Dashboard Widgetlib/page/dashboard/views/components/fixed_layout/port_and_speed.dart
with three display modes
test, expanded mode shows detailed info
available space
grid_layout_resolver.dart
Grid Layout Resolver Height Calculation Enhancementlib/page/dashboard/strategies/grid_layout_resolver.dart
resolveGridMainAxisCellCount()to calculate grid mainaxis cell count
ratio)
strategy type
custom_wifi_grid.dart
Atomic WiFi Grid Widget for Custom Dashboard Layoutlib/page/dashboard/views/components/widgets/atomic/custom_wifi_grid.dart
Normal, Expanded)
configurations
handling
items
wifi_card.dart
WiFi Card Component with Toggle and Share Featureslib/page/dashboard/views/components/fixed_layout/wifi_card.dart
code sharing
internet_status_only.dart
Atomic Internet Status Widget with Animationslib/page/dashboard/views/components/widgets/atomic/internet_status_only.dart
visualization
Expanded (animated)
sliver_dashboard_controller_provider.dart
Sliver Dashboard Controller Provider for Layout Managementlib/page/dashboard/providers/sliver_dashboard_controller_provider.dart
DashboardControllerserialization
hardware-dependent specs
components_tab.dart
Theme Studio Components Configuration Tablib/demo/theme_studio/tabs/components_tab.dart
Skeleton, Toggle, Toast)
component
demoThemeConfigProviderfor state managementports.dart
Atomic Port Status Widget with Adaptive Layoutlib/page/dashboard/views/components/widgets/atomic/ports.dart
and device config
(detailed)
speed_test_widget.dart
Speed Test Widget Enhancements for Compact Displaylib/page/health_check/widgets/speed_test_widget.dart
showResultSummaryparameter to control result display visibilitysizes
retry button
layout_item_factory.dart
Layout Item Factory for Dashboard Widget Specificationslib/page/dashboard/providers/layout_item_factory.dart
WidgetSpecconstraints toLayoutItemformatWidgetSpecResolverfor dynamicspecs
algorithm
format
wifi_grid.dart
Fixed Layout WiFi Grid Componentlib/page/dashboard/views/components/fixed_layout/wifi_grid.dart
layout
theme_studio_panel.dart
Theme Studio Settings Panel with Configuration Managementlib/demo/theme_studio/theme_studio_panel.dart
Palette, Status, Components, Topology)
JSON
dashboard_home_view.dart
Dashboard Home View Layout Strategy Refactoringlib/page/dashboard/views/dashboard_home_view.dart
layouts
state
SliverDashboardViewfor custom layout renderingtopology.dart
Atomic Topology Widget with Mesh Visualizationlib/page/dashboard/views/components/widgets/atomic/topology.dart
(graph view)
control
demo_overrides.dart
Demo Provider Overrides for Router Integrationlib/demo/providers/demo_overrides.dart
demoRouterProvider2 files
widget_grid_constraints_test.dart
Widget Grid Constraints Unit Teststest/page/dashboard/models/widget_grid_constraints_test.dart
WidgetGridConstraintsmodel validationbase)
Intrinsic)
sliver_dashboard_controller_test.dart
Sliver Dashboard Controller Integration Teststest/page/dashboard/providers/sliver_dashboard_controller_test.dart
SliverDashboardControllerNotifierlayoutmanagement
creation
functionality
57 files