Repository: nebari-dev/jupyterlab-launchpad (language: python)

Issue:
Initial state of visible columns is off
The columns which are hidden by default incorrectly show up as visible in the context menu, e.g. Environment Path below:

![image](https://github.com/nebari-dev/jupyterlab-new-launcher/assets/5832902/74807dad-052c-4f52-9c25-831dbcca81c8)



Discussion / hints:

Fix patch:
diff --git a/src/commands.ts b/src/commands.ts
index 0745b7b..1f134cd 100644
--- a/src/commands.ts
+++ b/src/commands.ts
@@ -26,7 +26,7 @@ export function addCommands(
         return console.error('Column ID missing');
       }
       const columns =
-        (settings.user.hiddenColumns as
+        (settings.composite.hiddenColumns as
           | ISettingsLayout['hiddenColumns']
           | undefined) ?? {};
       if (columns[id] === 'visible' || !columns[id]) {
@@ -44,7 +44,7 @@ export function addCommands(
         return false;
       }
       const columns =
-        (settings.user.hiddenColumns as
+        (settings.composite.hiddenColumns as
           | ISettingsLayout['hiddenColumns']
           | undefined) ?? {};
       return columns[id] !== 'hidden';
diff --git a/src/components/table.tsx b/src/components/table.tsx
index 33d607a..940e371 100644
--- a/src/components/table.tsx
+++ b/src/components/table.tsx
@@ -315,7 +315,9 @@ export function KernelTable(props: {
         onContextMenu={(event: React.MouseEvent) => {
           event.preventDefault();
           const contextMenu = new MenuSvg({ commands: props.commands });
+          contextMenu.addClass('jp-NewLauncher-contextMenu');
           const columnsSubMenu = new MenuSvg({ commands: props.commands });
+          columnsSubMenu.addClass('jp-NewLauncher-contextMenu-visibleColumns');
           for (const column of columns) {
             columnsSubMenu.addItem({
               command: CommandIDs.toggleColumn,


Test patch:
diff --git a/ui-tests/tests/jupyterlab_new_launcher.spec.ts b/ui-tests/tests/jupyterlab_new_launcher.spec.ts
index 904b590..a3ec91e 100644
--- a/ui-tests/tests/jupyterlab_new_launcher.spec.ts
+++ b/ui-tests/tests/jupyterlab_new_launcher.spec.ts
@@ -7,6 +7,29 @@ test.describe('Default settings', () => {
     const launcher = page.locator('.jp-LauncherBody');
     expect(await launcher.screenshot()).toMatchSnapshot('launcher.png');
   });
+
+  test('should open table context menu', async ({ page }) => {
+    const tableHead = page.locator(
+      '.jp-Launcher-launchNotebook thead > tr > th[data-id="star"]'
+    );
+    await tableHead.click({ button: 'right' });
+    const contextMenu = page.locator('.jp-NewLauncher-contextMenu');
+    await expect(contextMenu).toBeVisible();
+    expect
+      .soft(await contextMenu.screenshot())
+      .toMatchSnapshot('table-context-menu.png');
+    const visibleColumnsEntry = page.locator(
+      '.jp-NewLauncher-contextMenu li >> text="Visible Columns"'
+    );
+    await visibleColumnsEntry.hover();
+    const columnsContextMenu = page.locator(
+      '.jp-NewLauncher-contextMenu-visibleColumns'
+    );
+    await expect(columnsContextMenu).toBeVisible();
+    expect
+      .soft(await columnsContextMenu.screenshot())
+      .toMatchSnapshot('table-context-menu-visible-columns.png');
+  });
 });
 
 test.describe('With starred section', () => {
diff --git a/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-linux.png b/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-linux.png
new file mode 100644
index 0000000..cdff52c
Binary files /dev/null and b/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-linux.png differ
diff --git a/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-visible-columns-linux.png b/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-visible-columns-linux.png
new file mode 100644
index 0000000..91aa78d
Binary files /dev/null and b/ui-tests/tests/jupyterlab_new_launcher.spec.ts-snapshots/table-context-menu-visible-columns-linux.png differ