pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Closing a tab shouldn't reset the selection to the left-most tab

Open usernamesareaholdoverfromthe90s opened this issue 4 months ago • 1 comments

Test Case:

  1. Create a bunch of tabs (e.g., by right-clicking on a table, then selecting "View/Edit Data" | "Last 100 rows"). Do this until you have more tabs than can be displayed on the screen... e.g., try creating a dozen tabs
  2. Scroll over to the right-most tab
  3. Click the "X" to close the tab

Bug: Once closed, the left-most tab is now selected, which causes the tab scrolling to be reset and the tabs that were adjacent to the one that was just closed to be scrolled off screen.

This means that when I'm getting rid of some tabs from a recent line of investigation (e.g., I opened up a couple of tabs relating to a customer and their recent orders), I close a tab, and now have to rescroll back to the right in order to close the next tab, then have to rescroll to the right again to be able close the next one, the have to rescroll to the right again, etc.

To illustrate the annoyance, continue the provided test case by closing (in succession) a few more of the dozen tabs you created in the test case.

Expected behaviour: Closing a tab should cause an adjacent tab (either to the immediate right, if one exists, or to the immediate left) to be the new selection, rather than the left-most tab.

The rationale is that when investigating an issue, one typically runs multiple queries, so when you're done with a line of investigation, you'll want to close all the tabs that were opened as part of the investigation. So by leaving the selection as close as possible to where the deleted tab was means that it's now easy to click Close-Close-Close in quick succession to close all the tabs related to the investigation, rather than having to keep scrolling back to the tabs of interest after each close.

Match the behaviour with Chrome.

anilsahoo20 avatar Sep 05 '25 11:09 anilsahoo20