Closed Bug 343803 Opened 20 years ago Closed 20 years ago

Recently Closed Tabs > Open in Tabs shouldn't overwrite currently-opened tab

Categories

(Firefox :: Menus, defect)

2.0 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2 beta2

People

(Reporter: ispiked, Assigned: dietrich)

References

Details

(Keywords: fixed1.8.1)

Attachments

(2 files)

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1a3) Gecko/20060706 BonEcho/2.0a3 Steps to reproduce: 1. Open a few tabs; close a few tabs. 2. Go to History > Recently Closed Tabs > and choose Open in Tabs. Results: The first item in the list is loaded in the current tab, while the other items are opened in new tabs. Expected results: I would expect this to behave just like it does when a single tab is undone -- e.g. the tab is opened just where it was when it was closed.
Summary: Recently Opened Tabs > Open in Tabs shouldn't overwrite currently-opened tab → Recently Closed Tabs > Open in Tabs shouldn't overwrite currently-opened tab
Assignee: nobody → dietrich
I was attempting to be consistent w/ what "open in tabs" does for bookmarks and history. But overwriting existing tabs is bad. This is good.
Status: NEW → ASSIGNED
Flags: blocking-firefox2?
Target Milestone: --- → Firefox 2 beta2
Blocks: 343806
Flags: blocking-firefox2? → blocking-firefox2+
*** Bug 343939 has been marked as a duplicate of this bug. ***
Attached patch fix — — Splinter Review
>Index: browser/base/content/browser.js >+ m.addEventListener("command", function() { >+ for (var i = 0; i < urls.length; i++) >+ undoCloseTab(urls[i]); >+ }, false); urls[i] is an URL while undoCloseTab expects an integer index (which incidentally will have to be 0 in all cases). The attached patch does away with the URLs completely (they're never needed) and for sake of clarity calls undoCloseTab with no argument at all (i.e. just reopen the most recently closed tab). The only thing to consider is whether to focus the first (most recently closed) or the last restored tab (which currently happens). NB: reopening the tabs in inverse order might result in an incorrect tab order.
Attachment #228559 - Flags: review?(dietrich)
Attachment #228359 - Flags: review?(mconnor)
Comment on attachment 228559 [details] [diff] [review] fix tested this and it looks good, thanks! we can deal with the focus question as part of bug 342432.
Attachment #228559 - Flags: review?(dietrich) → review+
Whiteboard: [checkin needed]
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Comment on attachment 228559 [details] [diff] [review] fix Problem: The current "Open All in Tabs" implementation uses the old openOneOrMoreURIs function, which overwrites existing tabs and doesn't restore state. Solution: Use the undoCloseTab function, which will re-open the tabs in their original location and state. Risk: Low
Attachment #228559 - Flags: approval1.8.1?
Comment on attachment 228559 [details] [diff] [review] fix a=mconnor on behalf of drivers
Attachment #228559 - Flags: approval1.8.1? → approval1.8.1+
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [checkin needed (1.8 branch)]
I'm assuming the fact that this was reopened is a mistake...
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Don't know why but these radio buttons have a tendency of changing state when reloading a bug after logging in. My bad.
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: