Skip to content

Commit c6567bc

Browse files
authored
notifications - compute height properly when progress is enabled (microsoft#186612)
1 parent 9fe9cea commit c6567bc

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/vs/workbench/browser/parts/notifications/notificationsList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { AriaRole } from 'vs/base/browser/ui/aria/aria';
2121
import { NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsCommands';
2222

2323
export interface INotificationsListOptions extends IListOptions<INotificationViewItem> {
24-
widgetAriaLabel?: string;
24+
readonly widgetAriaLabel?: string;
2525
}
2626

2727
export class NotificationsList extends Disposable {

src/vs/workbench/browser/parts/notifications/notificationsToasts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import { assertIsDefined } from 'vs/base/common/types';
2727
import { NotificationsToastsVisibleContext } from 'vs/workbench/common/contextkeys';
2828

2929
interface INotificationToast {
30-
item: INotificationViewItem;
31-
list: NotificationsList;
32-
container: HTMLElement;
33-
toast: HTMLElement;
30+
readonly item: INotificationViewItem;
31+
readonly list: NotificationsList;
32+
readonly container: HTMLElement;
33+
readonly toast: HTMLElement;
3434
}
3535

3636
enum ToastVisibility {

src/vs/workbench/browser/parts/notifications/notificationsViewer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export class NotificationsListDelegate implements IListVirtualDelegate<INotifica
8383
private computePreferredHeight(notification: INotificationViewItem): number {
8484

8585
// Prepare offset helper depending on toolbar actions count
86-
let actions = 1; // close
86+
let actions = 0;
87+
if (!notification.hasProgress) {
88+
actions++; // close
89+
}
8790
if (notification.canCollapse) {
8891
actions++; // expand/collapse
8992
}
@@ -132,8 +135,9 @@ export interface INotificationTemplateData {
132135
}
133136

134137
interface IMessageActionHandler {
138+
readonly toDispose: DisposableStore;
139+
135140
callback: (href: string) => void;
136-
toDispose: DisposableStore;
137141
}
138142

139143
class NotificationMessageRenderer {

0 commit comments

Comments
 (0)