Source profileQuality 66/100

sonichi/sutando/skills/electron-overlay-dimming/SKILL.md

electron-overlay-dimming

Reusable pattern for focus-based auto-dimming of Electron overlay windows — when the app loses focus, all overlay windows fade to a low opacity; when an overlay regains focus, they return to their configured opacity. Use when building always-on-top Electron overlays that should recede while the user works in other apps.

Source repository stars
359
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

A small, self-contained pattern for always-on-top Electron overlays: the overlays stay readable while in use but fade out of the way when the user clicks into another application, and restore when focus returns to an overlay. First shipped in the benchmark-overlay app.

Best for

  • Use when building always-on-top Electron overlays that should recede while the user works in other apps.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/sonichi/sutando --skill "skills/electron-overlay-dimming"
Safe inspection promptEditorial

Inspect the Agent Skill "electron-overlay-dimming" from https://github.com/sonichi/sutando/blob/6a8f0fccd32e5aa620a3572c8885544f144bb6fe/skills/electron-overlay-dimming/SKILL.md at commit 6a8f0fccd32e5aa620a3572c8885544f144bb6fe. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Reference implementation (main process)

    Any code path that sets a window's opacity (e.g. a config handler) must route through effectiveOpacity() so opacity changes made while dimmed don't undim the window.

    Any code path that sets a window's opacity (e.g. a config handler) must route through effectiveOpacity() so opacity changes made while dimmed don't undim the window.
  2. 02

    Behaviour

    App loses focus (no overlay window is focused) → every overlay window's

    App loses focus (no overlay window is focused) → every overlay window'sFocus returns to any overlay → every overlay restores to its configured- App loses focus (no overlay window is focused) → every overlay window's opacity drops to a dim level (0.2). - Focus returns to any overlay → every overlay restores to its configured opacity (not blindly to 1.0 — it re…
  3. 03

    Why it's not naive

    Two pitfalls the pattern handles:

    Inter-overlay clicks. Clicking from overlay A to overlay B fires aConfigured opacity. Overlays may each have a user-set base opacity.Two pitfalls the pattern handles:
  4. 04

    Reference app

    Live implementation: /projects/benchmark-overlay/main.js — the benchmark-overlay app applies this across three overlay windows (AI Benchmarks, System Resources, Hub Overlay).

    Live implementation: /projects/benchmark-overlay/main.js — the benchmark-overlay app applies this across three overlay windows (AI Benchmarks, System Resources, Hub Overlay).

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score66/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars359SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
sonichi/sutando
Skill path
skills/electron-overlay-dimming/SKILL.md
Commit
6a8f0fccd32e5aa620a3572c8885544f144bb6fe
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

Electron Overlay Auto-Dimming

A small, self-contained pattern for always-on-top Electron overlays: the overlays stay readable while in use but fade out of the way when the user clicks into another application, and restore when focus returns to an overlay. First shipped in the benchmark-overlay app.

Behaviour

  • App loses focus (no overlay window is focused) → every overlay window's opacity drops to a dim level (~0.2).
  • Focus returns to any overlay → every overlay restores to its configured opacity (not blindly to 1.0 — it respects any per-overlay opacity the user set).

Why it's not naive

Two pitfalls the pattern handles:

  1. Inter-overlay clicks. Clicking from overlay A to overlay B fires a blur then a focus. Dimming on raw blur would flicker. The fix: on blur, defer ~80 ms and only dim if BrowserWindow.getFocusedWindow() is then null — i.e. the app truly lost focus, not just one window.
  2. Configured opacity. Overlays may each have a user-set base opacity. Auto-dim must dim from and restore to that value, so opacity is always computed as appDimmed ? DIM_OPACITY : overlay.config.opacity.

Reference implementation (main process)

const DIM_OPACITY = 0.2;
let appDimmed = false;

function effectiveOpacity(o) {
  return appDimmed ? DIM_OPACITY : o.config.opacity;
}

function applyOpacityAll() {
  for (const o of Object.values(OVERLAYS)) {
    if (o.win && !o.win.isDestroyed()) o.win.setOpacity(effectiveOpacity(o));
  }
}

app.on('browser-window-focus', () => {
  if (appDimmed) { appDimmed = false; applyOpacityAll(); }
});

app.on('browser-window-blur', () => {
  // Defer so an A→B overlay click doesn't briefly dim.
  setTimeout(() => {
    if (!appDimmed && !BrowserWindow.getFocusedWindow()) {
      appDimmed = true;
      applyOpacityAll();
    }
  }, 80);
});

Any code path that sets a window's opacity (e.g. a config handler) must route through effectiveOpacity() so opacity changes made while dimmed don't undim the window.

Reference app

Live implementation: ~/projects/benchmark-overlay/main.js — the benchmark-overlay app applies this across three overlay windows (AI Benchmarks, System Resources, Hub Overlay).