fix: inactive overlay z-index broken by JS-style comment in CSS#215
Merged
Conversation
The CSS template literal used // Why: line comments, which CSS does not treat as comments. The parser discarded the following z-index: 10000 declaration, leaving the overlay at z-index: auto and hidden behind the workbench (.monaco-workbench has z-index: 1). Convert to /* Why: ... */ so z-index: 10000 applies and the overlay renders above the workbench in production builds. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The inactive window overlay (added in #213) was invisible in production builds. When the window lost focus, the overlay element was created and
coderm-inactive-overlay-visiblewas applied, but it stayed hidden behind the workbench.Root Cause
The overlay CSS is injected via a template literal. The
z-index: 10000declaration was preceded by JS-style// Why:comments:CSS only recognizes
/* */comments. The parser treated//as an invalid token and discarded the entire declaration up to the next;— which was thez-index: 10000;terminator. As a resultz-indexfell back toauto(≈0), and since.monaco-workbenchhasz-index: 1, the overlay rendered behind the workbench and was never visible.This only surfaced in production: the dev build's simpler stacking context let
z-index: autostill appear on top, but the full production workbench creates az-index: 1stacking context that hid the overlay.Fix
Convert the
// Why:lines to CSS-valid/* Why: ... */so the parser no longer discardsz-index: 10000.Verification
z-indexcomputed value went fromauto→10000after the fix🤖 Generated with Claude Code