This repository was archived by the owner on Jul 2, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,13 +146,35 @@ async function findNotification(
146146 log ( `Error opening notifications center: ${ error } ` ) ;
147147 await executeQuickPick ( 'Notifications: Show Notifications' ) ;
148148 }
149+
150+ // Try the standard API first
149151 const notifications = await workbench . getNotifications ( ) ;
150152 for ( const notification of notifications ) {
151153 const notificationMessage = await notification . getMessage ( ) ;
152154 if ( message . test ( notificationMessage ) ) {
153155 return notification as unknown as Notification ;
154156 }
155157 }
158+
159+ // Fallback: workbench.getNotifications() looks at .notifications-toasts (ephemeral),
160+ // but notifications are in .notifications-center (persistent panel).
161+ // Query the notifications-center directly as a workaround for VS Code 1.102+.
162+ try {
163+ const browser = getBrowser ( ) ;
164+ const centerElements = await browser . findElements (
165+ By . css ( '.notifications-center .notification-list-item-message' )
166+ ) ;
167+ for ( const element of centerElements ) {
168+ const text = await element . getText ( ) ;
169+ if ( message . test ( text ) ) {
170+ // Found it! Return a minimal notification-like object
171+ return { getMessage : async ( ) => text } as unknown as Notification ;
172+ }
173+ }
174+ } catch {
175+ // DOM query failed, fall through to return null
176+ }
177+
156178 return null ;
157179 } ;
158180
You can’t perform that action at this time.
0 commit comments