Describe the bug
In main.js, startFocusModePolling reads fmSettings.dimOpacity directly from persisted settings without clamping:
sendFocusModeOpacity(
typeof fmSettings.dimOpacity === 'number'
? fmSettings.dimOpacity
: 0.1
);
sanitizeSettings validates the type as number but applies no range constraint. A manually edited settings.json or a renderer sending a patch with dimOpacity: 0 makes the visualizer completely invisible when focus mode activates. A value above 1.0 may produce undefined CSS behavior.
To Reproduce
- Manually edit
settings.json and set focusMode.dimOpacity to 0.
- Enable focus mode.
- Become active (low idle time). The visualizer becomes completely invisible.
Expected behavior
dimOpacity should be clamped to a safe range (e.g., 0.05 to 0.9) in the sanitizer before it is read by focus mode polling.
Describe the bug
In
main.js,startFocusModePollingreadsfmSettings.dimOpacitydirectly from persisted settings without clamping:sanitizeSettingsvalidates the type asnumberbut applies no range constraint. A manually editedsettings.jsonor a renderer sending a patch withdimOpacity: 0makes the visualizer completely invisible when focus mode activates. A value above1.0may produce undefined CSS behavior.To Reproduce
settings.jsonand setfocusMode.dimOpacityto0.Expected behavior
dimOpacityshould be clamped to a safe range (e.g.,0.05to0.9) in the sanitizer before it is read by focus mode polling.