This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 144829 - Don't open new dataview tab for every query
Summary: Don't open new dataview tab for every query
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: UI
Depends on: 146312
Blocks:
  Show dependency tree
 
Reported: 2008-08-22 11:19 UTC by Petr Blaha
Modified: 2008-09-10 06:09 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (183.29 KB, image/png)
2008-08-22 11:20 UTC, Petr Blaha
Details
Proposed changes (18.50 KB, text/plain)
2008-09-05 13:08 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2008-08-22 11:19:26 UTC
Current SQL editor implementation opens new dataview tab for every SQL query. However, the common use case is that users
tune the SQL query and want to see new result set and don't need to compare set to previous query often. See the
attached screenshot with several tabs that just reduced the area where dataview would be displayed. There should be
option if you want to open new view tab for every query.
Comment 1 Petr Blaha 2008-08-22 11:20:05 UTC
Created attachment 68098 [details]
screenshot
Comment 2 Roman Mostyka 2008-08-22 11:32:31 UTC
I think it's better to have different tabs for different queries. For example user want to compare results from 2
queries. However I think new results tab for the same query shouldn't be opened. Now if you run, for example, the same
query 3 times, 3 results tab will be opened.
Comment 3 Andrei Badea 2008-08-22 12:11:03 UTC
The spec of the integration of dataview with the SQL editor planned to have a button in the toolbar to determine whether
to automatically close tabs from previous executions. It seems the button was never implemented. Do we still want to do it?
Comment 4 David Vancouvering 2008-08-25 19:31:32 UTC
Yes, it would be great to implement that if time permits.  I think that slipped through the cracks.  

The workaround for now is you can right-click on any tab and choose "Close Tabs for Previous Executions."
Comment 5 Rob Englander 2008-08-25 20:13:46 UTC
I think I'll add my two cents worth on this one...

Forgive me if this is covered in the integration spec that was referenced.  Where might I find that?

Anyway, I think it would be a good idea to look at the SQL statement and attempt to determine if the
statement that is about to be executed has an existing corresponding tab.  If so, the contents of that
existing tab should be replaced with the new results and that tab should be brought forward.

I think that ends my 2 cents, but you never know.
Comment 6 John Baker 2008-08-29 23:54:40 UTC
is this a feature or enhancement ?
Comment 7 David Vancouvering 2008-08-30 00:08:16 UTC
I think it's a defect because it was supposed to be an option we were going to provide as part of this feature and we
didn't do it.  I agree with Petr's concerns that the common use case is to *not* see a new tab for each execution.
Comment 8 Andrei Badea 2008-09-01 14:32:01 UTC
Re desc6: I think the most common use case is an user creating a non-trivial SELECT statement. The user edits the
statement, then runs it to check if it is correct, then edits, runs, etc. The statement is likely to be modified before
each execution, so the proposal to try to match it with an existing tab would not help.
Comment 9 David Vancouvering 2008-09-02 20:49:27 UTC
We're at UI freeze, and at this point I don't believe I can justify this UI change.  Petr, others, what is your take on
this?
Comment 10 Andrei Badea 2008-09-02 23:25:48 UTC
Why not? Impact seems pretty high, and it is unlikely this breaks a lot of documentation. Perhaps you should check with
James.
Comment 11 David Vancouvering 2008-09-03 00:49:02 UTC
I wasn't convinced of the high impact - it's easy enough to close other tabs if it gets to be too many.

But if James is OK with doing it, then let's do it, I'm all for making our product as usable as possible.

Adding it to the late UI change page.
Comment 12 Andrei Badea 2008-09-03 10:30:29 UTC
The usability impact I meant. When you are focusing on fixing a SELECT statement in the edit-fix-edit-fix cycle, having
to manually close the tabs, even from time to time, becomes very annoying. Well, at least IMHO. Also, this behavior
differs from the one in previous versions. Releasing 6.5 with the new behavior knowing that it is wrong for most users
looks like a bad idea.
Comment 13 David Vancouvering 2008-09-03 21:56:05 UTC
So, I just want to clarify what it is we want here.  We were going to add as a toolbar to the top of the SQL editor. 
This would toggle the behavior as follows:

