Skip to content

Bug: focusMode.dimOpacity is applied without bounds clamping, allowing the overlay to be set fully transparent (0.0) and become invisible to the user #122

@anshul23102

Description

@anshul23102

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

  1. Manually edit settings.json and set focusMode.dimOpacity to 0.
  2. Enable focus mode.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions