Attached is the patch to improve user experience when opening query tool.
Previously, when the query tool button was clicked, the request went to backend, the connection was created and sent back to the UI. Until then, there was no activity on the UI. For slow servers it looked like pgAdmin is slow/struck.
With this change, the query tool will be opened instantaneously. Other things like opening the connection is done in parallel with query tool render, thus saving time.
The query tool connection status icon will show a spinner and text will have "Obtaining connection..." until the connection is established.