Skip to content

feat: add inactive window overlay to prevent misdirected shortcuts#213

Merged
j4rviscmd merged 1 commit into
mainfrom
feat/inactive-overlay
Jun 21, 2026
Merged

feat: add inactive window overlay to prevent misdirected shortcuts#213
j4rviscmd merged 1 commit into
mainfrom
feat/inactive-overlay

Conversation

@j4rviscmd

Copy link
Copy Markdown
Owner

Summary

Adds a full-screen modal overlay that appears when the Coderm window loses focus, blurring and dimming the workbench behind a centered "Not Active" card. This makes it obvious at a glance that keystrokes are no longer reaching this window, preventing accidental shortcut input into the actually-focused window — a frequent pitfall in keyboard-centric (Neovim/Vim) workflows.

Changes

  • New file src/vs/workbench/contrib/coderm/browser/inactiveOverlay.ts: Workbench contribution tracking window focus via IHostService.onDidChangeFocus and toggling a full-screen overlay (blurred + dimmed backdrop with a glass card). Follows the cursorAutoHide.ts template structure.
  • coderm.contribution.ts: registers the new contribution via side-effect import (alphabetical).
  • README.md / README.ja.md: documents the new settings (kept in sync).

New settings

Setting Type Default Description
coderm.inactiveOverlay.mode string "on" on (blur + dim) / off (disabled) / blur-off (dim only, no blur)
coderm.inactiveOverlay.delay number 300 Delay (ms) before showing the overlay after focus loss (0–5000)
coderm.inactiveOverlay.label boolean true Show the centered "Not Active" card
coderm.inactiveOverlay.dimming number 0.45 Backdrop darkness 0–1 (applies to both on/blur-off)

Implementation notes

  • Focus is tracked via IHostService.onDidChangeFocus only (covers main + auxiliary windows, already debounced via Event.latch); raw DOM blur/focus is intentionally avoided to prevent focus-recursion flicker.
  • The overlay holds no focusable element (tabindex-free), so focus is never stolen — the OS-level focus change is left to happen naturally.
  • The show path is delayed (delay ms, default 300) to avoid flicker during brief focus switches (e.g. Cmd+Tab); focus restoration hides immediately and cancels any pending show.

Verification

  • Compiles cleanly (npm run compile, 0 errors)
  • Manually verified: overlay appears on focus loss, disappears on focus restore
  • mode: blur-off shows dim-only; mode: off disables entirely
  • label: false hides the card; dimming adjusts darkness in real time

🤖 Generated with Claude Code

Show a full-screen modal overlay (blurred + dimmed backdrop with a
centered "Not Active" card) when the window loses focus, so the user
can tell at a glance that keystrokes are no longer reaching this
window. This prevents accidental shortcut input into the actually
focused window - a frequent pitfall in keyboard-centric workflows.

Adds coderm.inactiveOverlay.{mode,delay,label,dimming} settings, with
README.md / README.ja.md docs kept in sync.

Co-Authored-By: Claude <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the enhancement New feature or request label Jun 21, 2026
@j4rviscmd j4rviscmd merged commit c4a1004 into main Jun 21, 2026
3 checks passed
@j4rviscmd j4rviscmd deleted the feat/inactive-overlay branch June 21, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant