Closed
Bug 344140
Opened 18 years ago
Closed 18 years ago
"Recently closed tabs" entries not middle-clickable
Categories
(Firefox :: Menus, enhancement)
Firefox
Menus
Tracking
()
RESOLVED
FIXED
Firefox 3 alpha1
People
(Reporter: bugzilla, Assigned: ventnor.bugzilla)
References
Details
Attachments
(1 file, 10 obsolete files)
1.90 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 BonEcho/2.0b1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 BonEcho/2.0b1 When I stop to think about it, I know that reopening a recently closed tab will create a new tab. However, I usually middle-click any bookmark that I see, so my muscle-memory makes me middle-click the entries in the Recently Closed Tabs list. This has no apparent effect. Reproducible: Always Steps to Reproduce: 1. Close a tab with content in it. 2. Mouse to History > Recently Closed Tabs > 3. Middle-click an entry. Actual Results: Bon Echo closes the menu, but does nothing. Expected Results: A new tab opens, "unclosing" that tab.
Comment 1•18 years ago
|
||
Oh well, to get the right muscle-memory you should use the tab close buttons more often. ;) Although it would make sense to me if the Recently Closed Tabs menu-item was middle-clickable.
Updated•18 years ago
|
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → 2.0 Branch
Comment 2•18 years ago
|
||
I'd rather educate our users to always click the correct button. But since that won't be possible and since this doesn't really hurt anybody, why not implement it anyway?
Severity: minor → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 3•18 years ago
|
||
For some odd reason using checkForMiddleClick doesn't work. This was the best implementation I could think of.
Attachment #229620 -
Flags: review?
Assignee | ||
Updated•18 years ago
|
Attachment #229620 -
Flags: review? → review?(mconnor)
The top-level menu item ('Recently Closed Tabs >') should be middle-clickable as well, given that it contains an 'Open In Tabs' sub-item.
Assignee | ||
Updated•18 years ago
|
Attachment #229620 -
Flags: review?(mconnor) → review?(bugs.mano)
Comment 5•18 years ago
|
||
Hrm, should middle click really do the same thing as left click? One option is to make middle click always append the tab to the end of the tabstrip. Beltzner, any thoughts?
Keywords: uiwanted
Assignee | ||
Comment 6•18 years ago
|
||
Here's my idea, with a patch to go. When the user middle clicks on an item in the recently closed tabs menu, not only does the tab get put on the end but it is put in the background too. That way people who want to switch to it immediately will train their muscle-memory to left click, and people who want this kind of feature can have it through the middle click.
Attachment #229620 -
Attachment is obsolete: true
Attachment #230298 -
Flags: review?(bugs.mano)
Attachment #229620 -
Flags: review?(bugs.mano)
Comment 7•18 years ago
|
||
Comment on attachment 230298 [details] [diff] [review] Patch with my proposed middle-click behaviour get ui-review from beltzner first.
Attachment #230298 -
Flags: review?(bugs.mano)
Assignee | ||
Updated•18 years ago
|
Attachment #230298 -
Flags: ui-review?(beltzner)
Assignee | ||
Comment 8•18 years ago
|
||
A few of my own nits fixed here. Changed the variable names to something more meaningful than "oldTab" and "newTab". We should also revert focus back to the current tab before moving the reopened tab, not after.
Attachment #230298 -
Attachment is obsolete: true
Attachment #230306 -
Flags: ui-review?(beltzner)
Attachment #230298 -
Flags: ui-review?(beltzner)
Comment 9•18 years ago
|
||
Comment on attachment 230306 [details] [diff] [review] Patch with minor nitfixes >+ * If middle-clicked, put the reopened tab on the end in the background. >+ * @param aEvent I understand the putting it at the end in a new tab - that's what middle-clicking a history entry in the history portion of the drop-down would do, too, and that makes sense to me. But why aren't we giving it focus? Now we've got middle-clicks in one part of the history menu appending-tabs-with-focus and middle-clicks in the other part of the history menu appending-tabs-without-focus. Give 'em focus, and you can have my implicit uir+ :) (thanks for fixing the no-middle-click support at all thing, though! nice catch!)
Attachment #230306 -
Flags: ui-review?(beltzner) → ui-review-
Assignee | ||
Comment 10•18 years ago
|
||
OK, the reopened tab will now get focus.
Attachment #230306 -
Attachment is obsolete: true
Attachment #230374 -
Flags: review?(bugs.mano)
Comment 11•18 years ago
|
||
Comment on attachment 230374 [details] [diff] [review] Patch with beltzner's suggestions >- m.addEventListener("command", function(aEvent) { >- undoCloseTab(aEvent.originalTarget.getAttribute("value")); >- }, false); >+ m.addEventListener("click", function(aEvent) { closedTabsMenuClick(aEvent); }, false); Does this mean activating the menu using the keyboard will no longer work?
Comment 12•18 years ago
|
||
Also note that shortcuts like Shift+click (open in a new window) won't work. From the looks of it, fixing that isn't trivial with current session store API.
Assignee | ||
Comment 13•18 years ago
|
||
Now that I think about it, this new way I have designed the patch no longer needs the click listener and can be put into the command listener again. Thanks for the catch, Nick.
Attachment #230374 -
Attachment is obsolete: true
Attachment #230384 -
Flags: ui-review?(beltzner)
Attachment #230384 -
Flags: review?(bugs.mano)
Attachment #230374 -
Flags: review?(bugs.mano)
Comment 14•18 years ago
|
||
No, command event handler gets a nsIDOMXULCommandEvent event, which doesn't have the button property. And I don't think you need to ask beltzner for UI-review again if you do select the created tab.
Updated•18 years ago
|
Attachment #230384 -
Flags: ui-review?(beltzner) → ui-review+
Assignee | ||
Comment 15•18 years ago
|
||
Comment on attachment 230384 [details] [diff] [review] Patch addressing Nickolay's concern OK, I'll try and fix all of this up when i get home.
Attachment #230384 -
Attachment is obsolete: true
Attachment #230384 -
Flags: review?(bugs.mano)
Assignee | ||
Comment 16•18 years ago
|
||
Right, I think I've finally nailed it on the head with this one. It has restored keyboard activation and also has added Ctrl+Click support.
Attachment #230405 -
Flags: review?(bugs.mano)
Comment 17•18 years ago
|
||
Comment on attachment 230405 [details] [diff] [review] Patch _really_ addressing Nickolay's concerns >+ //Fix middle click >+ m.addEventListener("click", function(aEvent) { >+ if (aEvent.button == 1) >+ closedTabsMenuClick(aEvent); > }, false); I didn't test the patch; does this close the popups on middle-clicking? I ask because the checkForMiddleClick() function, which you're copying here, has to close popup menus manually. >+function closedTabsMenuClick(aEvent) { >+ var where = whereToOpenLink(aEvent); >+ undoCloseTab(aEvent.originalTarget.getAttribute("value")); >+ if (aEvent.button == 1 || where == "tab") { Why do you need the aEvent.button check here? whereToOpenLink is supposed to take care of that.
Assignee | ||
Comment 18•18 years ago
|
||
(In reply to comment #17) > (From update of attachment 230405 [details] [diff] [review] [edit]) > >+ //Fix middle click > >+ m.addEventListener("click", function(aEvent) { > >+ if (aEvent.button == 1) > >+ closedTabsMenuClick(aEvent); > > }, false); > > I didn't test the patch; does this close the popups on middle-clicking? I ask > because the checkForMiddleClick() function, which you're copying here, has to > close popup menus manually. > > >+function closedTabsMenuClick(aEvent) { > >+ var where = whereToOpenLink(aEvent); > >+ undoCloseTab(aEvent.originalTarget.getAttribute("value")); > >+ if (aEvent.button == 1 || where == "tab") { > > Why do you need the aEvent.button check here? whereToOpenLink is supposed to > take care of that. > 1. Yes. 2. If the person has the "middle click a link should open tabs" setting off, middle clicking this will be the same as normal click (tab not moved to the end). Of course if this is wanted I can erase this check.
Assignee | ||
Comment 19•18 years ago
|
||
(In reply to comment #18) > (In reply to comment #17) > > (From update of attachment 230405 [details] [diff] [review] [edit] [edit]) > > >+ //Fix middle click > > >+ m.addEventListener("click", function(aEvent) { > > >+ if (aEvent.button == 1) > > >+ closedTabsMenuClick(aEvent); > > > }, false); > > > > I didn't test the patch; does this close the popups on middle-clicking? I ask > > because the checkForMiddleClick() function, which you're copying here, has to > > close popup menus manually. > > > > >+function closedTabsMenuClick(aEvent) { > > >+ var where = whereToOpenLink(aEvent); > > >+ undoCloseTab(aEvent.originalTarget.getAttribute("value")); > > >+ if (aEvent.button == 1 || where == "tab") { > > > > Why do you need the aEvent.button check here? whereToOpenLink is supposed to > > take care of that. > > > > 1. Yes. > 2. If the person has the "middle click a link should open tabs" setting off, > middle clicking this will be the same as normal click (tab not moved to the > end). Of course if this is wanted I can erase this check. > PS. I tried the checkForMiddleClick function twice and it didn't work.
Assignee | ||
Updated•18 years ago
|
Attachment #230405 -
Flags: review?(bugs.mano) → review?(mconnor)
Assignee | ||
Comment 20•18 years ago
|
||
Comment on attachment 230405 [details] [diff] [review] Patch _really_ addressing Nickolay's concerns Add Beltzner's ui-r, waiting on Gavin's review and a checkin.
Attachment #230405 -
Flags: ui-review+
Attachment #230405 -
Flags: review?(mconnor)
Attachment #230405 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 21•18 years ago
|
||
There have been significant changes to the trunk since this patch was made. I updated the patch to reflect these changes.
Attachment #230405 -
Attachment is obsolete: true
Attachment #241126 -
Flags: ui-review+
Attachment #241126 -
Flags: review?(gavin.sharp)
Attachment #230405 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 22•18 years ago
|
||
This moves the button check to within the called function, making the code a bit cleaner.
Attachment #241126 -
Attachment is obsolete: true
Attachment #242848 -
Flags: review?(mano)
Attachment #241126 -
Flags: review?(gavin.sharp)
Comment 23•18 years ago
|
||
Comment on attachment 242848 [details] [diff] [review] Code shift >Index: browser/base/content/browser.js >=================================================================== >+/** >+* Re-open a closed tab and put it to the end of the tab strip. Used for a middle click. nite: 80 characters for a line please >+ * @param aEvent >+ * The event when the user clicks the menu item nit: prefix this with two spaces. >+ */ >+function undoCloseMiddleClick(aEvent) { >+ if (aEvent.button != 1) >+ return; >+ >+ undoCloseTab(aEvent.originalTarget.getAttribute("value")); nit: use the value property instead >+ var tabbrowser = getBrowser(); >+ var reopenedTab = tabbrowser.mCurrentTab; >+ tabbrowser.moveTabTo(reopenedTab, tabbrowser.mTabContainer.childNodes.length - 1); tabbrrowser has a handy moveTabToEnd method
Attachment #242848 -
Flags: review?(mano) → review-
Assignee | ||
Comment 24•18 years ago
|
||
You sure love your nits, Asaf. :P
Attachment #242848 -
Attachment is obsolete: true
Attachment #242852 -
Flags: review?(mano)
Comment 25•18 years ago
|
||
Comment on attachment 242852 [details] [diff] [review] Nits fixed I sure don't like the way you're interpreting the sense behind code reviews (hint: bug 345257), but anyway: >Index: browser/base/content/browser.js >=================================================================== >+/** >+ * Re-open a closed tab and put it to the end of the tab strip. >+ * Used for a middle click. >+ * @param aEvent >+ * The event when the user clicks the menu item nit: missing space ;) >+ */ >+function undoCloseMiddleClick(aEvent) { >+ if (aEvent.button != 1) >+ return; >+ >+ undoCloseTab(aEvent.originalTarget.value); >+ var tabbrowser = getBrowser(); >+ tabbrowser.moveTabToEnd(); make this |getBrowser().moveTabToEnd();| r=mano otherwise.
Attachment #242852 -
Flags: review?(mano) → review+
Assignee | ||
Comment 26•18 years ago
|
||
Sorry, it's just that sometimes the suggestions seem so vague. By prefixing the @param comment did you mean to put the space before or after the asterisk? If I put it before, it made the alignment different to the comments on the actual undoCloseTab function, so I didn't think you meant that. Nonetheless, I think this patch is good to go now (really). :P
Attachment #242852 -
Attachment is obsolete: true
Updated•18 years ago
|
Attachment #242853 -
Flags: review+
Updated•18 years ago
|
Assignee: nobody → ventnor.bugzilla
Target Milestone: --- → Firefox 3 alpha1
Comment 27•18 years ago
|
||
hrm, i get patching file browser/base/content/browser.js patch: **** malformed patch at line 53: when trying to apply your patch, please diff again.
Assignee | ||
Comment 28•18 years ago
|
||
Try again with this patch.
Attachment #242853 -
Attachment is obsolete: true
Assignee | ||
Updated•18 years ago
|
Whiteboard: [has approval - needs checkin]
Assignee | ||
Updated•18 years ago
|
Whiteboard: [has approval - needs checkin] → [needs checkin]
Comment 29•18 years ago
|
||
Checking in browser/base/content/browser.js; /cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js new revision: 1.723; previous revision: 1.722 done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [needs checkin]
Version: 2.0 Branch → Trunk
You need to log in
before you can comment on or make changes to this bug.
Description
•