- Each execution uses the same results tab
- Each execution creates a new results tab

I'll assume this is correct, but someone speak up if that's not their recollection. I'll post an email to dev@db as well.
Comment 14 James Branam 2008-09-04 11:06:47 UTC
We should probably decide this very soon if you want me to document it. Help freeze is coming up very fast (Sep. 8).
Comment 15 David Vancouvering 2008-09-04 14:59:37 UTC
I'm working on it right now.  When is Help Freeze?
Comment 16 James Branam 2008-09-04 15:23:50 UTC
We're supposed to have all the Help done and checked in by Friday. Monday (September 8) is the official Help freeze
date. I'll be available all weekend to document this, but the more time I have the better.
Comment 17 David Vancouvering 2008-09-05 05:32:00 UTC
OK, this is fixed, changeset 6ccb2195e655.

James, here is the information for your Help documentation:

When you execute SQL, normally the results tabs from the previous execution are closed.  You can change this behavior so
that the old tab(s) remain open.  To do this you toggle the "keep prior results" setting.  You can do this by selecting
the tool bar, by choosing "Keep prior result tabs" in the context menu for the editor, or by using the keyboard shortcut
CTRL-CMD-T (on Mac, I'm not sure what it is on Windows/Linux).

This setting is saved for all subsequent SQL executions, until/if you toggle it off again.
Comment 18 Andrei Badea 2008-09-05 09:31:42 UTC
I would suggest that the shortcut for this action be removed. I don't think the action will be used that often to
deserver a shortcut, and moreover, NetBeans is running out of shortcuts.
Comment 19 Andrei Badea 2008-09-05 13:05:19 UTC
Reopening. The way this was fixed is too complex and works around for a bug in the editor toolbar which I filed as issue
146312. I simplified the code, remove the shortcut (cf. desc19) and fixed some consistency glitches.

Will attach a patch. Nothing changes from the docs' point of view -- only the shortcut is removed.
Comment 20 Andrei Badea 2008-09-05 13:08:37 UTC
Created attachment 69143 [details]
Proposed changes
Comment 21 Andrei Badea 2008-09-05 14:27:07 UTC
Ah, there is one UI change: the name of the action (displayed when you hover above it) is "Toggle Keep Tabs From
Previous Executions".
Comment 22 Quality Engineering 2008-09-05 17:32:31 UTC
Integrated into 'main-golden', will be available in build *200809051401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6ccb2195e655
User: David Van Couvering <davidvc@netbeans.org>
Log: #144829 - Add toggle button to control whether old tabs are removed on SQL execution
Comment 23 David Vancouvering 2008-09-05 18:34:02 UTC
Thanks, Andrei.  I thought I the default BooleanStateAction didn't support an icon (what I was seeing was just text with
no icon), and assumed this meant I had to build my own toolbar button.  I basically copied this from the Toggle
Highlight Search Text action, but I guess there's a danger with cut-and-paste because often it's old code that doesn't
take advantage of features it should.

It looks like you have to override iconResource(), but glad it works!

Please go ahead and commit your changes and mark as fixed.
Comment 24 James Branam 2008-09-06 17:43:20 UTC
This has been documented in the Help.
Comment 25 Andrei Badea 2008-09-08 13:08:37 UTC
#5c46d9ee77fa

Help already uses "Keep Prior Tabs" as the name of the action, so I sticked to that.
Comment 26 Petr Blaha 2008-09-09 13:42:45 UTC
Product Version: NetBeans IDE Dev (Build 080909)
Comment 27 Quality Engineering 2008-09-10 06:09:39 UTC
Integrated into 'main-golden', will be available in build *200809100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5c46d9ee77fa
User: Andrei Badea <abadea@netbeans.org>
Log: #144829: Don't open new dataview tab for every query