Merge branch 'main' into fix/suggestion-sort

This commit is contained in:
Chapman Pendery 2024-03-22 23:15:42 -07:00 committed by GitHub
commit 9203d2d93a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 21 deletions

View file

@ -222,13 +222,12 @@ export class BannerPart extends Part implements IBannerService {
}
// Action
if (!item.disableCloseAction) {
const actionBarContainer = append(this.element, $('div.action-container'));
this.actionBar = this._register(new ActionBar(actionBarContainer));
const closeAction = this._register(new Action('banner.close', 'Close Banner', ThemeIcon.asClassName(widgetClose), true, () => this.close(item)));
this.actionBar.push(closeAction, { icon: true, label: false });
this.actionBar.setFocusable(false);
}
const actionBarContainer = append(this.element, $('div.action-container'));
this.actionBar = this._register(new ActionBar(actionBarContainer));
const label = item.closeLabel ?? 'Close Banner';
const closeAction = this._register(new Action('banner.close', label, ThemeIcon.asClassName(widgetClose), true, () => this.close(item)));
this.actionBar.push(closeAction, { icon: true, label: false });
this.actionBar.setFocusable(false);
this.setVisibility(true);
this.item = item;

View file

@ -21,6 +21,7 @@ import Severity from 'vs/base/common/severity';
const REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY = 'remote.unsupportedConnectionChoice';
const BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY = 'workbench.banner.remote.unsupportedConnection.dismissed';
export class InitialRemoteConnectionHealthContribution implements IWorkbenchContribution {
@ -90,19 +91,27 @@ export class InitialRemoteConnectionHealthContribution implements IWorkbenchCont
allowed = await this._confirmConnection();
}
if (allowed) {
const actions = [
{
label: localize('unsupportedGlibcBannerLearnMore', "Learn More"),
href: 'https://aka.ms/vscode-remote/faq/old-linux'
}
];
this.bannerService.show({
id: 'unsupportedGlibcWarning.banner',
message: localize('unsupportedGlibcWarning.banner', "You are connected to an OS version that is unsupported by {0}.", this.productService.nameLong),
actions,
icon: Codicon.warning,
disableCloseAction: true
});
const bannerDismissedVersion = this.storageService.get(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, StorageScope.PROFILE) ?? '';
// Ignore patch versions and dismiss the banner if the major and minor versions match.
const shouldShowBanner = bannerDismissedVersion.slice(0, bannerDismissedVersion.lastIndexOf('.')) !== this.productService.version.slice(0, this.productService.version.lastIndexOf('.'));
if (shouldShowBanner) {
const actions = [
{
label: localize('unsupportedGlibcBannerLearnMore', "Learn More"),
href: 'https://aka.ms/vscode-remote/faq/old-linux'
}
];
this.bannerService.show({
id: 'unsupportedGlibcWarning.banner',
message: localize('unsupportedGlibcWarning.banner', "You are connected to an OS version that is unsupported by {0}.", this.productService.nameLong),
actions,
icon: Codicon.warning,
closeLabel: `Do not show again in v${this.productService.version}`,
onClose: () => {
this.storageService.store(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, this.productService.version, StorageScope.PROFILE, StorageTarget.MACHINE);
}
});
}
} else {
this.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });
return;

View file

@ -16,7 +16,7 @@ export interface IBannerItem {
readonly actions?: ILinkDescriptor[];
readonly ariaLabel?: string;
readonly onClose?: () => void;
readonly disableCloseAction?: boolean;
readonly closeLabel?: string;
}
export const IBannerService = createDecorator<IBannerService>('bannerService');