pgadmin-org / pgadmin-org/pgadmin4

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

Open
#9,130 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. First reproduce the tab-closing sequence with more tabs than fit on screen, then locate the UI handling for tab selection and closing. Done means closing a tab selects an adjacent tab and keeps the nearby tabs available without resetting the scroll position.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.