Repository: jupyterlab/jupyterlab-git (language: python)

Issue:
"Detailed message" is an empty popup after pushing changes
## Description

"Detailed message" is an empty popup after pushing changes

## Reproduce

1. Commit changes
2. Push changes
3. Click on red "details" button in toast notification
  ![image](https://github.com/jupyterlab/jupyterlab-git/assets/5832902/40f47b99-b8b3-4744-a006-ceae2eb111c9)
5. See empty popup:
![image](https://github.com/jupyterlab/jupyterlab-git/assets/5832902/cb02b9c4-a124-416a-9ca2-198f7101056f)

![image](https://github.com/jupyterlab/jupyterlab-git/assets/5832902/036e4852-c817-4c28-b7e3-dae8fe6e541e)

## Expected behavior

The pop-up is not empty, or the button is not shown in the first place if there is nothing to show.

## Context

50.0.0rc0


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 575abe18c..62d3ac11f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -168,3 +168,5 @@ jobs:
       - uses: actions/checkout@v4
       - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
       - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
+        with:
+          ignore_links: https://www.linkedin.com/.*
diff --git a/README.md b/README.md
index 65c8a60cc..c966cdc3c 100644
--- a/README.md
+++ b/README.md
@@ -315,7 +315,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
     <tr>
       <td align="center" valign="top" width="14.28%"><a href="https://dquach.dev"><img src="https://avatars.githubusercontent.com/u/6735818?v=4?s=100" width="100px;" alt="Dat Quach"/><br /><sub><b>Dat Quach</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=quachtridat" title="Code">💻</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://github.com/fcollonval"><img src="https://avatars1.githubusercontent.com/u/8435071?v=4?s=100" width="100px;" alt="Frédéric Collonval"/><br /><sub><b>Frédéric Collonval</b></sub></a><br /><a href="#maintenance-fcollonval" title="Maintenance">🚧</a></td>
-      <td align="center" valign="top" width="14.28%"><a href="https://github.com/hzarea"><img src="https://avatars1.githubusercontent.com/u/27518229?v=4?s=100" width="100px;" alt="Hana Zarea"/><br /><sub><b>Hana Zarea</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=hzarea" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ahzarea" title="Reviewed Pull Requests">👀</a></td>
+      <td align="center" valign="top" width="14.28%"><img src="https://avatars1.githubusercontent.com/u/27518229?v=4?s=100" width="100px;" alt="Hana Zarea"/><br /><sub><b>Hana Zarea</b></sub><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=hzarea" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ahzarea" title="Reviewed Pull Requests">👀</a></td>
       <td align="center" valign="top" width="14.28%"><a href="http://ianhi.github.io"><img src="https://avatars0.githubusercontent.com/u/10111092?v=4?s=100" width="100px;" alt="Ian Hunt-Isaak"/><br /><sub><b>Ian Hunt-Isaak</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=ianhi" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Aianhi" title="Reviewed Pull Requests">👀</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://github.com/jaipreet-s"><img src="https://avatars1.githubusercontent.com/u/43826141?v=4?s=100" width="100px;" alt="Jaipreet Singh"/><br /><sub><b>Jaipreet Singh</b></sub></a><br /><a href="#projectManagement-jaipreet-s" title="Project Management">📆</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ajaipreet-s" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=jaipreet-s" title="Code">💻</a> <a href="#design-jaipreet-s" title="Design">🎨</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://github.com/zzhangjii"><img src="https://avatars3.githubusercontent.com/u/11495372?v=4?s=100" width="100px;" alt="Ji Zhang"/><br /><sub><b>Ji Zhang</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=zzhangjii" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Azzhangjii" title="Reviewed Pull Requests">👀</a></td>
@@ -327,7 +327,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
       <td align="center" valign="top" width="14.28%"><a href="https://www.lindaful.com"><img src="https://avatars.githubusercontent.com/u/68607795?v=4?s=100" width="100px;" alt="Linda Ngoc Nguyen"/><br /><sub><b>Linda Ngoc Nguyen</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=iflinda" title="Code">💻</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://fellowship.mlh.io/"><img src="https://avatars.githubusercontent.com/u/65834464?s=200&v=4?s=100" width="100px;" alt="Major League Hacking"/><br /><sub><b>Major League Hacking</b></sub></a><br /><a href="#financial-mlh" title="">🤝</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/max-klein-b514419"><img src="https://avatars2.githubusercontent.com/u/2263641?v=4?s=100" width="100px;" alt="Max Klein"/><br /><sub><b>Max Klein</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=telamonian" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Atelamonian" title="Reviewed Pull Requests">👀</a> <a href="#projectManagement-telamonian" title="Project Management">📆</a> <a href="#design-telamonian" title="Design">🎨</a> <a href="#infra-telamonian" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
-      <td align="center" valign="top" width="14.28%"><a href="http://linkedin.com/in/michal-krassowski/"><img src="https://avatars.githubusercontent.com/u/5832902?v=4?s=100" width="100px;" alt="Michał Krassowski"/><br /><sub><b>Michał Krassowski</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=krassowski" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Akrassowski" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/issues?q=author%3Akrassowski" title="Bug reports">🐛</a></td>
+      <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/michal-krassowski/"><img src="https://avatars.githubusercontent.com/u/5832902?v=4?s=100" width="100px;" alt="Michał Krassowski"/><br /><sub><b>Michał Krassowski</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=krassowski" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Akrassowski" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/issues?q=author%3Akrassowski" title="Bug reports">🐛</a></td>
       <td align="center" valign="top" width="14.28%"><a href="https://navn.me"><img src="https://avatars.githubusercontent.com/u/59669957?v=4?s=100" width="100px;" alt="Navinn Ravindaran"/><br /><sub><b>Navinn Ravindaran</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=navn-r" title="Code">💻</a></td>
     </tr>
     <tr>
diff --git a/src/notifications.ts b/src/notifications.ts
index 506683e7f..89a84ed2e 100644
--- a/src/notifications.ts
+++ b/src/notifications.ts
@@ -28,22 +28,34 @@ export function showError(
   };
 }
 
+/**
+ * Display additional information in a dialog from a notification
+ * button.
+ *
+ * Note: it will not add a button if the message is empty.
+ *
+ * @param message Details to display
+ * @param trans Translation object
+ * @returns Notification option to display the message
+ */
 export function showDetails(
   message: string,
   trans: TranslationBundle
 ): Notification.IOptions<null> {
-  return {
-    autoClose: 5000,
-    actions: [
-      {
-        label: trans.__('Details'),
-        callback: () => {
-          showErrorMessage(trans.__('Detailed message'), message, [
-            Dialog.okButton({ label: trans.__('Dismiss') })
-          ]);
-        },
-        displayType: 'warn'
-      } as Notification.IAction
-    ]
-  };
+  return message
+    ? {
+        autoClose: 5000,
+        actions: [
+          {
+            label: trans.__('Details'),
+            callback: () => {
+              showErrorMessage(trans.__('Detailed message'), message, [
+                Dialog.okButton({ label: trans.__('Dismiss') })
+              ]);
+            },
+            displayType: 'warn'
+          } as Notification.IAction
+        ]
+      }
+    : {};
 }


Test patch:
diff --git a/ui-tests/tests/merge-commit.spec.ts b/ui-tests/tests/merge-commit.spec.ts
index 8a10f3857..e4992cbde 100644
--- a/ui-tests/tests/merge-commit.spec.ts
+++ b/ui-tests/tests/merge-commit.spec.ts
@@ -67,7 +67,7 @@ test.describe('Merge commit tests', () => {
       .getByRole('tab', { name: 'hello-world.py' })
       .waitFor({ state: 'visible' });
 
-    expect(page.waitForSelector('.jp-git-diff-root')).toBeTruthy();
+    await expect(page.locator('.jp-git-diff-root')).toBeVisible();
   });
 
   test('should revert merge commit', async ({ page }) => {
@@ -92,8 +92,6 @@ test.describe('Merge commit tests', () => {
       .locator('#jp-git-sessions')
       .getByText("Revert 'Merge branch 'sort-names''");
 
-    await revertMergeCommit.waitFor({ state: 'visible' });
-
-    expect(revertMergeCommit).toBeTruthy();
+    await expect(revertMergeCommit).toBeVisible();
   });
 });