From 6dd8b63f4ccc11814abc2d4f8ba24ce59d59aac1 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 1 Mar 2021 13:29:19 -0600 Subject: [PATCH 1/2] Add div for inner extension helper text The theme callback would set innerHTML on the header which wipes out the dismiss button. With an inner div we can replace the inner HTML without worrying about other elements in the header. Closes #2799. --- .../contrib/extensions/browser/extensionsViewlet.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index 618d0960..6f842c10 100644 --- a/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -466,11 +466,14 @@ export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IE helperHeader.style.fontWeight = '600'; helperHeader.style.padding = 'padding: 5px 16px'; helperHeader.style.position = 'relative'; + + const helperText = append(helperHeader, $('div')); + // We call this function because it gives us access to the current theme // Then we can apply the link color to the links in the helper header registerThemingParticipant((theme) => { const linkColor = theme.getColor(textLinkForeground); - helperHeader.innerHTML = ` + helperText.innerHTML = `

WARNING

@@ -481,6 +484,7 @@ export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IE

`; }); + const dismiss = append(helperHeader, $('span')); dismiss.innerHTML = 'Dismiss'; dismiss.style.display = 'block'; From c7d59e81dd67158a6c7f860dfbdb1d6bd00fd1b3 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 1 Mar 2021 13:39:18 -0600 Subject: [PATCH 2/2] Add tabIndex to extension help dismiss button This makes it accessible via keyboard. --- .../vs/workbench/contrib/extensions/browser/extensionsViewlet.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index 6f842c10..530a6298 100644 --- a/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -490,6 +490,7 @@ export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IE dismiss.style.display = 'block'; dismiss.style.textAlign = 'right'; dismiss.style.cursor = 'pointer'; + dismiss.tabIndex = 0; dismiss.onclick = () => { helperHeader.remove(); localStorage.setItem(extensionHelperLocalStorageKey, 'viewed');