Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Closing first Query tab never warns of unsaved changes. #231
Steps to reproduce this issue
The tab closes without any warning of unsaved content.
Attempting to close the tab should warn of unsaved changes and prompt if user wants to save content.
Validate unsaved changes as any other tab,.
NO! the option IS active, and it DOES work for every other tab.
But it does NOT work in THE FIRST query tab (it doesn't prompt and clears the content).
I mentioned that particularity in the problem description. it only happens with the first tab.
Please try to replicate it, just write anything on the first Query tab, and without saving the content, double click the tab itself. It will clear the tab contents without prompting or warning anything. The tab itself never closes, but the content does disappear.
Please reopen the issue since it is not solved.
I did not do that doubleclick again. And yes, it's not warning me when doubleclicking the tab. The reason for not asking on that special first tab was that it is not closable anyway (intentionally). So, after the content is gone, you can get it back via undo (Ctrl+Z).
Even if we can get the content back with Ctrl+Z (which btw is quite unintuitive), i think it should always warn if the contents would be lost (or clear) for whichever tab (honoring the setting).
Or if the tab is meant to never close, it then never should clear the content by double clicking it (just as it doesn't have the 'Close query tab' item when right clicking, or not having the 'x' control to close it) That way, the only method to close the tab (and potentially lose content) would be when closing Heidi.
referenced this issue
Apr 20, 2018
@anselal Wow, that's true!
I guess the behavior is that the tab attempts to close, but since it can't, it somehow doesn't warn anything but it still clears its content. (the same that happened when double-clicking it)
Maybe the tab should be allowed to close just as any other, triggering the same warnings and behaviors as the rest (having a close button, have the "close query tab" right click item, closing via double-click or Ctrl+W (as it is common in tons of programs), etc.
I don't know the reason it is not meant to close, @ansgarbecker has mentioned it is intentional, but personally I see no problem in closing it (from an end user point of view), I don't know if there are technical reasons to not close it.
But ultimately, there is always the "open a blank query tab" button in the tab bar, as well as the "open query tab - Ctrl+T" item in the File menu. So even if someone closes ALL tabs, you can always open new ones.
So I vote to treat the first tab exactly as all others, with the same behaviors and warnings, including closing it.
IMO you could always create one initial empty one, as it is now. But allow to close it as any other tabs.
If users close it, it would be on purpose, not by accident (because attempting to close it with unsaved data will warn them), and they would need to open a new one on their own, as expected.
I think it is more intuitive that way instead of accidentally pressing Ctrl+W and losing the unsaved content (without a warning), not being aware that Ctrl+Z could restore it.
@albertdick indeed! but its the same point. I mean you can 'accidentally' attempt to close it, without saving changes. If it was already saved, its no problem because you could simply reopen it.
If the tab is 'closeable', it will warn of unsaved changes (by any method, 'x' corner, double-click, ctrl+w, and whatever other method for closing tabs I'm unaware of).
But if it is not closable, it simply doesn't warn anything and clears the content (and keeps the tab).
Of course all the "close" methods could be disabled for the first tab, in this case Ctrl+W. Just as the 'x' and double click are already disabled.
But IMO its non ideal. It is not intuitive at all not being able to close every single tab. and even less that a "closing" event doesn't warn anything and just clears the content.