inav-configurator icon indicating copy to clipboard operation
inav-configurator copied to clipboard

Refactor tab loading and reboot

Open Scavanger opened this issue 1 month ago • 2 comments

User description

Some refactoring for tabs and (re)enable proper reboot

  • Refactor tabs as proper modules, get rid of global TAB variable. helps vite to optimize
  • Remove unused ez-tune tab check
  • Removed special reboot logic for old, unsupported FCs,
  • Make sure modal "Device rebooting" dialog is always shown correctly, even in CLI tab
  • After "save and reboot" corresponding tab is loaded after reboot
  • Tab switching in CLI tab works now (with reboot in between)
  • Add confirmation dialog for reboot when switching mixer profile

PR Type

Enhancement


Description

  • Refactor tabs from global TABS object to individual module exports

  • Replace dynamic imports with static preloading for better optimization

  • Improve tab switching logic with proper cleanup and reconnection handling

  • Add confirmation dialog for mixer profile changes requiring reboot

  • Fix CLI tab exit behavior and reboot handling across all tabs


Diagram Walkthrough

flowchart LR
  A["Global TABS object"] -->|"Refactor to"| B["Individual tab modules"]
  B -->|"Export as"| C["Named exports"]
  D["Dynamic imports"] -->|"Replace with"| E["Static preloading"]
  E -->|"In"| F["configurator_main.js"]
  G["Tab switching"] -->|"Improved with"| H["Proper cleanup"]
  H -->|"And"| I["Reconnection logic"]
  J["Mixer profile change"] -->|"Add"| K["Confirmation dialog"]
  K -->|"Trigger"| I

File Walkthrough

Relevant files
Enhancement
48 files
firmware_flasher.js
Convert to module with named export                                           
+37/-34 
mission_control.js
Convert to module with named export                                           
+30/-28 
led_strip.js
Convert to module with named export                                           
+33/-32 
cli.js
Refactor CLI tab with exit method                                               
+52/-48 
advanced_tuning.js
Convert to module with named export                                           
+18/-16 
gps.js
Convert to module with named export                                           
+15/-12 
search.js
Convert to module with named export                                           
+15/-15 
pid_tuning.js
Convert to module with named export                                           
+17/-14 
calibration.js
Convert to module with named export                                           
+15/-12 
mixer.js
Convert to module with named export                                           
+10/-15 
onboard_logging.js
Convert to module with named export                                           
+9/-8     
receiver.js
Convert to module with named export                                           
+12/-10 
setup.js
Convert to module with named export                                           
+13/-10 
outputs.js
Convert to module with named export                                           
+14/-11 
osd.js
Convert to module with named export                                           
+13/-6   
ports.js
Convert to module with named export                                           
+9/-8     
magnetometer.js
Convert to module with named export                                           
+10/-9   
configuration.js
Convert to module with named export                                           
+9/-8     
failsafe.js
Convert to module with named export                                           
+9/-7     
auxiliary.js
Convert to module with named export                                           
+10/-6   
javascript_programming.js
Convert to module with named export                                           
+7/-5     
sensors.js
Convert to module with named export                                           
+9/-6     
programming.js
Convert to module with named export                                           
+9/-7     
sitl.js
Convert to module with named export                                           
+9/-6     
adjustments.js
Convert to module with named export                                           
+10/-6   
logging.js
Convert to module with named export                                           
+9/-6     
landing.js
Convert to module with named export                                           
+8/-7     
configurator_main.js
Preload all tabs and refactor tab switching                           
+80/-61 
serial_backend.js
Refactor reconnect logic and tab reopening                             
+50/-59 
stm32usbdfu.js
Update to use imported firmware flasher tab                           
+17/-16 
gui.js
Remove global TABS object, export GUI only                             
+2/-5     
defaults_dialog.js
Update imports and async initialization                                   
+13/-14 
stm32.js
Update GUI import statement                                                           
+1/-1     
logicCondition.js
Update GUI import statement                                                           
+1/-1     
groundstation.js
Update GUI import statement                                                           
+1/-1     
programmingPid.js
Update GUI import statement                                                           
+1/-1     
settings.js
Update GUI import statement                                                           
+1/-1     
MSPHelper.js
Update GUI import statement                                                           
+1/-1     
connectionUdp.js
Update GUI import statement                                                           
+1/-1     
periodicStatusUpdater.js
Update GUI import statement                                                           
+1/-1     
UBLOX.js
Update GUI import statement                                                           
+1/-1     
appUpdater.js
Update GUI import statement                                                           
+1/-1     
connectionTcp.js
Update GUI import statement                                                           
+1/-1     
connectionSerial.js
Update GUI import statement                                                           
+1/-1     
port_handler.js
Update GUI import statement                                                           
+1/-1     
connectionBle.js
Update GUI import statement                                                           
+1/-1     
connection.js
Update GUI import statement                                                           
+1/-1     
sitl.js
Update GUI import statement                                                           
+1/-1     
Documentation
1 files
messages.json
Add mixer profile reboot confirmation message                       
+3/-0     

Scavanger avatar Dec 05 '25 12:12 Scavanger