Closed
Bug 307126
Opened 19 years ago
Closed 18 years ago
Closing tabs should return to 'parent' tab.
Categories
(SeaMonkey :: UI Design, enhancement, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
seamonkey1.0beta
People
(Reporter: csthomas, Assigned: csthomas)
References
Details
(Keywords: fixed1.8, relnote, Whiteboard: [seamonkey])
Attachments
(2 files, 2 obsolete files)
6.72 KB,
patch
|
db48x
:
review+
neil
:
superreview+
mscott
:
approval1.8rc1+
|
Details | Diff | Splinter Review |
6.56 KB,
patch
|
Details | Diff | Splinter Review |
I filed this because bug 105722 has too many comments. Don't comment in this bug about: * How it should work (or how any other implementations work) * Firefox * Your two cents I'm implementing bug 105722 comment 136.
Assignee | ||
Updated•19 years ago
|
Target Milestone: --- → Seamonkey1.0alpha
Assignee | ||
Comment 1•19 years ago
|
||
Assignee: guifeatures → cst
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•19 years ago
|
||
Comment on attachment 194924 [details] [diff] [review] patch Given the situations in which it will/won't return to the parent tab, I don't think this needs a pref.
Attachment #194924 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #194924 -
Flags: review?(db48x)
Comment 3•19 years ago
|
||
FYI it takes about 16 lines of tabbrowser.xml code so that when you close the current tab the tab you had open previously (if it still exists) is selected.
Comment 4•19 years ago
|
||
One potential refinement to the heuristic I proposed in bug 105722 comment 16 is to intepret any loss-of-focus action (including switching to another application) as "switching to another tab". In other words, go back to the parent tab when the new tab was opened, took focus, used and then disposed without the user switching focus from that new tab.
Assignee | ||
Comment 5•19 years ago
|
||
(In reply to comment #4) > One potential refinement to the heuristic I proposed in bug 105722 comment 16 is > to intepret any loss-of-focus action (including switching to another > application) as "switching to another tab". > > In other words, go back to the parent tab when the new tab was opened, took > focus, used and then disposed without the user switching focus from that new tab. I can think of too many reasons that would be a confusing behavior. I understand the reasoning, but don't think it would work in the real world.
Whiteboard: [cst: r? sr?]
Assignee | ||
Updated•19 years ago
|
Priority: -- → P1
Target Milestone: Seamonkey1.0alpha → Seamonkey1.0beta
Comment 6•18 years ago
|
||
Comment on attachment 194924 [details] [diff] [review] patch >+ <field name="mParentTab"> >+ null >+ </field> >+ I kinda want a comment stating what this is for, when it's set, when it's used, etc. Or maybe you could change the name to mPreviousTab, or something. Just to indicate that this isn't part of some method of defining a visual heirarchy of tabs. Maybe you could call it mTabToFocusAfterClosingThisTab ;) otherwise it looks good, r=db48x
Attachment #194924 -
Flags: review?(db48x) → review+
Comment 7•18 years ago
|
||
Is this only supposed to apply to new foreground tabs opened from links?
Assignee | ||
Comment 8•18 years ago
|
||
(In reply to comment #7) > Is this only supposed to apply to new foreground tabs opened from links? Yes.
Comment 9•18 years ago
|
||
Comment on attachment 194924 [details] [diff] [review] patch By my reading of the code this will do nasty things if you open a link in a new tab then context-close the original tab...
Attachment #194924 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview-
Comment 10•18 years ago
|
||
yea, it gets a little confused when you close the parent tab, either the way Neil mentioned or by using Close Other Tabs from the context menu.
Assignee | ||
Comment 11•18 years ago
|
||
Renamed mParentTab to mPreviousTab. Made addTab clear mPreviousTab if it doesn't set it to the current tab (I don't think this is absolutely necessary due to the onlocationchange code, but maybe it helps if you open a new tab in the background). Made removeTab check if it's removing the current tab before deciding to select the parent tab, and null mPreviousTab if not.
Attachment #194924 -
Attachment is obsolete: true
Attachment #198454 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #198454 -
Flags: review?(db48x)
Comment 12•18 years ago
|
||
Comment on attachment 198454 [details] [diff] [review] better patch >+ var isCurrentTab = (aTab == this.mCurrentTab); Wrong place to put this, and you don't need a variable for it anyway, mCurrentTab should stay valid until you select another tab. Oh, and for some reason aTab is known as oldTab later on, so change it when you move the condition. >+ if (!this.mPreviousTab || !isCurrentTab) { >+ this.mTabContainer.selectedIndex = newIndex; >+ >+ // When removing a tab to the left of the current tab >+ // fix up the panel index without firing any events >+ this.mPanelContainer.selectedIndex = newIndex; >+ >+ this.mPreviousTab = null; >+ } >+ else { >+ this.selectedTab = this.mPreviousTab; >+ this.mPreviousTab = null; >+ } You don't need to set mPreviousTab to null separately in each half of the if. In fact, the second case is unnecessary as updateCurrentBrowser already clears the previous tab. But to be sure, comment all the times you clear the previous tab to explain why.
Attachment #198454 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview-
Assignee | ||
Updated•18 years ago
|
Attachment #198454 -
Flags: review?(db48x)
Assignee | ||
Comment 13•18 years ago
|
||
Attachment #198454 -
Attachment is obsolete: true
Attachment #198794 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #198794 -
Flags: review?(db48x)
Comment 14•18 years ago
|
||
Comment on attachment 198794 [details] [diff] [review] patch >+ <field name="mPreviousTab"> >+ null >+ </field> Probably belongs next to mCurrentTab. >+ if (!this.mPreviousTab || (oldTab != this.mCurrentTab)) { This condition looks clumsy this way around. I think it would be more obvious to have the "switch to previous tab" as the "true" action instead. >+ else { >+ this.selectedTab = this.mPreviousTab; >+ } Inconsistent bracing - earlier you didn't use {}s (somewhere in addTab iirc).
Attachment #198794 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Comment 15•18 years ago
|
||
Comment on attachment 198794 [details] [diff] [review] patch looks good, and didn't break in testing either. r=db48x
Attachment #198794 -
Flags: review?(db48x) → review+
Assignee | ||
Comment 16•18 years ago
|
||
Comment on attachment 198794 [details] [diff] [review] patch SeaMonkey-only patch
Attachment #198794 -
Flags: approval1.8rc1?
Assignee | ||
Comment 17•18 years ago
|
||
Assignee | ||
Updated•18 years ago
|
Whiteboard: [cst: r? sr?] → [cst: a?]
Assignee | ||
Updated•18 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [cst: a?] → [cst: a?] [cst: fixed-trunk]
Comment 18•18 years ago
|
||
Comment on attachment 200311 [details] [diff] [review] what i checked in on trunk I like this change, it makes sense, and it won't bug me 'coz I always open tabs in the background :-) Now, to pick some nits... > <method name="addTab"> > <parameter name="aURI"/> > <parameter name="aReferrerURI"/> > <parameter name="aCharset"/> >+ <parameter name="aFocusNewTab"/> I'm not sure I like this name. To me it says that this will take care of focusing the new tab for me. I was ready to write and submit a patch to make the other "loadInBackground" places pass in this fourth parameter until I read the other change to |addTab(...)|. Can't think of a better name for this parameter though, other than |aFocusNewTabAndEnableReturnToTheTabTheNewTabWasOpenedFrom|. Suggestions, anyone? :-) I'm almost inclined to say that perhaps setting the "previous tab" doesn't belong here but in the caller that wants it remembered. It'd get rid of the need for the slightly misleading |aFocusNewTab|. >+ if (aFocusNewTab) { >+ var parentTab = this.selectedTab; You can skip |parentTab| and directly assign into |this.mPreviousTab|. >+ } >+ else >+ // The user opened a background tab, so updateCurrentBrowser >+ // won't be called. Explicitly clear the previous tab. >+ this.mPreviousTab = null; In my experience, not having braces around this (even though it's only one line of code and you technically don't need them) is asking for trouble.
Comment 19•18 years ago
|
||
(In reply to comment #18) >>+ if (aFocusNewTab) { >>+ var parentTab = this.selectedTab; > You can skip |parentTab| and directly assign into |this.mPreviousTab|. Not true, because focusing the new tab clears mPreviousTab.
Updated•18 years ago
|
Whiteboard: [cst: a?] [cst: fixed-trunk] → [cst: a?] [cst: fixed-trunk][seamonkey]
Updated•18 years ago
|
Attachment #198794 -
Flags: approval1.8rc1? → approval1.8rc1+
Assignee | ||
Comment 20•18 years ago
|
||
(In reply to comment #18) > In my experience, not having braces around this (even though it's only one line > of code and you technically don't need them) is asking for trouble.
Keywords: fixed1.8
Whiteboard: [cst: a?] [cst: fixed-trunk][seamonkey] → [cst: relnote?][seamonkey]
Comment 21•18 years ago
|
||
(In reply to comment #19) > (In reply to comment #18) > > You can skip |parentTab| and directly assign into |this.mPreviousTab|. > Not true, because focusing the new tab clears mPreviousTab. Doh! That's right. Subtle enough that a comment is warranted?
Assignee | ||
Updated•18 years ago
|
Keywords: relnote
Whiteboard: [cst: relnote?][seamonkey] → [seamonkey]
Comment 22•18 years ago
|
||
It is my understanding from the SeaMonkey 1.0b release notes that this should be working now. As far as I can tell it is not. 1. I started with two tabs: A and B. 2. I added two more with Ctrl-T and had tabs A, B, C, & D, with D being displayed. 3. I switched to Tab B, then to Tab D and closed it. 4. Tab C was then displayed, rather than Tab B as I would have expected had it functioned as described in the release notes.
Assignee | ||
Comment 23•18 years ago
|
||
(In reply to comment #22) > It is my understanding from the SeaMonkey 1.0b release notes that this should > be working now. As far as I can tell it is not. > > 1. I started with two tabs: A and B. > 2. I added two more with Ctrl-T and had tabs A, B, C, & D, with D being > displayed. > 3. I switched to Tab B, then to Tab D and closed it. > 4. Tab C was then displayed, rather than Tab B as I would have expected had it > functioned as described in the release notes. > I implemented bug 105722 comment 136, the suggestion recommended by MoCo's usability person (Mike Beltzner). To return to the parent tab, you have to: 1. Have focus switch to a new tab when you open it 2. No open or close any tabs or switch to other tabs before closing the current tab. An example situation where this will occur: Tabs start as: | google | slashdot | wikipedia | wikipedia | with focus on the google tab. You do a search, and middle-click a result (or if your default is to not select new tabs, shift+middle-click). You get: | google | slashdot | wikipedia | wikipedia | result1 | with focus on result1. If the next thing you do is close the result tab, focus will move back to the google tab. If instead you opened multiple results in tabs in the background, you would be returned to the tab to the left of the one you closed (i.e. the "normal" behavior). If you read bug 105772, you'll see it would be very difficult to make everybody happy, so I chose to implement one method that would be most useful to people who don't change the preferences (e.g. me, when I started). The fact that switching tabs makes it not return to the parent when you close a tab is apparently a usability suggestion (and I see reasons that it does make sense).
Assignee | ||
Comment 24•18 years ago
|
||
> If instead you opened multiple results in tabs in the background, you would be
> returned to the tab to the left of the one you closed (i.e. the "normal"
> behavior).
Sorry, I meant the tab to the right.
You need to log in
before you can comment on or make changes to this bug.
Description
•