Description
Restoring default settings disables Focus Mode in the saved configuration but does not stop the active main-process Focus Mode polling interval.
The polling timer created by startFocusModePolling() continues running every second after Restore Defaults is used, even though the restored settings have Focus Mode disabled. This results in unnecessary background work and leaves the Focus Mode lifecycle out of sync with the current configuration.
Relevant Code Paths
settings.js invokes the restore-defaults IPC operation.
main.js calls resetAllSettings().
resetAllSettings() replaces the settings with defaults but does not call applyFocusModeState() or stopFocusModePolling().
- The existing Focus Mode interval therefore remains active until the application exits.
Steps to Reproduce
- Launch Paraline.
- Open Settings and enable Focus Mode.
- Confirm that the Focus Mode polling callback is running (via debugger, logging, or inspection).
- Click Restore Defaults and confirm the action.
- Observe that Focus Mode is disabled in the restored settings, but the polling callback continues executing every second.
Expected Behavior
- Restoring defaults should stop any active Focus Mode polling interval.
- The visualizer should return to full opacity.
- Runtime behavior should match the restored configuration.
Actual Behavior
- Focus Mode is disabled in the restored settings.
- The existing polling interval remains active and continues firing every second until the application exits.
Suggested Fix
After restoring default settings, reapply the Focus Mode lifecycle by calling applyFocusModeState() (or otherwise ensuring stopFocusModePolling() is invoked when Focus Mode is disabled).
Testing
- Verify that restoring defaults clears the active Focus Mode polling interval.
- Verify that visualizer opacity is restored to
1.0.
- Verify that Focus Mode can still be re-enabled normally after restoring defaults.
Environment
- Repo version / commit:
68edfe4
Description
Restoring default settings disables Focus Mode in the saved configuration but does not stop the active main-process Focus Mode polling interval.
The polling timer created by
startFocusModePolling()continues running every second after Restore Defaults is used, even though the restored settings have Focus Mode disabled. This results in unnecessary background work and leaves the Focus Mode lifecycle out of sync with the current configuration.Relevant Code Paths
settings.jsinvokes the restore-defaults IPC operation.main.jscallsresetAllSettings().resetAllSettings()replaces the settings with defaults but does not callapplyFocusModeState()orstopFocusModePolling().Steps to Reproduce
Expected Behavior
Actual Behavior
Suggested Fix
After restoring default settings, reapply the Focus Mode lifecycle by calling
applyFocusModeState()(or otherwise ensuringstopFocusModePolling()is invoked when Focus Mode is disabled).Testing
1.0.Environment
68edfe4