Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor dimming should be a core workbench feature #191757

Closed
bpasero opened this issue Aug 30, 2023 · 4 comments
Closed

Editor dimming should be a core workbench feature #191757

bpasero opened this issue Aug 30, 2023 · 4 comments
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues debt Code quality issues *duplicate Issue identified as a duplicate of another issue(s) workbench-dim-unfocused Related to the accessibility.dimUnfocused.* feature
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Aug 30, 2023

It looks like today the editor dimming is done from the outside via explicit knowledge of CSS selectors which is prone to breaking easily. Every new editor would have to be adopted here. This should rather be an option that every editor has to support built-in and then this CSS patching should go away.

Refs:

if (opacity !== 1) {
// These filter rules are more specific than may be expected as the `filter`
// rule can cause problems if it's used inside the element like on editor hovers
const rules = new Set<string>();
const filterRule = `filter: opacity(${opacity});`;
// Terminal tabs
rules.add(`.monaco-workbench .pane-body.integrated-terminal:not(:focus-within) .tabs-container { ${filterRule} }`);
// Terminals
rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`);
// Text editors
rules.add(`.monaco-workbench .editor-group-container:not(.active) .monaco-editor { ${filterRule} }`);
// Breadcrumbs
rules.add(`.monaco-workbench .editor-group-container:not(.active) .tabs-breadcrumbs { ${filterRule} }`);
// Terminal editors
rules.add(`.monaco-workbench .editor-group-container:not(.active) .terminal-wrapper { ${filterRule} }`);
// Settings editor
rules.add(`.monaco-workbench .editor-group-container:not(.active) .settings-editor { ${filterRule} }`);
// Keybindings editor
rules.add(`.monaco-workbench .editor-group-container:not(.active) .keybindings-editor { ${filterRule} }`);
// Editor placeholder (error case)
rules.add(`.monaco-workbench .editor-group-container:not(.active) .monaco-editor-pane-placeholder { ${filterRule} }`);
// Welcome editor
rules.add(`.monaco-workbench .editor-group-container:not(.active) .gettingStartedContainer { ${filterRule} }`);
cssTextContent = [...rules].join('\n');
}

//cc @jrieken

@bpasero bpasero added the debt Code quality issues label Aug 30, 2023
@jrieken
Copy link
Member

jrieken commented Aug 30, 2023

Could this be implemented on the level of workbench parts? I believe there is a pretty good abstraction for those and dimming could be a click-through (pointer-events: none) overlay on top of inactive parts

@Tyriar
Copy link
Member

Tyriar commented Aug 30, 2023

It was much simpler initially but it turns out that using filter on an editor instance can impact the contents like the hover's position.

@jrieken interesting idea, right now the only workbench part that is dimmed is the terminal by design. This could be a nice solution to the iframe and above hover position problem though 👍

@Tyriar Tyriar added this to the September 2023 milestone Aug 30, 2023
@Tyriar Tyriar added the accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues label Aug 30, 2023
@Tyriar Tyriar modified the milestones: September 2023, Backlog Sep 25, 2023
@Tyriar Tyriar added the workbench-dim-unfocused Related to the accessibility.dimUnfocused.* feature label Dec 19, 2024
@Tyriar
Copy link
Member

Tyriar commented Dec 19, 2024

Merging into #236576

/duplicate

@vs-code-engineering vs-code-engineering bot added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 19, 2024
Copy link

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues debt Code quality issues *duplicate Issue identified as a duplicate of another issue(s) workbench-dim-unfocused Related to the accessibility.dimUnfocused.* feature
Projects
None yet
Development

No branches or pull requests

3 participants